orb

package module
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

README

Orb Go API Library

Go Reference

The Orb Go library provides convenient access to the Orb REST API from applications written in Go. The full API of this library can be found in api.md.

Installation

import (
	"github.com/orbcorp/orb-go" // imported as orb
)

Or to pin the version:

go get -u 'github.com/orbcorp/orb-go@v0.24.0'

Requirements

This library requires Go 1.18+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/orbcorp/orb-go"
	"github.com/orbcorp/orb-go/option"
)

func main() {
	client := orb.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("ORB_API_KEY")
	)
	customer, err := client.Customers.New(context.TODO(), orb.CustomerNewParams{
		Email: orb.F("example-customer@withorb.com"),
		Name:  orb.F("My Customer"),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", customer.ID)
}

Request fields

All request parameters are wrapped in a generic Field type, which we use to distinguish zero values from null or omitted fields.

This prevents accidentally sending a zero value if you forget a required parameter, and enables explicitly sending null, false, '', or 0 on optional parameters. Any field not specified is not sent.

To construct fields with values, use the helpers String(), Int(), Float(), or most commonly, the generic F[T](). To send a null, use Null[T](), and to send a nonconforming value, use Raw[T](any). For example:

params := FooParams{
	Name: orb.F("hello"),

	// Explicitly send `"description": null`
	Description: orb.Null[string](),

	Point: orb.F(orb.Point{
		X: orb.Int(0),
		Y: orb.Int(1),

		// In cases where the API specifies a given type,
		// but you want to send something else, use `Raw`:
		Z: orb.Raw[int64](0.01), // sends a float
	}),
}
Response objects

All fields in response structs are value types (not pointers or wrappers).

If a given field is null, not present, or invalid, the corresponding field will simply be its zero value.

All response structs also include a special JSON field, containing more detailed information about each property, which you can use like so:

if res.Name == "" {
	// true if `"name"` is either not present or explicitly null
	res.JSON.Name.IsNull()

	// true if the `"name"` key was not present in the repsonse JSON at all
	res.JSON.Name.IsMissing()

	// When the API returns data that cannot be coerced to the expected type:
	if res.JSON.Name.IsInvalid() {
		raw := res.JSON.Name.Raw()

		legacyName := struct{
			First string `json:"first"`
			Last  string `json:"last"`
		}{}
		json.Unmarshal([]byte(raw), &legacyName)
		name = legacyName.First + " " + legacyName.Last
	}
}

These .JSON structs also include an Extras map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := orb.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Customers.New(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

iter := client.Coupons.ListAutoPaging(context.TODO(), orb.CouponListParams{})
// Automatically fetches more pages as needed.
for iter.Next() {
	coupon := iter.Current()
	fmt.Printf("%+v\n", coupon)
}
if err := iter.Err(); err != nil {
	panic(err.Error())
}

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

page, err := client.Coupons.List(context.TODO(), orb.CouponListParams{})
for page != nil {
	for _, coupon := range page.Data {
		fmt.Printf("%+v\n", coupon)
	}
	page, err = page.GetNextPage()
}
if err != nil {
	panic(err.Error())
}
Errors

When the API returns a non-success status code, we return an error with type *orb.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.Customers.New(context.TODO(), orb.CustomerNewParams{
	Email: orb.F("example-customer@withorb.com"),
	Name:  orb.F("My Customer"),
})
if err != nil {
	var apierr *orb.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/customers": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Customers.New(
	ctx,
	orb.CustomerNewParams{
		Email: orb.F("example-customer@withorb.com"),
		Name:  orb.F("My Customer"),
	},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as param.Field[io.Reader]. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper orb.FileParam(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := orb.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Customers.New(
	context.TODO(),
	orb.CustomerNewParams{
		Email: orb.F("example-customer@withorb.com"),
		Name:  orb.F("My Customer"),
	},
	option.WithMaxRetries(5),
)
Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := orb.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals).
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Documentation

Index

Constants

View Source
const DiscountAmountDiscountDiscountTypeAmount = shared.DiscountAmountDiscountDiscountTypeAmount

This is an alias to an internal value.

View Source
const DiscountPercentageDiscountDiscountTypePercentage = shared.DiscountPercentageDiscountDiscountTypePercentage

This is an alias to an internal value.

View Source
const DiscountTrialDiscountDiscountTypeTrial = shared.DiscountTrialDiscountDiscountTypeTrial

This is an alias to an internal value.

View Source
const DiscountUsageDiscountDiscountTypeUsage = shared.DiscountUsageDiscountDiscountTypeUsage

This is an alias to an internal value.

Variables

This section is empty.

Functions

func Bool

func Bool(value bool) param.Field[bool]

Bool is a param field helper which helps specify bools.

func F

func F[T any](value T) param.Field[T]

F is a param field helper used to initialize a param.Field generic struct. This helps specify null, zero values, and overrides, as well as normal values. You can read more about this in our README.

func FileParam added in v0.24.0

func FileParam(reader io.Reader, filename string, contentType string) param.Field[io.Reader]

FileParam is a param field helper which helps files with a mime content-type.

func Float

func Float(value float64) param.Field[float64]

Float is a param field helper which helps specify floats.

func Int

func Int(value int64) param.Field[int64]

Int is a param field helper which helps specify integers. This is particularly helpful when specifying integer constants for fields.

func Null

func Null[T any]() param.Field[T]

Null is a param field helper which explciitly sends null to the API.

func Raw

func Raw[T any](value any) param.Field[T]

Raw is a param field helper for specifying values for fields when the type you are looking to send is different from the type that is specified in the SDK. For example, if the type of the field is an integer, but you want to send a float, you could do that by setting the corresponding field with Raw[int](0.5).

func String

func String(value string) param.Field[string]

String is a param field helper which helps specify strings.

Types

type BetaPriceEvaluateParams added in v0.12.0

type BetaPriceEvaluateParams struct {
	// The exclusive upper bound for event timestamps
	TimeframeEnd param.Field[time.Time] `json:"timeframe_end,required" format:"date-time"`
	// The inclusive lower bound for event timestamps
	TimeframeStart param.Field[time.Time] `json:"timeframe_start,required" format:"date-time"`
	// The ID of the customer to which this evaluation is scoped.
	CustomerID param.Field[string] `json:"customer_id"`
	// The external customer ID of the customer to which this evaluation is scoped.
	ExternalCustomerID param.Field[string] `json:"external_customer_id"`
	// A boolean
	// [computed property](../guides/extensibility/advanced-metrics#computed-properties)
	// used to filter the underlying billable metric
	Filter param.Field[string] `json:"filter"`
	// Properties (or
	// [computed properties](../guides/extensibility/advanced-metrics#computed-properties))
	// used to group the underlying billable metric
	GroupingKeys param.Field[[]string] `json:"grouping_keys"`
}

func (BetaPriceEvaluateParams) MarshalJSON added in v0.12.0

func (r BetaPriceEvaluateParams) MarshalJSON() (data []byte, err error)

type BetaPriceEvaluateResponse added in v0.12.0

type BetaPriceEvaluateResponse struct {
	Data []EvaluatePriceGroup          `json:"data,required"`
	JSON betaPriceEvaluateResponseJSON `json:"-"`
}

func (*BetaPriceEvaluateResponse) UnmarshalJSON added in v0.12.0

func (r *BetaPriceEvaluateResponse) UnmarshalJSON(data []byte) (err error)

type BetaPriceService added in v0.12.0

type BetaPriceService struct {
	Options []option.RequestOption
}

BetaPriceService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaPriceService method instead.

func NewBetaPriceService added in v0.12.0

func NewBetaPriceService(opts ...option.RequestOption) (r *BetaPriceService)

NewBetaPriceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BetaPriceService) Evaluate added in v0.12.0

This endpoint is used to evaluate the output of a price for a given customer and time range. It enables filtering and grouping the output using [computed properties](../guides/extensibility/advanced-metrics#computed-properties), supporting the following workflows:

1. Showing detailed usage and costs to the end customer. 2. Auditing subtotals on invoice line items.

For these workflows, the expressiveness of computed properties in both the filters and grouping is critical. For example, if you'd like to show your customer their usage grouped by hour and another property, you can do so with the following `grouping_keys`: `["hour_floor_timestamp_millis(timestamp_millis)", "my_property"]`. If you'd like to examine a customer's usage for a specific property value, you can do so with the following `filter`: `my_property = 'foo' AND my_other_property = 'bar'`.

By default, the start of the time range must be no more than 100 days ago and the length of the results must be no greater than 1000. Note that this is a POST endpoint rather than a GET endpoint because it employs a JSON body rather than query parameters.

type BetaService added in v0.12.0

type BetaService struct {
	Options []option.RequestOption
	Price   *BetaPriceService
}

BetaService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBetaService method instead.

func NewBetaService added in v0.12.0

func NewBetaService(opts ...option.RequestOption) (r *BetaService)

NewBetaService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type Client

type Client struct {
	Options          []option.RequestOption
	TopLevel         *TopLevelService
	Coupons          *CouponService
	CreditNotes      *CreditNoteService
	Customers        *CustomerService
	Events           *EventService
	InvoiceLineItems *InvoiceLineItemService
	Invoices         *InvoiceService
	Items            *ItemService
	Metrics          *MetricService
	Plans            *PlanService
	Prices           *PriceService
	Subscriptions    *SubscriptionService
	Beta             *BetaService
}

Client creates a struct with services and top level methods that help with interacting with the orb API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r *Client)

NewClient generates a new client with the default option read from the environment (ORB_API_KEY). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

type Coupon

type Coupon struct {
	// Also referred to as coupon_id in this documentation.
	ID string `json:"id,required"`
	// An archived coupon can no longer be redeemed. Active coupons will have a value
	// of null for `archived_at`; this field will be non-null for archived coupons.
	ArchivedAt time.Time      `json:"archived_at,required,nullable" format:"date-time"`
	Discount   CouponDiscount `json:"discount,required"`
	// This allows for a coupon's discount to apply for a limited time (determined in
	// months); a `null` value here means "unlimited time".
	DurationInMonths int64 `json:"duration_in_months,required,nullable"`
	// The maximum number of redemptions allowed for this coupon before it is
	// exhausted; `null` here means "unlimited".
	MaxRedemptions int64 `json:"max_redemptions,required,nullable"`
	// This string can be used to redeem this coupon for a given subscription.
	RedemptionCode string `json:"redemption_code,required"`
	// The number of times this coupon has been redeemed.
	TimesRedeemed int64      `json:"times_redeemed,required"`
	JSON          couponJSON `json:"-"`
}

A coupon represents a reusable discount configuration, and have an attached redemption code that can be issued to your end users. Coupons are most often used in self-serve signup or upgrade flows in your checkout experience or billing portal.

To redeem a coupon, pass the `redemption_code` property in the [create subscription](create-subscription.api.mdx) or [schedule plan change](schedule-plan-change.api.mdx) request.

func (*Coupon) UnmarshalJSON

func (r *Coupon) UnmarshalJSON(data []byte) (err error)

type CouponDiscount added in v0.2.0

type CouponDiscount interface {
	// contains filtered or unexported methods
}

Union satisfied by CouponDiscountPercentageDiscount or CouponDiscountAmountDiscount.

type CouponDiscountAmountDiscount added in v0.2.0

type CouponDiscountAmountDiscount struct {
	// Only available if discount_type is `amount`.
	AmountDiscount string `json:"amount_discount,required"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs []string                                 `json:"applies_to_price_ids,required"`
	DiscountType      CouponDiscountAmountDiscountDiscountType `json:"discount_type,required"`
	Reason            string                                   `json:"reason,nullable"`
	JSON              couponDiscountAmountDiscountJSON         `json:"-"`
}

func (*CouponDiscountAmountDiscount) UnmarshalJSON added in v0.2.0

func (r *CouponDiscountAmountDiscount) UnmarshalJSON(data []byte) (err error)

type CouponDiscountAmountDiscountDiscountType added in v0.2.0

type CouponDiscountAmountDiscountDiscountType string
const (
	CouponDiscountAmountDiscountDiscountTypeAmount CouponDiscountAmountDiscountDiscountType = "amount"
)

func (CouponDiscountAmountDiscountDiscountType) IsKnown added in v0.24.0

type CouponDiscountPercentageDiscount added in v0.2.0

type CouponDiscountPercentageDiscount struct {
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs []string                                     `json:"applies_to_price_ids,required"`
	DiscountType      CouponDiscountPercentageDiscountDiscountType `json:"discount_type,required"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount float64                              `json:"percentage_discount,required"`
	Reason             string                               `json:"reason,nullable"`
	JSON               couponDiscountPercentageDiscountJSON `json:"-"`
}

func (*CouponDiscountPercentageDiscount) UnmarshalJSON added in v0.2.0

func (r *CouponDiscountPercentageDiscount) UnmarshalJSON(data []byte) (err error)

type CouponDiscountPercentageDiscountDiscountType added in v0.2.0

type CouponDiscountPercentageDiscountDiscountType string
const (
	CouponDiscountPercentageDiscountDiscountTypePercentage CouponDiscountPercentageDiscountDiscountType = "percentage"
)

func (CouponDiscountPercentageDiscountDiscountType) IsKnown added in v0.24.0

type CouponListParams

type CouponListParams struct {
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor param.Field[string] `query:"cursor"`
	// The number of items to fetch. Defaults to 20.
	Limit param.Field[int64] `query:"limit"`
	// Filter to coupons matching this redemption code.
	RedemptionCode param.Field[string] `query:"redemption_code"`
	// Show archived coupons as well (by default, this endpoint only returns active
	// coupons).
	ShowArchived param.Field[bool] `query:"show_archived"`
}

func (CouponListParams) URLQuery

func (r CouponListParams) URLQuery() (v url.Values)

URLQuery serializes CouponListParams's query parameters as `url.Values`.

type CouponNewParams

type CouponNewParams struct {
	Discount param.Field[CouponNewParamsDiscount] `json:"discount,required"`
	// This string can be used to redeem this coupon for a given subscription.
	RedemptionCode param.Field[string] `json:"redemption_code,required"`
	// This allows for a coupon's discount to apply for a limited time (determined in
	// months); a `null` value here means "unlimited time".
	DurationInMonths param.Field[int64] `json:"duration_in_months"`
	// The maximum number of redemptions allowed for this coupon before it is
	// exhausted;`null` here means "unlimited".
	MaxRedemptions param.Field[int64] `json:"max_redemptions"`
}

func (CouponNewParams) MarshalJSON

func (r CouponNewParams) MarshalJSON() (data []byte, err error)

type CouponNewParamsDiscount added in v0.2.0

type CouponNewParamsDiscount interface {
	// contains filtered or unexported methods
}

Satisfied by CouponNewParamsDiscountPercentageDiscount, CouponNewParamsDiscountAmountDiscount.

type CouponNewParamsDiscountAmountDiscount added in v0.2.0

type CouponNewParamsDiscountAmountDiscount struct {
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount,required"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string]                                          `json:"applies_to_price_ids,required"`
	DiscountType      param.Field[CouponNewParamsDiscountAmountDiscountDiscountType] `json:"discount_type,required"`
	Reason            param.Field[string]                                            `json:"reason"`
}

func (CouponNewParamsDiscountAmountDiscount) MarshalJSON added in v0.2.0

func (r CouponNewParamsDiscountAmountDiscount) MarshalJSON() (data []byte, err error)

type CouponNewParamsDiscountAmountDiscountDiscountType added in v0.2.0

type CouponNewParamsDiscountAmountDiscountDiscountType string
const (
	CouponNewParamsDiscountAmountDiscountDiscountTypeAmount CouponNewParamsDiscountAmountDiscountDiscountType = "amount"
)

func (CouponNewParamsDiscountAmountDiscountDiscountType) IsKnown added in v0.24.0

type CouponNewParamsDiscountPercentageDiscount added in v0.2.0

type CouponNewParamsDiscountPercentageDiscount struct {
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string]                                              `json:"applies_to_price_ids,required"`
	DiscountType      param.Field[CouponNewParamsDiscountPercentageDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount,required"`
	Reason             param.Field[string]  `json:"reason"`
}

func (CouponNewParamsDiscountPercentageDiscount) MarshalJSON added in v0.2.0

func (r CouponNewParamsDiscountPercentageDiscount) MarshalJSON() (data []byte, err error)

type CouponNewParamsDiscountPercentageDiscountDiscountType added in v0.2.0

type CouponNewParamsDiscountPercentageDiscountDiscountType string
const (
	CouponNewParamsDiscountPercentageDiscountDiscountTypePercentage CouponNewParamsDiscountPercentageDiscountDiscountType = "percentage"
)

func (CouponNewParamsDiscountPercentageDiscountDiscountType) IsKnown added in v0.24.0

type CouponService

type CouponService struct {
	Options       []option.RequestOption
	Subscriptions *CouponSubscriptionService
}

CouponService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCouponService method instead.

func NewCouponService

func NewCouponService(opts ...option.RequestOption) (r *CouponService)

NewCouponService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CouponService) Archive

func (r *CouponService) Archive(ctx context.Context, couponID string, opts ...option.RequestOption) (res *Coupon, err error)

This endpoint allows a coupon to be archived. Archived coupons can no longer be redeemed, and will be hidden from lists of active coupons. Additionally, once a coupon is archived, its redemption code can be reused for a different coupon.

func (*CouponService) Fetch

func (r *CouponService) Fetch(ctx context.Context, couponID string, opts ...option.RequestOption) (res *Coupon, err error)

This endpoint retrieves a coupon by its ID. To fetch coupons by their redemption code, use the [List coupons](list-coupons) endpoint with the redemption_code parameter.

func (*CouponService) List

func (r *CouponService) List(ctx context.Context, query CouponListParams, opts ...option.RequestOption) (res *shared.Page[Coupon], err error)

This endpoint returns a list of all coupons for an account in a list format.

The list of coupons is ordered starting from the most recently created coupon. The response also includes `pagination_metadata`, which lets the caller retrieve the next page of results if they exist. More information about pagination can be found in the Pagination-metadata schema.

func (*CouponService) ListAutoPaging

func (r *CouponService) ListAutoPaging(ctx context.Context, query CouponListParams, opts ...option.RequestOption) *shared.PageAutoPager[Coupon]

This endpoint returns a list of all coupons for an account in a list format.

The list of coupons is ordered starting from the most recently created coupon. The response also includes `pagination_metadata`, which lets the caller retrieve the next page of results if they exist. More information about pagination can be found in the Pagination-metadata schema.

func (*CouponService) New

func (r *CouponService) New(ctx context.Context, body CouponNewParams, opts ...option.RequestOption) (res *Coupon, err error)

This endpoint allows the creation of coupons, which can then be redeemed at subscription creation or plan change.

type CouponSubscriptionListParams

type CouponSubscriptionListParams struct {
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor param.Field[string] `query:"cursor"`
	// The number of items to fetch. Defaults to 20.
	Limit param.Field[int64] `query:"limit"`
}

func (CouponSubscriptionListParams) URLQuery

func (r CouponSubscriptionListParams) URLQuery() (v url.Values)

URLQuery serializes CouponSubscriptionListParams's query parameters as `url.Values`.

type CouponSubscriptionService

type CouponSubscriptionService struct {
	Options []option.RequestOption
}

CouponSubscriptionService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCouponSubscriptionService method instead.

func NewCouponSubscriptionService

func NewCouponSubscriptionService(opts ...option.RequestOption) (r *CouponSubscriptionService)

NewCouponSubscriptionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CouponSubscriptionService) List

This endpoint returns a list of all subscriptions that have redeemed a given coupon as a [paginated](../reference/pagination) list, ordered starting from the most recently created subscription. For a full discussion of the subscription resource, see Subscription(../guides/concepts#subscription).

func (*CouponSubscriptionService) ListAutoPaging

This endpoint returns a list of all subscriptions that have redeemed a given coupon as a [paginated](../reference/pagination) list, ordered starting from the most recently created subscription. For a full discussion of the subscription resource, see Subscription(../guides/concepts#subscription).

type CreditNote

type CreditNote struct {
	// The Orb id of this credit note.
	ID string `json:"id,required"`
	// The creation time of the resource in Orb.
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The unique identifier for credit notes.
	CreditNoteNumber string `json:"credit_note_number,required"`
	// A URL to a PDF of the credit note.
	CreditNotePdf string             `json:"credit_note_pdf,required,nullable"`
	Customer      CreditNoteCustomer `json:"customer,required"`
	// Any discounts applied on the original invoice.
	Discounts []CreditNoteDiscount `json:"discounts,required"`
	// The id of the invoice resource that this credit note is applied to.
	InvoiceID string `json:"invoice_id,required"`
	// All of the line items associated with this credit note.
	LineItems []CreditNoteLineItem `json:"line_items,required"`
	// The maximum amount applied on the original invoice
	MaximumAmountAdjustment CreditNoteMaximumAmountAdjustment `json:"maximum_amount_adjustment,required,nullable"`
	// An optional memo supplied on the credit note.
	Memo string `json:"memo,required,nullable"`
	// Any credited amount from the applied minimum on the invoice.
	MinimumAmountRefunded string           `json:"minimum_amount_refunded,required,nullable"`
	Reason                CreditNoteReason `json:"reason,required,nullable"`
	// The total prior to any creditable invoice-level discounts or minimums.
	Subtotal string `json:"subtotal,required"`
	// The total including creditable invoice-level discounts or minimums, and tax.
	Total string         `json:"total,required"`
	Type  CreditNoteType `json:"type,required"`
	// The time at which the credit note was voided in Orb, if applicable.
	VoidedAt time.Time      `json:"voided_at,required,nullable" format:"date-time"`
	JSON     creditNoteJSON `json:"-"`
}

The [Credit Note](/guides/invoicing/credit-notes) resource represents a credit that has been applied to a particular invoice.

func (*CreditNote) UnmarshalJSON

func (r *CreditNote) UnmarshalJSON(data []byte) (err error)

type CreditNoteCustomer

type CreditNoteCustomer struct {
	ID                 string                 `json:"id,required"`
	ExternalCustomerID string                 `json:"external_customer_id,required,nullable"`
	JSON               creditNoteCustomerJSON `json:"-"`
}

func (*CreditNoteCustomer) UnmarshalJSON

func (r *CreditNoteCustomer) UnmarshalJSON(data []byte) (err error)

type CreditNoteDiscount added in v0.2.0

type CreditNoteDiscount struct {
	AmountApplied      string                              `json:"amount_applied,required"`
	DiscountType       CreditNoteDiscountsDiscountType     `json:"discount_type,required"`
	PercentageDiscount float64                             `json:"percentage_discount,required"`
	AppliesToPrices    []CreditNoteDiscountsAppliesToPrice `json:"applies_to_prices,nullable"`
	Reason             string                              `json:"reason,nullable"`
	JSON               creditNoteDiscountJSON              `json:"-"`
}

func (*CreditNoteDiscount) UnmarshalJSON added in v0.2.0

func (r *CreditNoteDiscount) UnmarshalJSON(data []byte) (err error)

type CreditNoteDiscountsAppliesToPrice added in v0.2.0

type CreditNoteDiscountsAppliesToPrice struct {
	ID   string                                `json:"id,required"`
	Name string                                `json:"name,required"`
	JSON creditNoteDiscountsAppliesToPriceJSON `json:"-"`
}

func (*CreditNoteDiscountsAppliesToPrice) UnmarshalJSON added in v0.2.0

func (r *CreditNoteDiscountsAppliesToPrice) UnmarshalJSON(data []byte) (err error)

type CreditNoteDiscountsDiscountType added in v0.2.0

type CreditNoteDiscountsDiscountType string
const (
	CreditNoteDiscountsDiscountTypePercentage CreditNoteDiscountsDiscountType = "percentage"
)

func (CreditNoteDiscountsDiscountType) IsKnown added in v0.24.0

type CreditNoteLineItem

type CreditNoteLineItem struct {
	// The Orb id of this resource.
	ID string `json:"id,required"`
	// The amount of the line item, including any line item minimums and discounts.
	Amount string `json:"amount,required"`
	// Any line item discounts from the invoice's line item.
	Discounts []CreditNoteLineItemsDiscount `json:"discounts,required"`
	// The name of the corresponding invoice line item.
	Name string `json:"name,required"`
	// An optional quantity credited.
	Quantity float64 `json:"quantity,required,nullable"`
	// The amount of the line item, excluding any line item minimums and discounts.
	Subtotal string `json:"subtotal,required"`
	// Any tax amounts applied onto the line item.
	TaxAmounts []CreditNoteLineItemsTaxAmount `json:"tax_amounts,required"`
	JSON       creditNoteLineItemJSON         `json:"-"`
}

func (*CreditNoteLineItem) UnmarshalJSON

func (r *CreditNoteLineItem) UnmarshalJSON(data []byte) (err error)

type CreditNoteLineItemsDiscount added in v0.2.0

type CreditNoteLineItemsDiscount struct {
	ID                 string                                   `json:"id,required"`
	AmountApplied      string                                   `json:"amount_applied,required"`
	AppliesToPriceIDs  []string                                 `json:"applies_to_price_ids,required"`
	DiscountType       CreditNoteLineItemsDiscountsDiscountType `json:"discount_type,required"`
	PercentageDiscount float64                                  `json:"percentage_discount,required"`
	AmountDiscount     string                                   `json:"amount_discount,nullable"`
	Reason             string                                   `json:"reason,nullable"`
	JSON               creditNoteLineItemsDiscountJSON          `json:"-"`
}

func (*CreditNoteLineItemsDiscount) UnmarshalJSON added in v0.2.0

func (r *CreditNoteLineItemsDiscount) UnmarshalJSON(data []byte) (err error)

type CreditNoteLineItemsDiscountsDiscountType added in v0.2.0

type CreditNoteLineItemsDiscountsDiscountType string
const (
	CreditNoteLineItemsDiscountsDiscountTypePercentage CreditNoteLineItemsDiscountsDiscountType = "percentage"
	CreditNoteLineItemsDiscountsDiscountTypeAmount     CreditNoteLineItemsDiscountsDiscountType = "amount"
)

func (CreditNoteLineItemsDiscountsDiscountType) IsKnown added in v0.24.0

type CreditNoteLineItemsTaxAmount added in v0.2.0

type CreditNoteLineItemsTaxAmount struct {
	// The amount of additional tax incurred by this tax rate.
	Amount string `json:"amount,required"`
	// The human-readable description of the applied tax rate.
	TaxRateDescription string `json:"tax_rate_description,required"`
	// The tax rate percentage, out of 100.
	TaxRatePercentage string                           `json:"tax_rate_percentage,required,nullable"`
	JSON              creditNoteLineItemsTaxAmountJSON `json:"-"`
}

func (*CreditNoteLineItemsTaxAmount) UnmarshalJSON added in v0.2.0

func (r *CreditNoteLineItemsTaxAmount) UnmarshalJSON(data []byte) (err error)

type CreditNoteListParams

type CreditNoteListParams struct {
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor param.Field[string] `query:"cursor"`
	// The number of items to fetch. Defaults to 20.
	Limit param.Field[int64] `query:"limit"`
}

func (CreditNoteListParams) URLQuery

func (r CreditNoteListParams) URLQuery() (v url.Values)

URLQuery serializes CreditNoteListParams's query parameters as `url.Values`.

type CreditNoteMaximumAmountAdjustment added in v0.2.0

type CreditNoteMaximumAmountAdjustment struct {
	AmountApplied      string                                            `json:"amount_applied,required"`
	DiscountType       CreditNoteMaximumAmountAdjustmentDiscountType     `json:"discount_type,required"`
	PercentageDiscount float64                                           `json:"percentage_discount,required"`
	AppliesToPrices    []CreditNoteMaximumAmountAdjustmentAppliesToPrice `json:"applies_to_prices,nullable"`
	Reason             string                                            `json:"reason,nullable"`
	JSON               creditNoteMaximumAmountAdjustmentJSON             `json:"-"`
}

The maximum amount applied on the original invoice

func (*CreditNoteMaximumAmountAdjustment) UnmarshalJSON added in v0.2.0

func (r *CreditNoteMaximumAmountAdjustment) UnmarshalJSON(data []byte) (err error)

type CreditNoteMaximumAmountAdjustmentAppliesToPrice added in v0.2.0

type CreditNoteMaximumAmountAdjustmentAppliesToPrice struct {
	ID   string                                              `json:"id,required"`
	Name string                                              `json:"name,required"`
	JSON creditNoteMaximumAmountAdjustmentAppliesToPriceJSON `json:"-"`
}

func (*CreditNoteMaximumAmountAdjustmentAppliesToPrice) UnmarshalJSON added in v0.2.0

func (r *CreditNoteMaximumAmountAdjustmentAppliesToPrice) UnmarshalJSON(data []byte) (err error)

type CreditNoteMaximumAmountAdjustmentDiscountType added in v0.2.0

type CreditNoteMaximumAmountAdjustmentDiscountType string
const (
	CreditNoteMaximumAmountAdjustmentDiscountTypePercentage CreditNoteMaximumAmountAdjustmentDiscountType = "percentage"
)

func (CreditNoteMaximumAmountAdjustmentDiscountType) IsKnown added in v0.24.0

type CreditNoteReason

type CreditNoteReason string
const (
	CreditNoteReasonDuplicate             CreditNoteReason = "Duplicate"
	CreditNoteReasonFraudulent            CreditNoteReason = "Fraudulent"
	CreditNoteReasonOrderChange           CreditNoteReason = "Order change"
	CreditNoteReasonProductUnsatisfactory CreditNoteReason = "Product unsatisfactory"
)

func (CreditNoteReason) IsKnown added in v0.24.0

func (r CreditNoteReason) IsKnown() bool

type CreditNoteService

type CreditNoteService struct {
	Options []option.RequestOption
}

CreditNoteService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCreditNoteService method instead.

func NewCreditNoteService

func NewCreditNoteService(opts ...option.RequestOption) (r *CreditNoteService)

NewCreditNoteService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CreditNoteService) Fetch

func (r *CreditNoteService) Fetch(ctx context.Context, creditNoteID string, opts ...option.RequestOption) (res *CreditNote, err error)

This endpoint is used to fetch a single [`Credit Note`](../guides/invoicing/credit-notes) given an identifier.

func (*CreditNoteService) List

Get a paginated list of CreditNotes. Users can also filter by customer_id, subscription_id, or external_customer_id. The credit notes will be returned in reverse chronological order by `creation_time`.

func (*CreditNoteService) ListAutoPaging

Get a paginated list of CreditNotes. Users can also filter by customer_id, subscription_id, or external_customer_id. The credit notes will be returned in reverse chronological order by `creation_time`.

type CreditNoteType

type CreditNoteType string
const (
	CreditNoteTypeRefund     CreditNoteType = "refund"
	CreditNoteTypeAdjustment CreditNoteType = "adjustment"
)

func (CreditNoteType) IsKnown added in v0.24.0

func (r CreditNoteType) IsKnown() bool

type Customer

type Customer struct {
	ID               string   `json:"id,required"`
	AdditionalEmails []string `json:"additional_emails,required"`
	AutoCollection   bool     `json:"auto_collection,required"`
	// The customer's current balance in their currency.
	Balance        string                 `json:"balance,required"`
	BillingAddress CustomerBillingAddress `json:"billing_address,required,nullable"`
	CreatedAt      time.Time              `json:"created_at,required" format:"date-time"`
	Currency       string                 `json:"currency,required,nullable"`
	// A valid customer email, to be used for notifications. When Orb triggers payment
	// through a payment gateway, this email will be used for any automatically issued
	// receipts.
	Email         string `json:"email,required"`
	EmailDelivery bool   `json:"email_delivery,required"`
	// An optional user-defined ID for this customer resource, used throughout the
	// system as an alias for this Customer. Use this field to identify a customer by
	// an existing identifier in your system.
	ExternalCustomerID string `json:"external_customer_id,required,nullable"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata map[string]string `json:"metadata,required"`
	// The full name of the customer
	Name string `json:"name,required"`
	// This is used for creating charges or invoices in an external system via Orb.
	// When not in test mode, the connection must first be configured in the Orb
	// webapp.
	PaymentProvider CustomerPaymentProvider `json:"payment_provider,required,nullable"`
	// The ID of this customer in an external payments solution, such as Stripe. This
	// is used for creating charges or invoices in the external system via Orb.
	PaymentProviderID string                  `json:"payment_provider_id,required,nullable"`
	PortalURL         string                  `json:"portal_url,required,nullable"`
	ShippingAddress   CustomerShippingAddress `json:"shipping_address,required,nullable"`
	// Tax IDs are commonly required to be displayed on customer invoices, which are
	// added to the headers of invoices.
	//
	// ### Supported Tax ID Countries and Types
	//
	// | Country              | Type         | Description                                                                                             |
	// | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
	// | Andorra              | `ad_nrt`     | Andorran NRT number                                                                                     |
	// | Australia            | `au_abn`     | Australian Business Number (AU ABN)                                                                     |
	// | Australia            | `au_arn`     | Australian Taxation Office Reference Number                                                             |
	// | Austria              | `eu_vat`     | European VAT number                                                                                     |
	// | Belgium              | `eu_vat`     | European VAT number                                                                                     |
	// | Brazil               | `br_cnpj`    | Brazilian CNPJ number                                                                                   |
	// | Brazil               | `br_cpf`     | Brazilian CPF number                                                                                    |
	// | Bulgaria             | `bg_uic`     | Bulgaria Unified Identification Code                                                                    |
	// | Bulgaria             | `eu_vat`     | European VAT number                                                                                     |
	// | Canada               | `ca_bn`      | Canadian BN                                                                                             |
	// | Canada               | `ca_gst_hst` | Canadian GST/HST number                                                                                 |
	// | Canada               | `ca_pst_bc`  | Canadian PST number (British Columbia)                                                                  |
	// | Canada               | `ca_pst_mb`  | Canadian PST number (Manitoba)                                                                          |
	// | Canada               | `ca_pst_sk`  | Canadian PST number (Saskatchewan)                                                                      |
	// | Canada               | `ca_qst`     | Canadian QST number (Québec)                                                                            |
	// | Chile                | `cl_tin`     | Chilean TIN                                                                                             |
	// | Croatia              | `eu_vat`     | European VAT number                                                                                     |
	// | Cyprus               | `eu_vat`     | European VAT number                                                                                     |
	// | Czech Republic       | `eu_vat`     | European VAT number                                                                                     |
	// | Denmark              | `eu_vat`     | European VAT number                                                                                     |
	// | Egypt                | `eg_tin`     | Egyptian Tax Identification Number                                                                      |
	// | Estonia              | `eu_vat`     | European VAT number                                                                                     |
	// | EU                   | `eu_oss_vat` | European One Stop Shop VAT number for non-Union scheme                                                  |
	// | Finland              | `eu_vat`     | European VAT number                                                                                     |
	// | France               | `eu_vat`     | European VAT number                                                                                     |
	// | Georgia              | `ge_vat`     | Georgian VAT                                                                                            |
	// | Germany              | `eu_vat`     | European VAT number                                                                                     |
	// | Greece               | `eu_vat`     | European VAT number                                                                                     |
	// | Hong Kong            | `hk_br`      | Hong Kong BR number                                                                                     |
	// | Hungary              | `eu_vat`     | European VAT number                                                                                     |
	// | Hungary              | `hu_tin`     | Hungary tax number (adószám)                                                                            |
	// | Iceland              | `is_vat`     | Icelandic VAT                                                                                           |
	// | India                | `in_gst`     | Indian GST number                                                                                       |
	// | Indonesia            | `id_npwp`    | Indonesian NPWP number                                                                                  |
	// | Ireland              | `eu_vat`     | European VAT number                                                                                     |
	// | Israel               | `il_vat`     | Israel VAT                                                                                              |
	// | Italy                | `eu_vat`     | European VAT number                                                                                     |
	// | Japan                | `jp_cn`      | Japanese Corporate Number (_Hōjin Bangō_)                                                               |
	// | Japan                | `jp_rn`      | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
	// | Japan                | `jp_trn`     | Japanese Tax Registration Number (_Tōroku Bangō_)                                                       |
	// | Kenya                | `ke_pin`     | Kenya Revenue Authority Personal Identification Number                                                  |
	// | Latvia               | `eu_vat`     | European VAT number                                                                                     |
	// | Liechtenstein        | `li_uid`     | Liechtensteinian UID number                                                                             |
	// | Lithuania            | `eu_vat`     | European VAT number                                                                                     |
	// | Luxembourg           | `eu_vat`     | European VAT number                                                                                     |
	// | Malaysia             | `my_frp`     | Malaysian FRP number                                                                                    |
	// | Malaysia             | `my_itn`     | Malaysian ITN                                                                                           |
	// | Malaysia             | `my_sst`     | Malaysian SST number                                                                                    |
	// | Malta                | `eu_vat `    | European VAT number                                                                                     |
	// | Mexico               | `mx_rfc`     | Mexican RFC number                                                                                      |
	// | Netherlands          | `eu_vat`     | European VAT number                                                                                     |
	// | New Zealand          | `nz_gst`     | New Zealand GST number                                                                                  |
	// | Norway               | `no_vat`     | Norwegian VAT number                                                                                    |
	// | Philippines          | `ph_tin `    | Philippines Tax Identification Number                                                                   |
	// | Poland               | `eu_vat`     | European VAT number                                                                                     |
	// | Portugal             | `eu_vat`     | European VAT number                                                                                     |
	// | Romania              | `eu_vat`     | European VAT number                                                                                     |
	// | Russia               | `ru_inn`     | Russian INN                                                                                             |
	// | Russia               | `ru_kpp`     | Russian KPP                                                                                             |
	// | Saudi Arabia         | `sg_gst`     | Singaporean GST                                                                                         |
	// | Singapore            | `sg_uen`     | Singaporean UEN                                                                                         |
	// | Slovakia             | `eu_vat`     | European VAT number                                                                                     |
	// | Slovenia             | `eu_vat`     | European VAT number                                                                                     |
	// | Slovenia             | `si_tin`     | Slovenia tax number (davčna številka)                                                                   |
	// | South Africa         | `za_vat`     | South African VAT number                                                                                |
	// | South Korea          | `kr_brn`     | Korean BRN                                                                                              |
	// | Spain                | `es_cif`     | Spanish NIF number (previously Spanish CIF number)                                                      |
	// | Spain                | `eu_vat`     | European VAT number                                                                                     |
	// | Sweden               | `eu_vat`     | European VAT number                                                                                     |
	// | Switzerland          | `ch_vat`     | Switzerland VAT number                                                                                  |
	// | Taiwan               | `tw_vat`     | Taiwanese VAT                                                                                           |
	// | Thailand             | `th_vat`     | Thai VAT                                                                                                |
	// | Turkey               | `tr_tin`     | Turkish Tax Identification Number                                                                       |
	// | Ukraine              | `ua_vat`     | Ukrainian VAT                                                                                           |
	// | United Arab Emirates | `ae_trn`     | United Arab Emirates TRN                                                                                |
	// | United Kingdom       | `eu_vat`     | Northern Ireland VAT number                                                                             |
	// | United Kingdom       | `gb_vat`     | United Kingdom VAT number                                                                               |
	// | United States        | `us_ein`     | United States EIN                                                                                       |
	TaxID CustomerTaxID `json:"tax_id,required,nullable"`
	// A timezone identifier from the IANA timezone database, such as
	// "America/Los_Angeles". This "defaults to your account's timezone if not set.
	// This cannot be changed after customer creation.
	Timezone                    string                              `json:"timezone,required"`
	AccountingSyncConfiguration CustomerAccountingSyncConfiguration `json:"accounting_sync_configuration,nullable"`
	ReportingConfiguration      CustomerReportingConfiguration      `json:"reporting_configuration,nullable"`
	JSON                        customerJSON                        `json:"-"`
}

A customer is a buyer of your products, and the other party to the billing relationship.

In Orb, customers are assigned system generated identifiers automatically, but it's often desirable to have these match existing identifiers in your system. To avoid having to denormalize Orb ID information, you can pass in an `external_customer_id` with your own identifier. See [Customer ID Aliases](../guides/events-and-metrics/customer-aliases) for further information about how these aliases work in Orb.

In addition to having an identifier in your system, a customer may exist in a payment provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum field to express this mapping.

A customer also has a timezone (from the standard [IANA timezone database](https://www.iana.org/time-zones)), which defaults to your account's timezone. See [Timezone localization](../guides/product-catalog/timezones.md) for information on what this timezone parameter influences within Orb.

func (*Customer) UnmarshalJSON

func (r *Customer) UnmarshalJSON(data []byte) (err error)

type CustomerAccountingSyncConfiguration

type CustomerAccountingSyncConfiguration struct {
	AccountingProviders []CustomerAccountingSyncConfigurationAccountingProvider `json:"accounting_providers,required"`
	Excluded            bool                                                    `json:"excluded,required"`
	JSON                customerAccountingSyncConfigurationJSON                 `json:"-"`
}

func (*CustomerAccountingSyncConfiguration) UnmarshalJSON

func (r *CustomerAccountingSyncConfiguration) UnmarshalJSON(data []byte) (err error)

type CustomerAccountingSyncConfigurationAccountingProvider

type CustomerAccountingSyncConfigurationAccountingProvider struct {
	ExternalProviderID string                                                             `json:"external_provider_id,required,nullable"`
	ProviderType       CustomerAccountingSyncConfigurationAccountingProvidersProviderType `json:"provider_type,required"`
	JSON               customerAccountingSyncConfigurationAccountingProviderJSON          `json:"-"`
}

func (*CustomerAccountingSyncConfigurationAccountingProvider) UnmarshalJSON

func (r *CustomerAccountingSyncConfigurationAccountingProvider) UnmarshalJSON(data []byte) (err error)

type CustomerAccountingSyncConfigurationAccountingProvidersProviderType

type CustomerAccountingSyncConfigurationAccountingProvidersProviderType string
const (
	CustomerAccountingSyncConfigurationAccountingProvidersProviderTypeQuickbooks CustomerAccountingSyncConfigurationAccountingProvidersProviderType = "quickbooks"
	CustomerAccountingSyncConfigurationAccountingProvidersProviderTypeNetsuite   CustomerAccountingSyncConfigurationAccountingProvidersProviderType = "netsuite"
)

func (CustomerAccountingSyncConfigurationAccountingProvidersProviderType) IsKnown added in v0.24.0

type CustomerBalanceTransactionListParams

type CustomerBalanceTransactionListParams struct {
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor param.Field[string] `query:"cursor"`
	// The number of items to fetch. Defaults to 20.
	Limit            param.Field[int64]     `query:"limit"`
	OperationTimeGt  param.Field[time.Time] `query:"operation_time[gt]" format:"date-time"`
	OperationTimeGte param.Field[time.Time] `query:"operation_time[gte]" format:"date-time"`
	OperationTimeLt  param.Field[time.Time] `query:"operation_time[lt]" format:"date-time"`
	OperationTimeLte param.Field[time.Time] `query:"operation_time[lte]" format:"date-time"`
}

func (CustomerBalanceTransactionListParams) URLQuery

URLQuery serializes CustomerBalanceTransactionListParams's query parameters as `url.Values`.

type CustomerBalanceTransactionListResponse

type CustomerBalanceTransactionListResponse struct {
	// A unique id for this transaction.
	ID     string                                       `json:"id,required"`
	Action CustomerBalanceTransactionListResponseAction `json:"action,required"`
	// The value of the amount changed in the transaction.
	Amount string `json:"amount,required"`
	// The creation time of this transaction.
	CreatedAt  time.Time                                        `json:"created_at,required" format:"date-time"`
	CreditNote CustomerBalanceTransactionListResponseCreditNote `json:"credit_note,required,nullable"`
	// An optional description provided for manual customer balance adjustments.
	Description string `json:"description,required,nullable"`
	// The new value of the customer's balance prior to the transaction, in the
	// customer's currency.
	EndingBalance string                                        `json:"ending_balance,required"`
	Invoice       CustomerBalanceTransactionListResponseInvoice `json:"invoice,required,nullable"`
	// The original value of the customer's balance prior to the transaction, in the
	// customer's currency.
	StartingBalance string                                     `json:"starting_balance,required"`
	Type            CustomerBalanceTransactionListResponseType `json:"type,required"`
	JSON            customerBalanceTransactionListResponseJSON `json:"-"`
}

func (*CustomerBalanceTransactionListResponse) UnmarshalJSON

func (r *CustomerBalanceTransactionListResponse) UnmarshalJSON(data []byte) (err error)

type CustomerBalanceTransactionListResponseAction

type CustomerBalanceTransactionListResponseAction string
const (
	CustomerBalanceTransactionListResponseActionAppliedToInvoice     CustomerBalanceTransactionListResponseAction = "applied_to_invoice"
	CustomerBalanceTransactionListResponseActionManualAdjustment     CustomerBalanceTransactionListResponseAction = "manual_adjustment"
	CustomerBalanceTransactionListResponseActionProratedRefund       CustomerBalanceTransactionListResponseAction = "prorated_refund"
	CustomerBalanceTransactionListResponseActionRevertProratedRefund CustomerBalanceTransactionListResponseAction = "revert_prorated_refund"
	CustomerBalanceTransactionListResponseActionReturnFromVoiding    CustomerBalanceTransactionListResponseAction = "return_from_voiding"
	CustomerBalanceTransactionListResponseActionCreditNoteApplied    CustomerBalanceTransactionListResponseAction = "credit_note_applied"
	CustomerBalanceTransactionListResponseActionCreditNoteVoided     CustomerBalanceTransactionListResponseAction = "credit_note_voided"
	CustomerBalanceTransactionListResponseActionOverpaymentRefund    CustomerBalanceTransactionListResponseAction = "overpayment_refund"
)

func (CustomerBalanceTransactionListResponseAction) IsKnown added in v0.24.0

type CustomerBalanceTransactionListResponseCreditNote

type CustomerBalanceTransactionListResponseCreditNote struct {
	// The id of the Credit note
	ID   string                                               `json:"id,required"`
	JSON customerBalanceTransactionListResponseCreditNoteJSON `json:"-"`
}

func (*CustomerBalanceTransactionListResponseCreditNote) UnmarshalJSON

func (r *CustomerBalanceTransactionListResponseCreditNote) UnmarshalJSON(data []byte) (err error)

type CustomerBalanceTransactionListResponseInvoice

type CustomerBalanceTransactionListResponseInvoice struct {
	// The Invoice id
	ID   string                                            `json:"id,required"`
	JSON customerBalanceTransactionListResponseInvoiceJSON `json:"-"`
}

func (*CustomerBalanceTransactionListResponseInvoice) UnmarshalJSON

func (r *CustomerBalanceTransactionListResponseInvoice) UnmarshalJSON(data []byte) (err error)

type CustomerBalanceTransactionListResponseType

type CustomerBalanceTransactionListResponseType string
const (
	CustomerBalanceTransactionListResponseTypeIncrement CustomerBalanceTransactionListResponseType = "increment"
	CustomerBalanceTransactionListResponseTypeDecrement CustomerBalanceTransactionListResponseType = "decrement"
)

func (CustomerBalanceTransactionListResponseType) IsKnown added in v0.24.0

type CustomerBalanceTransactionNewParams

type CustomerBalanceTransactionNewParams struct {
	Amount param.Field[string]                                  `json:"amount,required"`
	Type   param.Field[CustomerBalanceTransactionNewParamsType] `json:"type,required"`
	// An optional description that can be specified around this entry.
	Description param.Field[string] `json:"description"`
}

func (CustomerBalanceTransactionNewParams) MarshalJSON

func (r CustomerBalanceTransactionNewParams) MarshalJSON() (data []byte, err error)

type CustomerBalanceTransactionNewParamsType

type CustomerBalanceTransactionNewParamsType string
const (
	CustomerBalanceTransactionNewParamsTypeIncrement CustomerBalanceTransactionNewParamsType = "increment"
	CustomerBalanceTransactionNewParamsTypeDecrement CustomerBalanceTransactionNewParamsType = "decrement"
)

func (CustomerBalanceTransactionNewParamsType) IsKnown added in v0.24.0

type CustomerBalanceTransactionNewResponse

type CustomerBalanceTransactionNewResponse struct {
	// A unique id for this transaction.
	ID     string                                      `json:"id,required"`
	Action CustomerBalanceTransactionNewResponseAction `json:"action,required"`
	// The value of the amount changed in the transaction.
	Amount string `json:"amount,required"`
	// The creation time of this transaction.
	CreatedAt  time.Time                                       `json:"created_at,required" format:"date-time"`
	CreditNote CustomerBalanceTransactionNewResponseCreditNote `json:"credit_note,required,nullable"`
	// An optional description provided for manual customer balance adjustments.
	Description string `json:"description,required,nullable"`
	// The new value of the customer's balance prior to the transaction, in the
	// customer's currency.
	EndingBalance string                                       `json:"ending_balance,required"`
	Invoice       CustomerBalanceTransactionNewResponseInvoice `json:"invoice,required,nullable"`
	// The original value of the customer's balance prior to the transaction, in the
	// customer's currency.
	StartingBalance string                                    `json:"starting_balance,required"`
	Type            CustomerBalanceTransactionNewResponseType `json:"type,required"`
	JSON            customerBalanceTransactionNewResponseJSON `json:"-"`
}

func (*CustomerBalanceTransactionNewResponse) UnmarshalJSON

func (r *CustomerBalanceTransactionNewResponse) UnmarshalJSON(data []byte) (err error)

type CustomerBalanceTransactionNewResponseAction

type CustomerBalanceTransactionNewResponseAction string
const (
	CustomerBalanceTransactionNewResponseActionAppliedToInvoice     CustomerBalanceTransactionNewResponseAction = "applied_to_invoice"
	CustomerBalanceTransactionNewResponseActionManualAdjustment     CustomerBalanceTransactionNewResponseAction = "manual_adjustment"
	CustomerBalanceTransactionNewResponseActionProratedRefund       CustomerBalanceTransactionNewResponseAction = "prorated_refund"
	CustomerBalanceTransactionNewResponseActionRevertProratedRefund CustomerBalanceTransactionNewResponseAction = "revert_prorated_refund"
	CustomerBalanceTransactionNewResponseActionReturnFromVoiding    CustomerBalanceTransactionNewResponseAction = "return_from_voiding"
	CustomerBalanceTransactionNewResponseActionCreditNoteApplied    CustomerBalanceTransactionNewResponseAction = "credit_note_applied"
	CustomerBalanceTransactionNewResponseActionCreditNoteVoided     CustomerBalanceTransactionNewResponseAction = "credit_note_voided"
	CustomerBalanceTransactionNewResponseActionOverpaymentRefund    CustomerBalanceTransactionNewResponseAction = "overpayment_refund"
)

func (CustomerBalanceTransactionNewResponseAction) IsKnown added in v0.24.0

type CustomerBalanceTransactionNewResponseCreditNote

type CustomerBalanceTransactionNewResponseCreditNote struct {
	// The id of the Credit note
	ID   string                                              `json:"id,required"`
	JSON customerBalanceTransactionNewResponseCreditNoteJSON `json:"-"`
}

func (*CustomerBalanceTransactionNewResponseCreditNote) UnmarshalJSON

func (r *CustomerBalanceTransactionNewResponseCreditNote) UnmarshalJSON(data []byte) (err error)

type CustomerBalanceTransactionNewResponseInvoice

type CustomerBalanceTransactionNewResponseInvoice struct {
	// The Invoice id
	ID   string                                           `json:"id,required"`
	JSON customerBalanceTransactionNewResponseInvoiceJSON `json:"-"`
}

func (*CustomerBalanceTransactionNewResponseInvoice) UnmarshalJSON

func (r *CustomerBalanceTransactionNewResponseInvoice) UnmarshalJSON(data []byte) (err error)

type CustomerBalanceTransactionNewResponseType

type CustomerBalanceTransactionNewResponseType string
const (
	CustomerBalanceTransactionNewResponseTypeIncrement CustomerBalanceTransactionNewResponseType = "increment"
	CustomerBalanceTransactionNewResponseTypeDecrement CustomerBalanceTransactionNewResponseType = "decrement"
)

func (CustomerBalanceTransactionNewResponseType) IsKnown added in v0.24.0

type CustomerBalanceTransactionService

type CustomerBalanceTransactionService struct {
	Options []option.RequestOption
}

CustomerBalanceTransactionService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCustomerBalanceTransactionService method instead.

func NewCustomerBalanceTransactionService

func NewCustomerBalanceTransactionService(opts ...option.RequestOption) (r *CustomerBalanceTransactionService)

NewCustomerBalanceTransactionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CustomerBalanceTransactionService) List

## The customer balance

The customer balance is an amount in the customer's currency, which Orb automatically applies to subsequent invoices. This balance can be adjusted manually via Orb's webapp on the customer details page. You can use this balance to provide a fixed mid-period credit to the customer. Commonly, this is done due to system downtime/SLA violation, or an adhoc adjustment discussed with the customer.

If the balance is a positive value at the time of invoicing, it represents that the customer has credit that should be used to offset the amount due on the next issued invoice. In this case, Orb will automatically reduce the next invoice by the balance amount, and roll over any remaining balance if the invoice is fully discounted.

If the balance is a negative value at the time of invoicing, Orb will increase the invoice's amount due with a positive adjustment, and reset the balance to 0.

This endpoint retrieves all customer balance transactions in reverse chronological order for a single customer, providing a complete audit trail of all adjustments and invoice applications.

## Eligibility

The customer balance can only be applied to invoices or adjusted manually if invoices are not synced to a separate invoicing provider. If a payment gateway such as Stripe is used, the balance will be applied to the invoice before forwarding payment to the gateway.

func (*CustomerBalanceTransactionService) ListAutoPaging

## The customer balance

The customer balance is an amount in the customer's currency, which Orb automatically applies to subsequent invoices. This balance can be adjusted manually via Orb's webapp on the customer details page. You can use this balance to provide a fixed mid-period credit to the customer. Commonly, this is done due to system downtime/SLA violation, or an adhoc adjustment discussed with the customer.

If the balance is a positive value at the time of invoicing, it represents that the customer has credit that should be used to offset the amount due on the next issued invoice. In this case, Orb will automatically reduce the next invoice by the balance amount, and roll over any remaining balance if the invoice is fully discounted.

If the balance is a negative value at the time of invoicing, Orb will increase the invoice's amount due with a positive adjustment, and reset the balance to 0.

This endpoint retrieves all customer balance transactions in reverse chronological order for a single customer, providing a complete audit trail of all adjustments and invoice applications.

## Eligibility

The customer balance can only be applied to invoices or adjusted manually if invoices are not synced to a separate invoicing provider. If a payment gateway such as Stripe is used, the balance will be applied to the invoice before forwarding payment to the gateway.

func (*CustomerBalanceTransactionService) New

Creates an immutable balance transaction that updates the customer's balance and returns back the newly created transaction.

type CustomerBillingAddress

type CustomerBillingAddress struct {
	City       string                     `json:"city,required,nullable"`
	Country    string                     `json:"country,required,nullable"`
	Line1      string                     `json:"line1,required,nullable"`
	Line2      string                     `json:"line2,required,nullable"`
	PostalCode string                     `json:"postal_code,required,nullable"`
	State      string                     `json:"state,required,nullable"`
	JSON       customerBillingAddressJSON `json:"-"`
}

func (*CustomerBillingAddress) UnmarshalJSON

func (r *CustomerBillingAddress) UnmarshalJSON(data []byte) (err error)

type CustomerCostListByExternalIDParams

type CustomerCostListByExternalIDParams struct {
	// Costs returned are exclusive of `timeframe_end`.
	TimeframeEnd param.Field[time.Time] `query:"timeframe_end" format:"date-time"`
	// Costs returned are inclusive of `timeframe_start`.
	TimeframeStart param.Field[time.Time] `query:"timeframe_start" format:"date-time"`
	// Controls whether Orb returns cumulative costs since the start of the billing
	// period, or incremental day-by-day costs. If your customer has minimums or
	// discounts, it's strongly recommended that you use the default cumulative
	// behavior.
	ViewMode param.Field[CustomerCostListByExternalIDParamsViewMode] `query:"view_mode"`
}

func (CustomerCostListByExternalIDParams) URLQuery

URLQuery serializes CustomerCostListByExternalIDParams's query parameters as `url.Values`.

type CustomerCostListByExternalIDParamsViewMode

type CustomerCostListByExternalIDParamsViewMode string

Controls whether Orb returns cumulative costs since the start of the billing period, or incremental day-by-day costs. If your customer has minimums or discounts, it's strongly recommended that you use the default cumulative behavior.

const (
	CustomerCostListByExternalIDParamsViewModePeriodic   CustomerCostListByExternalIDParamsViewMode = "periodic"
	CustomerCostListByExternalIDParamsViewModeCumulative CustomerCostListByExternalIDParamsViewMode = "cumulative"
)

func (CustomerCostListByExternalIDParamsViewMode) IsKnown added in v0.24.0

type CustomerCostListByExternalIDResponse

type CustomerCostListByExternalIDResponse struct {
	Data []CustomerCostListByExternalIDResponseData `json:"data,required"`
	JSON customerCostListByExternalIDResponseJSON   `json:"-"`
}

func (*CustomerCostListByExternalIDResponse) UnmarshalJSON

func (r *CustomerCostListByExternalIDResponse) UnmarshalJSON(data []byte) (err error)

type CustomerCostListByExternalIDResponseData

type CustomerCostListByExternalIDResponseData struct {
	PerPriceCosts []CustomerCostListByExternalIDResponseDataPerPriceCost `json:"per_price_costs,required"`
	// Total costs for the timeframe, excluding any minimums and discounts.
	Subtotal       string    `json:"subtotal,required"`
	TimeframeEnd   time.Time `json:"timeframe_end,required" format:"date-time"`
	TimeframeStart time.Time `json:"timeframe_start,required" format:"date-time"`
	// Total costs for the timeframe, including any minimums and discounts.
	Total string                                       `json:"total,required"`
	JSON  customerCostListByExternalIDResponseDataJSON `json:"-"`
}

func (*CustomerCostListByExternalIDResponseData) UnmarshalJSON

func (r *CustomerCostListByExternalIDResponseData) UnmarshalJSON(data []byte) (err error)

type CustomerCostListByExternalIDResponseDataPerPriceCost

type CustomerCostListByExternalIDResponseDataPerPriceCost struct {
	// The Price resource represents a price that can be billed on a subscription,
	// resulting in a charge on an invoice in the form of an invoice line item. Prices
	// take a quantity and determine an amount to bill.
	//
	// Orb supports a few different pricing models out of the box. Each of these models
	// is serialized differently in a given Price object. The model_type field
	// determines the key for the configuration object that is present.
	//
	// ## Unit pricing
	//
	// With unit pricing, each unit costs a fixed amount.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "unit",
	//	    "unit_config": {
	//	        "unit_amount": "0.50"
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Tiered pricing
	//
	// In tiered pricing, the cost of a given unit depends on the tier range that it
	// falls into, where each tier range is defined by an upper and lower bound. For
	// example, the first ten units may cost $0.50 each and all units thereafter may
	// cost $0.10 each.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "tiered",
	//	    "tiered_config": {
	//	        "tiers": [
	//	            {
	//	                "first_unit": 1,
	//	                "last_unit": 10,
	//	                "unit_amount": "0.50"
	//	            },
	//	            {
	//	                "first_unit": 11,
	//	                "last_unit": null,
	//	                "unit_amount": "0.10"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//
	// “`
	//
	// ## Bulk pricing
	//
	// Bulk pricing applies when the number of units determine the cost of all units.
	// For example, if you've bought less than 10 units, they may each be $0.50 for a
	// total of $5.00. Once you've bought more than 10 units, all units may now be
	// priced at $0.40 (i.e. 101 units total would be $40.40).
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "bulk",
	//	    "bulk_config": {
	//	        "tiers": [
	//	            {
	//	                "maximum_units": 10,
	//	                "unit_amount": "0.50"
	//	            },
	//	            {
	//	                "maximum_units": 1000,
	//	                "unit_amount": "0.40"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Package pricing
	//
	// Package pricing defines the size or granularity of a unit for billing purposes.
	// For example, if the package size is set to 5, then 4 units will be billed as 5
	// and 6 units will be billed at 10.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "package",
	//	    "package_config": {
	//	        "package_amount": "0.80",
	//	        "package_size": 10
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## BPS pricing
	//
	// BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
	// percent (the number of basis points to charge), as well as a cap per event to
	// assess. For example, this would allow you to assess a fee of 0.25% on every
	// payment you process, with a maximum charge of $25 per payment.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "bps",
	//	    "bps_config": {
	//	       "bps": 125,
	//	       "per_unit_maximum": "11.00"
	//	    }
	//	    ...
	//	 }
	//
	// “`
	//
	// ## Bulk BPS pricing
	//
	// Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
	// total quantity across all events. Similar to bulk pricing, the BPS parameters of
	// a given event depends on the tier range that the billing period falls into. Each
	// tier range is defined by an upper bound. For example, after $1.5M of payment
	// volume is reached, each individual payment may have a lower cap or a smaller
	// take-rate.
	//
	// “`json
	//
	//	    ...
	//	    "model_type": "bulk_bps",
	//	    "bulk_bps_config": {
	//	        "tiers": [
	//	           {
	//	                "maximum_amount": "1000000.00",
	//	                "bps": 125,
	//	                "per_unit_maximum": "19.00"
	//	           },
	//	          {
	//	                "maximum_amount": null,
	//	                "bps": 115,
	//	                "per_unit_maximum": "4.00"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Tiered BPS pricing
	//
	// Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
	// event's applicable parameter is a function of its marginal addition to the
	// period total. Similar to tiered pricing, the BPS parameters of a given event
	// depends on the tier range that it falls into, where each tier range is defined
	// by an upper and lower bound. For example, the first few payments may have a 0.8
	// BPS take-rate and all payments after a specific volume may incur a take-rate of
	// 0.5 BPS each.
	//
	// “`json
	//
	//	    ...
	//	    "model_type": "tiered_bps",
	//	    "tiered_bps_config": {
	//	        "tiers": [
	//	           {
	//	                "minimum_amount": "0",
	//	                "maximum_amount": "1000000.00",
	//	                "bps": 125,
	//	                "per_unit_maximum": "19.00"
	//	           },
	//	          {
	//	                "minimum_amount": "1000000.00",
	//	                "maximum_amount": null,
	//	                "bps": 115,
	//	                "per_unit_maximum": "4.00"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Matrix pricing
	//
	// Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
	// `dimensions` defines the two event property values evaluated in this pricing
	// model. In a one-dimensional matrix, the second value is `null`. Every
	// configuration has a list of `matrix_values` which give the unit prices for
	// specified property values. In a one-dimensional matrix, the matrix values will
	// have `dimension_values` where the second value of the pair is null. If an event
	// does not match any of the dimension values in the matrix, it will resort to the
	// `default_unit_amount`.
	//
	// “`json
	//
	//	{
	//	    "model_type": "matrix"
	//	    "matrix_config": {
	//	        "default_unit_amount": "3.00",
	//	        "dimensions": [
	//	            "cluster_name",
	//	            "region"
	//	        ],
	//	        "matrix_values": [
	//	            {
	//	                "dimension_values": [
	//	                    "alpha",
	//	                    "west"
	//	                ],
	//	                "unit_amount": "2.00"
	//	            },
	//	            ...
	//	        ]
	//	    }
	//	}
	//
	// “`
	//
	// ## Fixed fees
	//
	// Fixed fees are prices that are applied independent of usage quantities, and
	// follow unit pricing. They also have an additional parameter
	// `fixed_price_quantity`. If the Price represents a fixed cost, this represents
	// the quantity of units applied.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "id": "price_id",
	//	    "model_type": "unit",
	//	    "unit_config": {
	//	       "unit_amount": "2.00"
	//	    },
	//	    "fixed_price_quantity": 3.0
	//	    ...
	//	}
	//
	// “`
	Price Price `json:"price,required"`
	// Price's contributions for the timeframe, excluding any minimums and discounts.
	Subtotal string `json:"subtotal,required"`
	// Price's contributions for the timeframe, including minimums and discounts.
	Total string `json:"total,required"`
	// The price's quantity for the timeframe
	Quantity float64                                                  `json:"quantity,nullable"`
	JSON     customerCostListByExternalIDResponseDataPerPriceCostJSON `json:"-"`
}

func (*CustomerCostListByExternalIDResponseDataPerPriceCost) UnmarshalJSON

func (r *CustomerCostListByExternalIDResponseDataPerPriceCost) UnmarshalJSON(data []byte) (err error)

type CustomerCostListParams

type CustomerCostListParams struct {
	// Costs returned are exclusive of `timeframe_end`.
	TimeframeEnd param.Field[time.Time] `query:"timeframe_end" format:"date-time"`
	// Costs returned are inclusive of `timeframe_start`.
	TimeframeStart param.Field[time.Time] `query:"timeframe_start" format:"date-time"`
	// Controls whether Orb returns cumulative costs since the start of the billing
	// period, or incremental day-by-day costs. If your customer has minimums or
	// discounts, it's strongly recommended that you use the default cumulative
	// behavior.
	ViewMode param.Field[CustomerCostListParamsViewMode] `query:"view_mode"`
}

func (CustomerCostListParams) URLQuery

func (r CustomerCostListParams) URLQuery() (v url.Values)

URLQuery serializes CustomerCostListParams's query parameters as `url.Values`.

type CustomerCostListParamsViewMode

type CustomerCostListParamsViewMode string

Controls whether Orb returns cumulative costs since the start of the billing period, or incremental day-by-day costs. If your customer has minimums or discounts, it's strongly recommended that you use the default cumulative behavior.

const (
	CustomerCostListParamsViewModePeriodic   CustomerCostListParamsViewMode = "periodic"
	CustomerCostListParamsViewModeCumulative CustomerCostListParamsViewMode = "cumulative"
)

func (CustomerCostListParamsViewMode) IsKnown added in v0.24.0

type CustomerCostListResponse

type CustomerCostListResponse struct {
	Data []CustomerCostListResponseData `json:"data,required"`
	JSON customerCostListResponseJSON   `json:"-"`
}

func (*CustomerCostListResponse) UnmarshalJSON

func (r *CustomerCostListResponse) UnmarshalJSON(data []byte) (err error)

type CustomerCostListResponseData

type CustomerCostListResponseData struct {
	PerPriceCosts []CustomerCostListResponseDataPerPriceCost `json:"per_price_costs,required"`
	// Total costs for the timeframe, excluding any minimums and discounts.
	Subtotal       string    `json:"subtotal,required"`
	TimeframeEnd   time.Time `json:"timeframe_end,required" format:"date-time"`
	TimeframeStart time.Time `json:"timeframe_start,required" format:"date-time"`
	// Total costs for the timeframe, including any minimums and discounts.
	Total string                           `json:"total,required"`
	JSON  customerCostListResponseDataJSON `json:"-"`
}

func (*CustomerCostListResponseData) UnmarshalJSON

func (r *CustomerCostListResponseData) UnmarshalJSON(data []byte) (err error)

type CustomerCostListResponseDataPerPriceCost

type CustomerCostListResponseDataPerPriceCost struct {
	// The Price resource represents a price that can be billed on a subscription,
	// resulting in a charge on an invoice in the form of an invoice line item. Prices
	// take a quantity and determine an amount to bill.
	//
	// Orb supports a few different pricing models out of the box. Each of these models
	// is serialized differently in a given Price object. The model_type field
	// determines the key for the configuration object that is present.
	//
	// ## Unit pricing
	//
	// With unit pricing, each unit costs a fixed amount.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "unit",
	//	    "unit_config": {
	//	        "unit_amount": "0.50"
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Tiered pricing
	//
	// In tiered pricing, the cost of a given unit depends on the tier range that it
	// falls into, where each tier range is defined by an upper and lower bound. For
	// example, the first ten units may cost $0.50 each and all units thereafter may
	// cost $0.10 each.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "tiered",
	//	    "tiered_config": {
	//	        "tiers": [
	//	            {
	//	                "first_unit": 1,
	//	                "last_unit": 10,
	//	                "unit_amount": "0.50"
	//	            },
	//	            {
	//	                "first_unit": 11,
	//	                "last_unit": null,
	//	                "unit_amount": "0.10"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//
	// “`
	//
	// ## Bulk pricing
	//
	// Bulk pricing applies when the number of units determine the cost of all units.
	// For example, if you've bought less than 10 units, they may each be $0.50 for a
	// total of $5.00. Once you've bought more than 10 units, all units may now be
	// priced at $0.40 (i.e. 101 units total would be $40.40).
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "bulk",
	//	    "bulk_config": {
	//	        "tiers": [
	//	            {
	//	                "maximum_units": 10,
	//	                "unit_amount": "0.50"
	//	            },
	//	            {
	//	                "maximum_units": 1000,
	//	                "unit_amount": "0.40"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Package pricing
	//
	// Package pricing defines the size or granularity of a unit for billing purposes.
	// For example, if the package size is set to 5, then 4 units will be billed as 5
	// and 6 units will be billed at 10.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "package",
	//	    "package_config": {
	//	        "package_amount": "0.80",
	//	        "package_size": 10
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## BPS pricing
	//
	// BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
	// percent (the number of basis points to charge), as well as a cap per event to
	// assess. For example, this would allow you to assess a fee of 0.25% on every
	// payment you process, with a maximum charge of $25 per payment.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "bps",
	//	    "bps_config": {
	//	       "bps": 125,
	//	       "per_unit_maximum": "11.00"
	//	    }
	//	    ...
	//	 }
	//
	// “`
	//
	// ## Bulk BPS pricing
	//
	// Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
	// total quantity across all events. Similar to bulk pricing, the BPS parameters of
	// a given event depends on the tier range that the billing period falls into. Each
	// tier range is defined by an upper bound. For example, after $1.5M of payment
	// volume is reached, each individual payment may have a lower cap or a smaller
	// take-rate.
	//
	// “`json
	//
	//	    ...
	//	    "model_type": "bulk_bps",
	//	    "bulk_bps_config": {
	//	        "tiers": [
	//	           {
	//	                "maximum_amount": "1000000.00",
	//	                "bps": 125,
	//	                "per_unit_maximum": "19.00"
	//	           },
	//	          {
	//	                "maximum_amount": null,
	//	                "bps": 115,
	//	                "per_unit_maximum": "4.00"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Tiered BPS pricing
	//
	// Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
	// event's applicable parameter is a function of its marginal addition to the
	// period total. Similar to tiered pricing, the BPS parameters of a given event
	// depends on the tier range that it falls into, where each tier range is defined
	// by an upper and lower bound. For example, the first few payments may have a 0.8
	// BPS take-rate and all payments after a specific volume may incur a take-rate of
	// 0.5 BPS each.
	//
	// “`json
	//
	//	    ...
	//	    "model_type": "tiered_bps",
	//	    "tiered_bps_config": {
	//	        "tiers": [
	//	           {
	//	                "minimum_amount": "0",
	//	                "maximum_amount": "1000000.00",
	//	                "bps": 125,
	//	                "per_unit_maximum": "19.00"
	//	           },
	//	          {
	//	                "minimum_amount": "1000000.00",
	//	                "maximum_amount": null,
	//	                "bps": 115,
	//	                "per_unit_maximum": "4.00"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Matrix pricing
	//
	// Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
	// `dimensions` defines the two event property values evaluated in this pricing
	// model. In a one-dimensional matrix, the second value is `null`. Every
	// configuration has a list of `matrix_values` which give the unit prices for
	// specified property values. In a one-dimensional matrix, the matrix values will
	// have `dimension_values` where the second value of the pair is null. If an event
	// does not match any of the dimension values in the matrix, it will resort to the
	// `default_unit_amount`.
	//
	// “`json
	//
	//	{
	//	    "model_type": "matrix"
	//	    "matrix_config": {
	//	        "default_unit_amount": "3.00",
	//	        "dimensions": [
	//	            "cluster_name",
	//	            "region"
	//	        ],
	//	        "matrix_values": [
	//	            {
	//	                "dimension_values": [
	//	                    "alpha",
	//	                    "west"
	//	                ],
	//	                "unit_amount": "2.00"
	//	            },
	//	            ...
	//	        ]
	//	    }
	//	}
	//
	// “`
	//
	// ## Fixed fees
	//
	// Fixed fees are prices that are applied independent of usage quantities, and
	// follow unit pricing. They also have an additional parameter
	// `fixed_price_quantity`. If the Price represents a fixed cost, this represents
	// the quantity of units applied.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "id": "price_id",
	//	    "model_type": "unit",
	//	    "unit_config": {
	//	       "unit_amount": "2.00"
	//	    },
	//	    "fixed_price_quantity": 3.0
	//	    ...
	//	}
	//
	// “`
	Price Price `json:"price,required"`
	// Price's contributions for the timeframe, excluding any minimums and discounts.
	Subtotal string `json:"subtotal,required"`
	// Price's contributions for the timeframe, including minimums and discounts.
	Total string `json:"total,required"`
	// The price's quantity for the timeframe
	Quantity float64                                      `json:"quantity,nullable"`
	JSON     customerCostListResponseDataPerPriceCostJSON `json:"-"`
}

func (*CustomerCostListResponseDataPerPriceCost) UnmarshalJSON

func (r *CustomerCostListResponseDataPerPriceCost) UnmarshalJSON(data []byte) (err error)

type CustomerCostService

type CustomerCostService struct {
	Options []option.RequestOption
}

CustomerCostService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCustomerCostService method instead.

func NewCustomerCostService

func NewCustomerCostService(opts ...option.RequestOption) (r *CustomerCostService)

NewCustomerCostService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CustomerCostService) List

This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by applying pricing information to the underlying usage (see the [subscription usage endpoint](fetch-subscription-usage.api.mdx) to fetch usage per metric, in usage units rather than a currency).

This endpoint can be leveraged for internal tooling and to provide a more transparent billing experience for your end users:

  1. Understand the cost breakdown per line item historically and in real-time for the current billing period.
  2. Provide customer visibility into how different services are contributing to the overall invoice with a per-day timeseries (as compared to the [upcoming invoice](fetch-upcoming-invoice) resource, which represents a snapshot for the current period).
  3. Assess how minimums and discounts affect your customers by teasing apart costs directly as a result of usage, as opposed to minimums and discounts at the plan and price level.
  4. Gain insight into key customer health metrics, such as the percent utilization of the minimum committed spend.

## Fetching subscriptions

By default, this endpoint fetches the currently active subscription for the customer, and returns cost information for the subscription's current billing period, broken down by each participating price. If there are no currently active subscriptions, this will instead default to the most recently active subscription or return an empty series if none are found. For example, if your plan charges for compute hours, job runs, and data syncs, then this endpoint would provide a daily breakdown of your customer's cost for each of those axes.

If timeframe bounds are specified, Orb fetches all subscriptions that were active in that timeframe. If two subscriptions overlap on a single day, costs from each price will be summed, and prices for both subscriptions will be included in the breakdown.

## Prepaid plans

For plans that include prices which deduct credits rather than accrue in-arrears charges in a billable currency, this endpoint will return the total deduction amount, in credits, for the specified timeframe.

## Cumulative subtotals and totals

Since the subtotal and total must factor in any billing-period level discounts and minimums, it's most meaningful to consider costs relative to the start of the subscription's billing period. As a result, by default this endpoint returns cumulative totals since the beginning of the billing period. In particular, the `timeframe_start` of a returned timeframe window is _always_ the beginning of the billing period and `timeframe_end` is incremented one day at a time to build the result.

A customer that uses a few API calls a day but has a minimum commitment might exhibit the following pattern for their subtotal and total in the first few days of the month. Here, we assume that each API call is $2.50, the customer's plan has a monthly minimum of $50 for this price, and that the subscription's billing period bounds are aligned to the first of the month:

| timeframe_start | timeframe_end | Cumulative usage | Subtotal | Total (incl. commitment) | | --------------- | ------------- | ---------------- | -------- | ------------------------ | | 2023-02-01 | 2023-02-02 | 9 | $22.50 | $50.00 | | 2023-02-01 | 2023-02-03 | 19 | $47.50 | $50.00 | | 2023-02-01 | 2023-02-04 | 20 | $50.00 | $50.00 | | 2023-02-01 | 2023-02-05 | 28 | $70.00 | $70.00 | | 2023-02-01 | 2023-02-06 | 36 | $90.00 | $90.00 |

### Periodic values

When the query parameter `view_mode=periodic` is specified, Orb will return an incremental day-by-day view of costs. In this case, there will always be a one-day difference between `timeframe_start` and `timeframe_end` for the timeframes returned. This is a transform on top of the cumulative costs, calculated by taking the difference of each timeframe with the last. Note that in the above example, the `Total` value would be 0 for the second two data points, since the minimum commitment has not yet been hit and each day is not contributing anything to the total cost.

## Timeframe bounds

If no timeframe bounds are specified, the response will default to the current billing period for the customer's subscription. For subscriptions that have ended, this will be the billing period when they were last active. If the subscription starts or ends within the timeframe, the response will only include windows where the subscription is active.

As noted above, `timeframe_start` for a given cumulative datapoint is always the beginning of the billing period, and `timeframe_end` is incremented one day at a time to construct the response. When a timeframe is passed in that is not aligned to the current subscription's billing period, the response will contain cumulative totals from multiple billing periods.

Suppose the queried customer has a subscription aligned to the 15th of every month. If this endpoint is queried with the date range `2023-06-01` - `2023-07-01`, the first data point will represent about half a billing period's worth of costs, accounting for accruals from the start of the billing period and inclusive of the first day of the timeframe (`timeframe_start = 2023-05-15 00:00:00`, `timeframe_end = 2023-06-02 00:00:00`)

| datapoint index | timeframe_start | timeframe_end | | --------------- | --------------- | ------------- | | 0 | 2023-05-15 | 2023-06-02 | | 1 | 2023-05-15 | 2023-06-03 | | 2 | ... | ... | | 3 | 2023-05-15 | 2023-06-14 | | 4 | 2023-06-15 | 2023-06-16 | | 5 | 2023-06-15 | 2023-06-17 | | 6 | ... | ... | | 7 | 2023-06-15 | 2023-07-01 |

You can see this sliced timeframe visualized [here](https://i.imgur.com/TXhYgme.png).

## Grouping by custom attributes

In order to view costs grouped by a specific _attribute_ that each event is tagged with (i.e. `cluster`), you can additionally specify a `group_by` key. The `group_by` key denotes the event property on which to group.

When returning grouped costs, a separate `price_group` object in the `per_price_costs` array is returned for each value of the `group_by` key present in your events. The `subtotal` value of the `per_price_costs` object is the sum of each `price_group`'s total.

Orb expects events will contain values in the `properties` dictionary that correspond to the `group_by` key specified. By default, Orb will return a `null` group (i.e. events that match the metric but do not have the key set). Currently, it is only possible to view costs grouped by a single attribute at a time.

### Matrix prices

When a price uses matrix pricing, it's important to view costs grouped by those matrix dimensions. Orb will return `price_groups` with the `grouping_key` and `secondary_grouping_key` based on the matrix price definition, for each `grouping_value` and `secondary_grouping_value` available.

func (*CustomerCostService) ListByExternalID

func (r *CustomerCostService) ListByExternalID(ctx context.Context, externalCustomerID string, query CustomerCostListByExternalIDParams, opts ...option.RequestOption) (res *CustomerCostListByExternalIDResponse, err error)

This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by applying pricing information to the underlying usage (see the [subscription usage endpoint](fetch-subscription-usage.api.mdx) to fetch usage per metric, in usage units rather than a currency).

This endpoint can be leveraged for internal tooling and to provide a more transparent billing experience for your end users:

  1. Understand the cost breakdown per line item historically and in real-time for the current billing period.
  2. Provide customer visibility into how different services are contributing to the overall invoice with a per-day timeseries (as compared to the [upcoming invoice](fetch-upcoming-invoice) resource, which represents a snapshot for the current period).
  3. Assess how minimums and discounts affect your customers by teasing apart costs directly as a result of usage, as opposed to minimums and discounts at the plan and price level.
  4. Gain insight into key customer health metrics, such as the percent utilization of the minimum committed spend.

## Fetching subscriptions

By default, this endpoint fetches the currently active subscription for the customer, and returns cost information for the subscription's current billing period, broken down by each participating price. If there are no currently active subscriptions, this will instead default to the most recently active subscription or return an empty series if none are found. For example, if your plan charges for compute hours, job runs, and data syncs, then this endpoint would provide a daily breakdown of your customer's cost for each of those axes.

If timeframe bounds are specified, Orb fetches all subscriptions that were active in that timeframe. If two subscriptions overlap on a single day, costs from each price will be summed, and prices for both subscriptions will be included in the breakdown.

## Prepaid plans

For plans that include prices which deduct credits rather than accrue in-arrears charges in a billable currency, this endpoint will return the total deduction amount, in credits, for the specified timeframe.

## Cumulative subtotals and totals

Since the subtotal and total must factor in any billing-period level discounts and minimums, it's most meaningful to consider costs relative to the start of the subscription's billing period. As a result, by default this endpoint returns cumulative totals since the beginning of the billing period. In particular, the `timeframe_start` of a returned timeframe window is _always_ the beginning of the billing period and `timeframe_end` is incremented one day at a time to build the result.

A customer that uses a few API calls a day but has a minimum commitment might exhibit the following pattern for their subtotal and total in the first few days of the month. Here, we assume that each API call is $2.50, the customer's plan has a monthly minimum of $50 for this price, and that the subscription's billing period bounds are aligned to the first of the month:

| timeframe_start | timeframe_end | Cumulative usage | Subtotal | Total (incl. commitment) | | --------------- | ------------- | ---------------- | -------- | ------------------------ | | 2023-02-01 | 2023-02-02 | 9 | $22.50 | $50.00 | | 2023-02-01 | 2023-02-03 | 19 | $47.50 | $50.00 | | 2023-02-01 | 2023-02-04 | 20 | $50.00 | $50.00 | | 2023-02-01 | 2023-02-05 | 28 | $70.00 | $70.00 | | 2023-02-01 | 2023-02-06 | 36 | $90.00 | $90.00 |

### Periodic values

When the query parameter `view_mode=periodic` is specified, Orb will return an incremental day-by-day view of costs. In this case, there will always be a one-day difference between `timeframe_start` and `timeframe_end` for the timeframes returned. This is a transform on top of the cumulative costs, calculated by taking the difference of each timeframe with the last. Note that in the above example, the `Total` value would be 0 for the second two data points, since the minimum commitment has not yet been hit and each day is not contributing anything to the total cost.

## Timeframe bounds

If no timeframe bounds are specified, the response will default to the current billing period for the customer's subscription. For subscriptions that have ended, this will be the billing period when they were last active. If the subscription starts or ends within the timeframe, the response will only include windows where the subscription is active.

As noted above, `timeframe_start` for a given cumulative datapoint is always the beginning of the billing period, and `timeframe_end` is incremented one day at a time to construct the response. When a timeframe is passed in that is not aligned to the current subscription's billing period, the response will contain cumulative totals from multiple billing periods.

Suppose the queried customer has a subscription aligned to the 15th of every month. If this endpoint is queried with the date range `2023-06-01` - `2023-07-01`, the first data point will represent about half a billing period's worth of costs, accounting for accruals from the start of the billing period and inclusive of the first day of the timeframe (`timeframe_start = 2023-05-15 00:00:00`, `timeframe_end = 2023-06-02 00:00:00`)

| datapoint index | timeframe_start | timeframe_end | | --------------- | --------------- | ------------- | | 0 | 2023-05-15 | 2023-06-02 | | 1 | 2023-05-15 | 2023-06-03 | | 2 | ... | ... | | 3 | 2023-05-15 | 2023-06-14 | | 4 | 2023-06-15 | 2023-06-16 | | 5 | 2023-06-15 | 2023-06-17 | | 6 | ... | ... | | 7 | 2023-06-15 | 2023-07-01 |

You can see this sliced timeframe visualized [here](https://i.imgur.com/TXhYgme.png).

## Grouping by custom attributes

In order to view costs grouped by a specific _attribute_ that each event is tagged with (i.e. `cluster`), you can additionally specify a `group_by` key. The `group_by` key denotes the event property on which to group.

When returning grouped costs, a separate `price_group` object in the `per_price_costs` array is returned for each value of the `group_by` key present in your events. The `subtotal` value of the `per_price_costs` object is the sum of each `price_group`'s total.

Orb expects events will contain values in the `properties` dictionary that correspond to the `group_by` key specified. By default, Orb will return a `null` group (i.e. events that match the metric but do not have the key set). Currently, it is only possible to view costs grouped by a single attribute at a time.

### Matrix prices

When a price uses matrix pricing, it's important to view costs grouped by those matrix dimensions. Orb will return `price_groups` with the `grouping_key` and `secondary_grouping_key` based on the matrix price definition, for each `grouping_value` and `secondary_grouping_value` available.

type CustomerCreditLedgerListByExternalIDParams

type CustomerCreditLedgerListByExternalIDParams struct {
	CreatedAtGt  param.Field[time.Time] `query:"created_at[gt]" format:"date-time"`
	CreatedAtGte param.Field[time.Time] `query:"created_at[gte]" format:"date-time"`
	CreatedAtLt  param.Field[time.Time] `query:"created_at[lt]" format:"date-time"`
	CreatedAtLte param.Field[time.Time] `query:"created_at[lte]" format:"date-time"`
	// The ledger currency or custom pricing unit to use.
	Currency param.Field[string] `query:"currency"`
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor      param.Field[string]                                                `query:"cursor"`
	EntryStatus param.Field[CustomerCreditLedgerListByExternalIDParamsEntryStatus] `query:"entry_status"`
	EntryType   param.Field[CustomerCreditLedgerListByExternalIDParamsEntryType]   `query:"entry_type"`
	// The number of items to fetch. Defaults to 20.
	Limit         param.Field[int64]  `query:"limit"`
	MinimumAmount param.Field[string] `query:"minimum_amount"`
}

func (CustomerCreditLedgerListByExternalIDParams) URLQuery

URLQuery serializes CustomerCreditLedgerListByExternalIDParams's query parameters as `url.Values`.

type CustomerCreditLedgerListByExternalIDParamsEntryStatus

type CustomerCreditLedgerListByExternalIDParamsEntryStatus string
const (
	CustomerCreditLedgerListByExternalIDParamsEntryStatusCommitted CustomerCreditLedgerListByExternalIDParamsEntryStatus = "committed"
	CustomerCreditLedgerListByExternalIDParamsEntryStatusPending   CustomerCreditLedgerListByExternalIDParamsEntryStatus = "pending"
)

func (CustomerCreditLedgerListByExternalIDParamsEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerListByExternalIDParamsEntryType

type CustomerCreditLedgerListByExternalIDParamsEntryType string
const (
	CustomerCreditLedgerListByExternalIDParamsEntryTypeIncrement         CustomerCreditLedgerListByExternalIDParamsEntryType = "increment"
	CustomerCreditLedgerListByExternalIDParamsEntryTypeDecrement         CustomerCreditLedgerListByExternalIDParamsEntryType = "decrement"
	CustomerCreditLedgerListByExternalIDParamsEntryTypeExpirationChange  CustomerCreditLedgerListByExternalIDParamsEntryType = "expiration_change"
	CustomerCreditLedgerListByExternalIDParamsEntryTypeCreditBlockExpiry CustomerCreditLedgerListByExternalIDParamsEntryType = "credit_block_expiry"
	CustomerCreditLedgerListByExternalIDParamsEntryTypeVoid              CustomerCreditLedgerListByExternalIDParamsEntryType = "void"
	CustomerCreditLedgerListByExternalIDParamsEntryTypeVoidInitiated     CustomerCreditLedgerListByExternalIDParamsEntryType = "void_initiated"
	CustomerCreditLedgerListByExternalIDParamsEntryTypeAmendment         CustomerCreditLedgerListByExternalIDParamsEntryType = "amendment"
)

func (CustomerCreditLedgerListByExternalIDParamsEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntry

type CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntry struct {
	ID                   string                                                                      `json:"id,required"`
	Amount               float64                                                                     `json:"amount,required"`
	CreatedAt            time.Time                                                                   `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                      `json:"currency,required"`
	Customer             CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                      `json:"description,required,nullable"`
	EndingBalance        float64                                                                     `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                       `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                                    `json:"metadata,required"`
	StartingBalance float64                                                              `json:"starting_balance,required"`
	JSON            customerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntry) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryCreditBlock

type CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryCreditBlock struct {
	ID               string                                                                          `json:"id,required"`
	ExpiryDate       time.Time                                                                       `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                          `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryCustomer

type CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryCustomer struct {
	ID                 string                                                                       `json:"id,required"`
	ExternalCustomerID string                                                                       `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryEntryStatus

type CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryEntryStatusCommitted CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryEntryStatusPending   CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryEntryType

type CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryEntryType string
const (
	CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryEntryTypeAmendment CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryEntryType = "amendment"
)

func (CustomerCreditLedgerListByExternalIDResponseAmendmentLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntry

type CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntry struct {
	ID                   string                                                                              `json:"id,required"`
	Amount               float64                                                                             `json:"amount,required"`
	CreatedAt            time.Time                                                                           `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                              `json:"currency,required"`
	Customer             CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                              `json:"description,required,nullable"`
	EndingBalance        float64                                                                             `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                               `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                                            `json:"metadata,required"`
	StartingBalance float64                                                                      `json:"starting_balance,required"`
	JSON            customerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntry) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryCreditBlock

type CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryCreditBlock struct {
	ID               string                                                                                  `json:"id,required"`
	ExpiryDate       time.Time                                                                               `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                                  `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryCustomer

type CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryCustomer struct {
	ID                 string                                                                               `json:"id,required"`
	ExternalCustomerID string                                                                               `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryEntryStatus

type CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryEntryStatusCommitted CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryEntryStatusPending   CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryEntryType

type CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryEntryType string
const (
	CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryEntryTypeCreditBlockExpiry CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryEntryType = "credit_block_expiry"
)

func (CustomerCreditLedgerListByExternalIDResponseCreditBlockExpiryLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntry

type CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntry struct {
	ID                   string                                                                      `json:"id,required"`
	Amount               float64                                                                     `json:"amount,required"`
	CreatedAt            time.Time                                                                   `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                      `json:"currency,required"`
	Customer             CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                      `json:"description,required,nullable"`
	EndingBalance        float64                                                                     `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                       `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                                    `json:"metadata,required"`
	StartingBalance float64                                                              `json:"starting_balance,required"`
	EventID         string                                                               `json:"event_id,nullable"`
	InvoiceID       string                                                               `json:"invoice_id,nullable"`
	PriceID         string                                                               `json:"price_id,nullable"`
	JSON            customerCreditLedgerListByExternalIDResponseDecrementLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntry) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryCreditBlock

type CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryCreditBlock struct {
	ID               string                                                                          `json:"id,required"`
	ExpiryDate       time.Time                                                                       `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                          `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerListByExternalIDResponseDecrementLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryCustomer

type CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryCustomer struct {
	ID                 string                                                                       `json:"id,required"`
	ExternalCustomerID string                                                                       `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerListByExternalIDResponseDecrementLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryEntryStatus

type CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryEntryStatusCommitted CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryEntryStatusPending   CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryEntryType

type CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryEntryType string
const (
	CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryEntryTypeDecrement CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryEntryType = "decrement"
)

func (CustomerCreditLedgerListByExternalIDResponseDecrementLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntry

type CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntry struct {
	ID                   string                                                                             `json:"id,required"`
	Amount               float64                                                                            `json:"amount,required"`
	CreatedAt            time.Time                                                                          `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                             `json:"currency,required"`
	Customer             CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                             `json:"description,required,nullable"`
	EndingBalance        float64                                                                            `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                              `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata           map[string]string                                                           `json:"metadata,required"`
	NewBlockExpiryDate time.Time                                                                   `json:"new_block_expiry_date,required" format:"date-time"`
	StartingBalance    float64                                                                     `json:"starting_balance,required"`
	JSON               customerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntry) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryCreditBlock

type CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryCreditBlock struct {
	ID               string                                                                                 `json:"id,required"`
	ExpiryDate       time.Time                                                                              `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                                 `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryCustomer

type CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryCustomer struct {
	ID                 string                                                                              `json:"id,required"`
	ExternalCustomerID string                                                                              `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryEntryStatus

type CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryEntryStatusCommitted CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryEntryStatusPending   CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryEntryType

type CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryEntryType string
const (
	CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryEntryTypeExpirationChange CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryEntryType = "expiration_change"
)

func (CustomerCreditLedgerListByExternalIDResponseExpirationChangeLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntry

type CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntry struct {
	ID                   string                                                                      `json:"id,required"`
	Amount               float64                                                                     `json:"amount,required"`
	CreatedAt            time.Time                                                                   `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                      `json:"currency,required"`
	Customer             CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                      `json:"description,required,nullable"`
	EndingBalance        float64                                                                     `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                       `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                                    `json:"metadata,required"`
	StartingBalance float64                                                              `json:"starting_balance,required"`
	JSON            customerCreditLedgerListByExternalIDResponseIncrementLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntry) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryCreditBlock

type CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryCreditBlock struct {
	ID               string                                                                          `json:"id,required"`
	ExpiryDate       time.Time                                                                       `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                          `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerListByExternalIDResponseIncrementLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryCustomer

type CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryCustomer struct {
	ID                 string                                                                       `json:"id,required"`
	ExternalCustomerID string                                                                       `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerListByExternalIDResponseIncrementLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryEntryStatus

type CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryEntryStatusCommitted CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryEntryStatusPending   CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryEntryType

type CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryEntryType string
const (
	CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryEntryTypeIncrement CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryEntryType = "increment"
)

func (CustomerCreditLedgerListByExternalIDResponseIncrementLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntry

type CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntry struct {
	ID                   string                                                                          `json:"id,required"`
	Amount               float64                                                                         `json:"amount,required"`
	CreatedAt            time.Time                                                                       `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                          `json:"currency,required"`
	Customer             CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                          `json:"description,required,nullable"`
	EndingBalance        float64                                                                         `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                           `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata           map[string]string                                                        `json:"metadata,required"`
	NewBlockExpiryDate time.Time                                                                `json:"new_block_expiry_date,required" format:"date-time"`
	StartingBalance    float64                                                                  `json:"starting_balance,required"`
	VoidAmount         float64                                                                  `json:"void_amount,required"`
	VoidReason         string                                                                   `json:"void_reason,required,nullable"`
	JSON               customerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntry) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryCreditBlock

type CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryCreditBlock struct {
	ID               string                                                                              `json:"id,required"`
	ExpiryDate       time.Time                                                                           `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                              `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryCustomer

type CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryCustomer struct {
	ID                 string                                                                           `json:"id,required"`
	ExternalCustomerID string                                                                           `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryEntryStatus

type CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryEntryStatusCommitted CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryEntryStatusPending   CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryEntryType

type CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryEntryType string
const (
	CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryEntryTypeVoidInitiated CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryEntryType = "void_initiated"
)

func (CustomerCreditLedgerListByExternalIDResponseVoidInitiatedLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntry

type CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntry struct {
	ID                   string                                                                 `json:"id,required"`
	Amount               float64                                                                `json:"amount,required"`
	CreatedAt            time.Time                                                              `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                 `json:"currency,required"`
	Customer             CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                 `json:"description,required,nullable"`
	EndingBalance        float64                                                                `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                  `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                               `json:"metadata,required"`
	StartingBalance float64                                                         `json:"starting_balance,required"`
	VoidAmount      float64                                                         `json:"void_amount,required"`
	VoidReason      string                                                          `json:"void_reason,required,nullable"`
	JSON            customerCreditLedgerListByExternalIDResponseVoidLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntry) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryCreditBlock

type CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryCreditBlock struct {
	ID               string                                                                     `json:"id,required"`
	ExpiryDate       time.Time                                                                  `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                     `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerListByExternalIDResponseVoidLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryCustomer

type CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryCustomer struct {
	ID                 string                                                                  `json:"id,required"`
	ExternalCustomerID string                                                                  `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerListByExternalIDResponseVoidLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryEntryStatus

type CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryEntryStatusCommitted CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryEntryStatusPending   CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryEntryType

type CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryEntryType string
const (
	CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryEntryTypeVoid CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryEntryType = "void"
)

func (CustomerCreditLedgerListByExternalIDResponseVoidLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerListParams

type CustomerCreditLedgerListParams struct {
	CreatedAtGt  param.Field[time.Time] `query:"created_at[gt]" format:"date-time"`
	CreatedAtGte param.Field[time.Time] `query:"created_at[gte]" format:"date-time"`
	CreatedAtLt  param.Field[time.Time] `query:"created_at[lt]" format:"date-time"`
	CreatedAtLte param.Field[time.Time] `query:"created_at[lte]" format:"date-time"`
	// The ledger currency or custom pricing unit to use.
	Currency param.Field[string] `query:"currency"`
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor      param.Field[string]                                    `query:"cursor"`
	EntryStatus param.Field[CustomerCreditLedgerListParamsEntryStatus] `query:"entry_status"`
	EntryType   param.Field[CustomerCreditLedgerListParamsEntryType]   `query:"entry_type"`
	// The number of items to fetch. Defaults to 20.
	Limit         param.Field[int64]  `query:"limit"`
	MinimumAmount param.Field[string] `query:"minimum_amount"`
}

func (CustomerCreditLedgerListParams) URLQuery

func (r CustomerCreditLedgerListParams) URLQuery() (v url.Values)

URLQuery serializes CustomerCreditLedgerListParams's query parameters as `url.Values`.

type CustomerCreditLedgerListParamsEntryStatus

type CustomerCreditLedgerListParamsEntryStatus string
const (
	CustomerCreditLedgerListParamsEntryStatusCommitted CustomerCreditLedgerListParamsEntryStatus = "committed"
	CustomerCreditLedgerListParamsEntryStatusPending   CustomerCreditLedgerListParamsEntryStatus = "pending"
)

func (CustomerCreditLedgerListParamsEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerListParamsEntryType

type CustomerCreditLedgerListParamsEntryType string
const (
	CustomerCreditLedgerListParamsEntryTypeIncrement         CustomerCreditLedgerListParamsEntryType = "increment"
	CustomerCreditLedgerListParamsEntryTypeDecrement         CustomerCreditLedgerListParamsEntryType = "decrement"
	CustomerCreditLedgerListParamsEntryTypeExpirationChange  CustomerCreditLedgerListParamsEntryType = "expiration_change"
	CustomerCreditLedgerListParamsEntryTypeCreditBlockExpiry CustomerCreditLedgerListParamsEntryType = "credit_block_expiry"
	CustomerCreditLedgerListParamsEntryTypeVoid              CustomerCreditLedgerListParamsEntryType = "void"
	CustomerCreditLedgerListParamsEntryTypeVoidInitiated     CustomerCreditLedgerListParamsEntryType = "void_initiated"
	CustomerCreditLedgerListParamsEntryTypeAmendment         CustomerCreditLedgerListParamsEntryType = "amendment"
)

func (CustomerCreditLedgerListParamsEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerListResponseAmendmentLedgerEntry

type CustomerCreditLedgerListResponseAmendmentLedgerEntry struct {
	ID                   string                                                          `json:"id,required"`
	Amount               float64                                                         `json:"amount,required"`
	CreatedAt            time.Time                                                       `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerListResponseAmendmentLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                          `json:"currency,required"`
	Customer             CustomerCreditLedgerListResponseAmendmentLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                          `json:"description,required,nullable"`
	EndingBalance        float64                                                         `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerListResponseAmendmentLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerListResponseAmendmentLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                           `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                        `json:"metadata,required"`
	StartingBalance float64                                                  `json:"starting_balance,required"`
	JSON            customerCreditLedgerListResponseAmendmentLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseAmendmentLedgerEntry) UnmarshalJSON

func (r *CustomerCreditLedgerListResponseAmendmentLedgerEntry) UnmarshalJSON(data []byte) (err error)

type CustomerCreditLedgerListResponseAmendmentLedgerEntryCreditBlock

type CustomerCreditLedgerListResponseAmendmentLedgerEntryCreditBlock struct {
	ID               string                                                              `json:"id,required"`
	ExpiryDate       time.Time                                                           `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                              `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerListResponseAmendmentLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseAmendmentLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerListResponseAmendmentLedgerEntryCustomer

type CustomerCreditLedgerListResponseAmendmentLedgerEntryCustomer struct {
	ID                 string                                                           `json:"id,required"`
	ExternalCustomerID string                                                           `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerListResponseAmendmentLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseAmendmentLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerListResponseAmendmentLedgerEntryEntryStatus

type CustomerCreditLedgerListResponseAmendmentLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerListResponseAmendmentLedgerEntryEntryStatusCommitted CustomerCreditLedgerListResponseAmendmentLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerListResponseAmendmentLedgerEntryEntryStatusPending   CustomerCreditLedgerListResponseAmendmentLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerListResponseAmendmentLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerListResponseAmendmentLedgerEntryEntryType

type CustomerCreditLedgerListResponseAmendmentLedgerEntryEntryType string
const (
	CustomerCreditLedgerListResponseAmendmentLedgerEntryEntryTypeAmendment CustomerCreditLedgerListResponseAmendmentLedgerEntryEntryType = "amendment"
)

func (CustomerCreditLedgerListResponseAmendmentLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntry

type CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntry struct {
	ID                   string                                                                  `json:"id,required"`
	Amount               float64                                                                 `json:"amount,required"`
	CreatedAt            time.Time                                                               `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                  `json:"currency,required"`
	Customer             CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                  `json:"description,required,nullable"`
	EndingBalance        float64                                                                 `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                   `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                                `json:"metadata,required"`
	StartingBalance float64                                                          `json:"starting_balance,required"`
	JSON            customerCreditLedgerListResponseCreditBlockExpiryLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntry) UnmarshalJSON

type CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryCreditBlock

type CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryCreditBlock struct {
	ID               string                                                                      `json:"id,required"`
	ExpiryDate       time.Time                                                                   `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                      `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerListResponseCreditBlockExpiryLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryCustomer

type CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryCustomer struct {
	ID                 string                                                                   `json:"id,required"`
	ExternalCustomerID string                                                                   `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerListResponseCreditBlockExpiryLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryEntryStatus

type CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryEntryStatusCommitted CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryEntryStatusPending   CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryEntryType

type CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryEntryType string
const (
	CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryEntryTypeCreditBlockExpiry CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryEntryType = "credit_block_expiry"
)

func (CustomerCreditLedgerListResponseCreditBlockExpiryLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerListResponseDecrementLedgerEntry

type CustomerCreditLedgerListResponseDecrementLedgerEntry struct {
	ID                   string                                                          `json:"id,required"`
	Amount               float64                                                         `json:"amount,required"`
	CreatedAt            time.Time                                                       `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerListResponseDecrementLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                          `json:"currency,required"`
	Customer             CustomerCreditLedgerListResponseDecrementLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                          `json:"description,required,nullable"`
	EndingBalance        float64                                                         `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerListResponseDecrementLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerListResponseDecrementLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                           `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                        `json:"metadata,required"`
	StartingBalance float64                                                  `json:"starting_balance,required"`
	EventID         string                                                   `json:"event_id,nullable"`
	InvoiceID       string                                                   `json:"invoice_id,nullable"`
	PriceID         string                                                   `json:"price_id,nullable"`
	JSON            customerCreditLedgerListResponseDecrementLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseDecrementLedgerEntry) UnmarshalJSON

func (r *CustomerCreditLedgerListResponseDecrementLedgerEntry) UnmarshalJSON(data []byte) (err error)

type CustomerCreditLedgerListResponseDecrementLedgerEntryCreditBlock

type CustomerCreditLedgerListResponseDecrementLedgerEntryCreditBlock struct {
	ID               string                                                              `json:"id,required"`
	ExpiryDate       time.Time                                                           `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                              `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerListResponseDecrementLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseDecrementLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerListResponseDecrementLedgerEntryCustomer

type CustomerCreditLedgerListResponseDecrementLedgerEntryCustomer struct {
	ID                 string                                                           `json:"id,required"`
	ExternalCustomerID string                                                           `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerListResponseDecrementLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseDecrementLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerListResponseDecrementLedgerEntryEntryStatus

type CustomerCreditLedgerListResponseDecrementLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerListResponseDecrementLedgerEntryEntryStatusCommitted CustomerCreditLedgerListResponseDecrementLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerListResponseDecrementLedgerEntryEntryStatusPending   CustomerCreditLedgerListResponseDecrementLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerListResponseDecrementLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerListResponseDecrementLedgerEntryEntryType

type CustomerCreditLedgerListResponseDecrementLedgerEntryEntryType string
const (
	CustomerCreditLedgerListResponseDecrementLedgerEntryEntryTypeDecrement CustomerCreditLedgerListResponseDecrementLedgerEntryEntryType = "decrement"
)

func (CustomerCreditLedgerListResponseDecrementLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerListResponseExpirationChangeLedgerEntry

type CustomerCreditLedgerListResponseExpirationChangeLedgerEntry struct {
	ID                   string                                                                 `json:"id,required"`
	Amount               float64                                                                `json:"amount,required"`
	CreatedAt            time.Time                                                              `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerListResponseExpirationChangeLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                 `json:"currency,required"`
	Customer             CustomerCreditLedgerListResponseExpirationChangeLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                 `json:"description,required,nullable"`
	EndingBalance        float64                                                                `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerListResponseExpirationChangeLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerListResponseExpirationChangeLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                  `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata           map[string]string                                               `json:"metadata,required"`
	NewBlockExpiryDate time.Time                                                       `json:"new_block_expiry_date,required" format:"date-time"`
	StartingBalance    float64                                                         `json:"starting_balance,required"`
	JSON               customerCreditLedgerListResponseExpirationChangeLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseExpirationChangeLedgerEntry) UnmarshalJSON

type CustomerCreditLedgerListResponseExpirationChangeLedgerEntryCreditBlock

type CustomerCreditLedgerListResponseExpirationChangeLedgerEntryCreditBlock struct {
	ID               string                                                                     `json:"id,required"`
	ExpiryDate       time.Time                                                                  `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                     `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerListResponseExpirationChangeLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseExpirationChangeLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerListResponseExpirationChangeLedgerEntryCustomer

type CustomerCreditLedgerListResponseExpirationChangeLedgerEntryCustomer struct {
	ID                 string                                                                  `json:"id,required"`
	ExternalCustomerID string                                                                  `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerListResponseExpirationChangeLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseExpirationChangeLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerListResponseExpirationChangeLedgerEntryEntryStatus

type CustomerCreditLedgerListResponseExpirationChangeLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerListResponseExpirationChangeLedgerEntryEntryStatusCommitted CustomerCreditLedgerListResponseExpirationChangeLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerListResponseExpirationChangeLedgerEntryEntryStatusPending   CustomerCreditLedgerListResponseExpirationChangeLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerListResponseExpirationChangeLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerListResponseExpirationChangeLedgerEntryEntryType

type CustomerCreditLedgerListResponseExpirationChangeLedgerEntryEntryType string
const (
	CustomerCreditLedgerListResponseExpirationChangeLedgerEntryEntryTypeExpirationChange CustomerCreditLedgerListResponseExpirationChangeLedgerEntryEntryType = "expiration_change"
)

func (CustomerCreditLedgerListResponseExpirationChangeLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerListResponseIncrementLedgerEntry

type CustomerCreditLedgerListResponseIncrementLedgerEntry struct {
	ID                   string                                                          `json:"id,required"`
	Amount               float64                                                         `json:"amount,required"`
	CreatedAt            time.Time                                                       `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerListResponseIncrementLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                          `json:"currency,required"`
	Customer             CustomerCreditLedgerListResponseIncrementLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                          `json:"description,required,nullable"`
	EndingBalance        float64                                                         `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerListResponseIncrementLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerListResponseIncrementLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                           `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                        `json:"metadata,required"`
	StartingBalance float64                                                  `json:"starting_balance,required"`
	JSON            customerCreditLedgerListResponseIncrementLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseIncrementLedgerEntry) UnmarshalJSON

func (r *CustomerCreditLedgerListResponseIncrementLedgerEntry) UnmarshalJSON(data []byte) (err error)

type CustomerCreditLedgerListResponseIncrementLedgerEntryCreditBlock

type CustomerCreditLedgerListResponseIncrementLedgerEntryCreditBlock struct {
	ID               string                                                              `json:"id,required"`
	ExpiryDate       time.Time                                                           `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                              `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerListResponseIncrementLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseIncrementLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerListResponseIncrementLedgerEntryCustomer

type CustomerCreditLedgerListResponseIncrementLedgerEntryCustomer struct {
	ID                 string                                                           `json:"id,required"`
	ExternalCustomerID string                                                           `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerListResponseIncrementLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseIncrementLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerListResponseIncrementLedgerEntryEntryStatus

type CustomerCreditLedgerListResponseIncrementLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerListResponseIncrementLedgerEntryEntryStatusCommitted CustomerCreditLedgerListResponseIncrementLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerListResponseIncrementLedgerEntryEntryStatusPending   CustomerCreditLedgerListResponseIncrementLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerListResponseIncrementLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerListResponseIncrementLedgerEntryEntryType

type CustomerCreditLedgerListResponseIncrementLedgerEntryEntryType string
const (
	CustomerCreditLedgerListResponseIncrementLedgerEntryEntryTypeIncrement CustomerCreditLedgerListResponseIncrementLedgerEntryEntryType = "increment"
)

func (CustomerCreditLedgerListResponseIncrementLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerListResponseVoidInitiatedLedgerEntry

type CustomerCreditLedgerListResponseVoidInitiatedLedgerEntry struct {
	ID                   string                                                              `json:"id,required"`
	Amount               float64                                                             `json:"amount,required"`
	CreatedAt            time.Time                                                           `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                              `json:"currency,required"`
	Customer             CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                              `json:"description,required,nullable"`
	EndingBalance        float64                                                             `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                               `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata           map[string]string                                            `json:"metadata,required"`
	NewBlockExpiryDate time.Time                                                    `json:"new_block_expiry_date,required" format:"date-time"`
	StartingBalance    float64                                                      `json:"starting_balance,required"`
	VoidAmount         float64                                                      `json:"void_amount,required"`
	VoidReason         string                                                       `json:"void_reason,required,nullable"`
	JSON               customerCreditLedgerListResponseVoidInitiatedLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseVoidInitiatedLedgerEntry) UnmarshalJSON

type CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryCreditBlock

type CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryCreditBlock struct {
	ID               string                                                                  `json:"id,required"`
	ExpiryDate       time.Time                                                               `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                  `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerListResponseVoidInitiatedLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryCustomer

type CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryCustomer struct {
	ID                 string                                                               `json:"id,required"`
	ExternalCustomerID string                                                               `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerListResponseVoidInitiatedLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryEntryStatus

type CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryEntryStatusCommitted CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryEntryStatusPending   CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryEntryType

type CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryEntryType string
const (
	CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryEntryTypeVoidInitiated CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryEntryType = "void_initiated"
)

func (CustomerCreditLedgerListResponseVoidInitiatedLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerListResponseVoidLedgerEntry

type CustomerCreditLedgerListResponseVoidLedgerEntry struct {
	ID                   string                                                     `json:"id,required"`
	Amount               float64                                                    `json:"amount,required"`
	CreatedAt            time.Time                                                  `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerListResponseVoidLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                     `json:"currency,required"`
	Customer             CustomerCreditLedgerListResponseVoidLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                     `json:"description,required,nullable"`
	EndingBalance        float64                                                    `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerListResponseVoidLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerListResponseVoidLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                      `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                   `json:"metadata,required"`
	StartingBalance float64                                             `json:"starting_balance,required"`
	VoidAmount      float64                                             `json:"void_amount,required"`
	VoidReason      string                                              `json:"void_reason,required,nullable"`
	JSON            customerCreditLedgerListResponseVoidLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseVoidLedgerEntry) UnmarshalJSON

func (r *CustomerCreditLedgerListResponseVoidLedgerEntry) UnmarshalJSON(data []byte) (err error)

type CustomerCreditLedgerListResponseVoidLedgerEntryCreditBlock

type CustomerCreditLedgerListResponseVoidLedgerEntryCreditBlock struct {
	ID               string                                                         `json:"id,required"`
	ExpiryDate       time.Time                                                      `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                         `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerListResponseVoidLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseVoidLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerListResponseVoidLedgerEntryCustomer

type CustomerCreditLedgerListResponseVoidLedgerEntryCustomer struct {
	ID                 string                                                      `json:"id,required"`
	ExternalCustomerID string                                                      `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerListResponseVoidLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerListResponseVoidLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerListResponseVoidLedgerEntryEntryStatus

type CustomerCreditLedgerListResponseVoidLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerListResponseVoidLedgerEntryEntryStatusCommitted CustomerCreditLedgerListResponseVoidLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerListResponseVoidLedgerEntryEntryStatusPending   CustomerCreditLedgerListResponseVoidLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerListResponseVoidLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerListResponseVoidLedgerEntryEntryType

type CustomerCreditLedgerListResponseVoidLedgerEntryEntryType string
const (
	CustomerCreditLedgerListResponseVoidLedgerEntryEntryTypeVoid CustomerCreditLedgerListResponseVoidLedgerEntryEntryType = "void"
)

func (CustomerCreditLedgerListResponseVoidLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDParamsAddAmendmentCreditLedgerEntryRequestParams added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddAmendmentCreditLedgerEntryRequestParams struct {
	// The number of credits to effect. Note that this is required for increment,
	// decrement or void operations.
	Amount param.Field[float64] `json:"amount,required"`
	// The ID of the block to reverse a decrement from.
	BlockID   param.Field[string]                                                                                            `json:"block_id,required"`
	EntryType param.Field[CustomerCreditLedgerNewEntryByExternalIDParamsAddAmendmentCreditLedgerEntryRequestParamsEntryType] `json:"entry_type,required"`
	// The currency or custom pricing unit to use for this ledger entry. If this is a
	// real-world currency, it must match the customer's invoicing currency.
	Currency param.Field[string] `json:"currency"`
	// Optional metadata that can be specified when adding ledger results via the API.
	// For example, this can be used to note an increment refers to trial credits, or
	// for noting corrections as a result of an incident, etc.
	Description param.Field[string] `json:"description"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddAmendmentCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryByExternalIDParams added in v0.2.1

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddAmendmentCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryByExternalIDParams()

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddAmendmentCreditLedgerEntryRequestParams) MarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddAmendmentCreditLedgerEntryRequestParamsEntryType added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddAmendmentCreditLedgerEntryRequestParamsEntryType string
const (
	CustomerCreditLedgerNewEntryByExternalIDParamsAddAmendmentCreditLedgerEntryRequestParamsEntryTypeAmendment CustomerCreditLedgerNewEntryByExternalIDParamsAddAmendmentCreditLedgerEntryRequestParamsEntryType = "amendment"
)

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddAmendmentCreditLedgerEntryRequestParamsEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDParamsAddDecrementCreditLedgerEntryRequestParams added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddDecrementCreditLedgerEntryRequestParams struct {
	// The number of credits to effect. Note that this is required for increment,
	// decrement, void, or undo operations.
	Amount    param.Field[float64]                                                                                           `json:"amount,required"`
	EntryType param.Field[CustomerCreditLedgerNewEntryByExternalIDParamsAddDecrementCreditLedgerEntryRequestParamsEntryType] `json:"entry_type,required"`
	// The currency or custom pricing unit to use for this ledger entry. If this is a
	// real-world currency, it must match the customer's invoicing currency.
	Currency param.Field[string] `json:"currency"`
	// Optional metadata that can be specified when adding ledger results via the API.
	// For example, this can be used to note an increment refers to trial credits, or
	// for noting corrections as a result of an incident, etc.
	Description param.Field[string] `json:"description"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddDecrementCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryByExternalIDParams added in v0.2.1

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddDecrementCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryByExternalIDParams()

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddDecrementCreditLedgerEntryRequestParams) MarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddDecrementCreditLedgerEntryRequestParamsEntryType added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddDecrementCreditLedgerEntryRequestParamsEntryType string
const (
	CustomerCreditLedgerNewEntryByExternalIDParamsAddDecrementCreditLedgerEntryRequestParamsEntryTypeDecrement CustomerCreditLedgerNewEntryByExternalIDParamsAddDecrementCreditLedgerEntryRequestParamsEntryType = "decrement"
)

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddDecrementCreditLedgerEntryRequestParamsEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDParamsAddExpirationChangeCreditLedgerEntryRequestParams added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddExpirationChangeCreditLedgerEntryRequestParams struct {
	EntryType param.Field[CustomerCreditLedgerNewEntryByExternalIDParamsAddExpirationChangeCreditLedgerEntryRequestParamsEntryType] `json:"entry_type,required"`
	// An ISO 8601 format date that identifies the origination credit block to expire
	ExpiryDate param.Field[time.Time] `json:"expiry_date,required" format:"date-time"`
	// A future date (specified in YYYY-MM-DD format) used for expiration change,
	// denoting when credits transferred (as part of a partial block expiration) should
	// expire.
	TargetExpiryDate param.Field[time.Time] `json:"target_expiry_date,required" format:"date"`
	// The number of credits to effect. Note that this is required for increment,
	// decrement, void, or undo operations.
	Amount param.Field[float64] `json:"amount"`
	// The ID of the block affected by an expiration_change, used to differentiate
	// between multiple blocks with the same `expiry_date`.
	BlockID param.Field[string] `json:"block_id"`
	// The currency or custom pricing unit to use for this ledger entry. If this is a
	// real-world currency, it must match the customer's invoicing currency.
	Currency param.Field[string] `json:"currency"`
	// Optional metadata that can be specified when adding ledger results via the API.
	// For example, this can be used to note an increment refers to trial credits, or
	// for noting corrections as a result of an incident, etc.
	Description param.Field[string] `json:"description"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddExpirationChangeCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryByExternalIDParams added in v0.2.1

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddExpirationChangeCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryByExternalIDParams()

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddExpirationChangeCreditLedgerEntryRequestParams) MarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddExpirationChangeCreditLedgerEntryRequestParamsEntryType added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddExpirationChangeCreditLedgerEntryRequestParamsEntryType string
const (
	CustomerCreditLedgerNewEntryByExternalIDParamsAddExpirationChangeCreditLedgerEntryRequestParamsEntryTypeExpirationChange CustomerCreditLedgerNewEntryByExternalIDParamsAddExpirationChangeCreditLedgerEntryRequestParamsEntryType = "expiration_change"
)

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddExpirationChangeCreditLedgerEntryRequestParamsEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDParamsAddIncrementCreditLedgerEntryRequestParams added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddIncrementCreditLedgerEntryRequestParams struct {
	// The number of credits to effect. Note that this is required for increment,
	// decrement, void, or undo operations.
	Amount    param.Field[float64]                                                                                           `json:"amount,required"`
	EntryType param.Field[CustomerCreditLedgerNewEntryByExternalIDParamsAddIncrementCreditLedgerEntryRequestParamsEntryType] `json:"entry_type,required"`
	// The currency or custom pricing unit to use for this ledger entry. If this is a
	// real-world currency, it must match the customer's invoicing currency.
	Currency param.Field[string] `json:"currency"`
	// Optional metadata that can be specified when adding ledger results via the API.
	// For example, this can be used to note an increment refers to trial credits, or
	// for noting corrections as a result of an incident, etc.
	Description param.Field[string] `json:"description"`
	// An ISO 8601 format date that denotes when this credit balance should become
	// available for use.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date-time"`
	// An ISO 8601 format date that denotes when this credit balance should expire.
	ExpiryDate param.Field[time.Time] `json:"expiry_date" format:"date-time"`
	// Passing `invoice_settings` automatically generates an invoice for the newly
	// added credits. If `invoice_settings` is passed, you must specify
	// per_unit_cost_basis, as the calculation of the invoice total is done on that
	// basis.
	InvoiceSettings param.Field[CustomerCreditLedgerNewEntryByExternalIDParamsAddIncrementCreditLedgerEntryRequestParamsInvoiceSettings] `json:"invoice_settings"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// Can only be specified when entry_type=increment. How much, in USD, a customer
	// paid for a single credit in this block
	PerUnitCostBasis param.Field[string] `json:"per_unit_cost_basis"`
}

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddIncrementCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryByExternalIDParams added in v0.2.1

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddIncrementCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryByExternalIDParams()

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddIncrementCreditLedgerEntryRequestParams) MarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddIncrementCreditLedgerEntryRequestParamsEntryType added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddIncrementCreditLedgerEntryRequestParamsEntryType string
const (
	CustomerCreditLedgerNewEntryByExternalIDParamsAddIncrementCreditLedgerEntryRequestParamsEntryTypeIncrement CustomerCreditLedgerNewEntryByExternalIDParamsAddIncrementCreditLedgerEntryRequestParamsEntryType = "increment"
)

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddIncrementCreditLedgerEntryRequestParamsEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDParamsAddIncrementCreditLedgerEntryRequestParamsInvoiceSettings added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddIncrementCreditLedgerEntryRequestParamsInvoiceSettings struct {
	// Whether the credits purchase invoice should auto collect with the customer's
	// saved payment method.
	AutoCollection param.Field[bool] `json:"auto_collection,required"`
	// The net terms determines the difference between the invoice date and the issue
	// date for the invoice. If you intend the invoice to be due on issue, set this
	// to 0.
	NetTerms param.Field[int64] `json:"net_terms,required"`
	// An optional memo to display on the invoice.
	Memo param.Field[string] `json:"memo"`
}

Passing `invoice_settings` automatically generates an invoice for the newly added credits. If `invoice_settings` is passed, you must specify per_unit_cost_basis, as the calculation of the invoice total is done on that basis.

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddIncrementCreditLedgerEntryRequestParamsInvoiceSettings) MarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParams added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParams struct {
	// The number of credits to effect. Note that this is required for increment,
	// decrement, void, or undo operations.
	Amount param.Field[float64] `json:"amount,required"`
	// The ID of the block to void.
	BlockID   param.Field[string]                                                                                       `json:"block_id,required"`
	EntryType param.Field[CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParamsEntryType] `json:"entry_type,required"`
	// The currency or custom pricing unit to use for this ledger entry. If this is a
	// real-world currency, it must match the customer's invoicing currency.
	Currency param.Field[string] `json:"currency"`
	// Optional metadata that can be specified when adding ledger results via the API.
	// For example, this can be used to note an increment refers to trial credits, or
	// for noting corrections as a result of an incident, etc.
	Description param.Field[string] `json:"description"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// Can only be specified when `entry_type=void`. The reason for the void.
	VoidReason param.Field[CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParamsVoidReason] `json:"void_reason"`
}

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryByExternalIDParams added in v0.2.1

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryByExternalIDParams()

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParams) MarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParamsEntryType added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParamsEntryType string
const (
	CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParamsEntryTypeVoid CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParamsEntryType = "void"
)

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParamsEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParamsVoidReason added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParamsVoidReason string

Can only be specified when `entry_type=void`. The reason for the void.

const (
	CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParamsVoidReasonRefund CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParamsVoidReason = "refund"
)

func (CustomerCreditLedgerNewEntryByExternalIDParamsAddVoidCreditLedgerEntryRequestParamsVoidReason) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntry added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntry struct {
	ID                   string                                                                          `json:"id,required"`
	Amount               float64                                                                         `json:"amount,required"`
	CreatedAt            time.Time                                                                       `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                          `json:"currency,required"`
	Customer             CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                          `json:"description,required,nullable"`
	EndingBalance        float64                                                                         `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                           `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                                        `json:"metadata,required"`
	StartingBalance float64                                                                  `json:"starting_balance,required"`
	JSON            customerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntry) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryCreditBlock added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryCreditBlock struct {
	ID               string                                                                              `json:"id,required"`
	ExpiryDate       time.Time                                                                           `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                              `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryCreditBlock) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryCustomer added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryCustomer struct {
	ID                 string                                                                           `json:"id,required"`
	ExternalCustomerID string                                                                           `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryCustomer) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryEntryStatus added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryEntryStatusCommitted CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryEntryStatusPending   CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryEntryType added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryEntryType string
const (
	CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryEntryTypeAmendment CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryEntryType = "amendment"
)

func (CustomerCreditLedgerNewEntryByExternalIDResponseAmendmentLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntry added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntry struct {
	ID                   string                                                                                  `json:"id,required"`
	Amount               float64                                                                                 `json:"amount,required"`
	CreatedAt            time.Time                                                                               `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                                  `json:"currency,required"`
	Customer             CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                                  `json:"description,required,nullable"`
	EndingBalance        float64                                                                                 `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                                   `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                                                `json:"metadata,required"`
	StartingBalance float64                                                                          `json:"starting_balance,required"`
	JSON            customerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntry) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryCreditBlock added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryCreditBlock struct {
	ID               string                                                                                      `json:"id,required"`
	ExpiryDate       time.Time                                                                                   `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                                      `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryCreditBlock) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryCustomer added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryCustomer struct {
	ID                 string                                                                                   `json:"id,required"`
	ExternalCustomerID string                                                                                   `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryCustomer) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryEntryStatus added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryEntryStatusCommitted CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryEntryStatusPending   CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryEntryType added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryEntryType string
const (
	CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryEntryTypeCreditBlockExpiry CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryEntryType = "credit_block_expiry"
)

func (CustomerCreditLedgerNewEntryByExternalIDResponseCreditBlockExpiryLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntry added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntry struct {
	ID                   string                                                                          `json:"id,required"`
	Amount               float64                                                                         `json:"amount,required"`
	CreatedAt            time.Time                                                                       `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                          `json:"currency,required"`
	Customer             CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                          `json:"description,required,nullable"`
	EndingBalance        float64                                                                         `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                           `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                                        `json:"metadata,required"`
	StartingBalance float64                                                                  `json:"starting_balance,required"`
	EventID         string                                                                   `json:"event_id,nullable"`
	InvoiceID       string                                                                   `json:"invoice_id,nullable"`
	PriceID         string                                                                   `json:"price_id,nullable"`
	JSON            customerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntry) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryCreditBlock added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryCreditBlock struct {
	ID               string                                                                              `json:"id,required"`
	ExpiryDate       time.Time                                                                           `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                              `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryCreditBlock) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryCustomer added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryCustomer struct {
	ID                 string                                                                           `json:"id,required"`
	ExternalCustomerID string                                                                           `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryCustomer) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryEntryStatus added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryEntryStatusCommitted CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryEntryStatusPending   CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryEntryType added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryEntryType string
const (
	CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryEntryTypeDecrement CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryEntryType = "decrement"
)

func (CustomerCreditLedgerNewEntryByExternalIDResponseDecrementLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntry added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntry struct {
	ID                   string                                                                                 `json:"id,required"`
	Amount               float64                                                                                `json:"amount,required"`
	CreatedAt            time.Time                                                                              `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                                 `json:"currency,required"`
	Customer             CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                                 `json:"description,required,nullable"`
	EndingBalance        float64                                                                                `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                                  `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata           map[string]string                                                               `json:"metadata,required"`
	NewBlockExpiryDate time.Time                                                                       `json:"new_block_expiry_date,required" format:"date-time"`
	StartingBalance    float64                                                                         `json:"starting_balance,required"`
	JSON               customerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntry) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryCreditBlock added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryCreditBlock struct {
	ID               string                                                                                     `json:"id,required"`
	ExpiryDate       time.Time                                                                                  `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                                     `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryCreditBlock) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryCustomer added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryCustomer struct {
	ID                 string                                                                                  `json:"id,required"`
	ExternalCustomerID string                                                                                  `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryCustomer) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryEntryStatus added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryEntryStatusCommitted CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryEntryStatusPending   CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryEntryType added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryEntryType string
const (
	CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryEntryTypeExpirationChange CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryEntryType = "expiration_change"
)

func (CustomerCreditLedgerNewEntryByExternalIDResponseExpirationChangeLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntry added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntry struct {
	ID                   string                                                                          `json:"id,required"`
	Amount               float64                                                                         `json:"amount,required"`
	CreatedAt            time.Time                                                                       `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                          `json:"currency,required"`
	Customer             CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                          `json:"description,required,nullable"`
	EndingBalance        float64                                                                         `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                           `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                                        `json:"metadata,required"`
	StartingBalance float64                                                                  `json:"starting_balance,required"`
	JSON            customerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntry) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryCreditBlock added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryCreditBlock struct {
	ID               string                                                                              `json:"id,required"`
	ExpiryDate       time.Time                                                                           `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                              `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryCreditBlock) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryCustomer added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryCustomer struct {
	ID                 string                                                                           `json:"id,required"`
	ExternalCustomerID string                                                                           `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryCustomer) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryEntryStatus added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryEntryStatusCommitted CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryEntryStatusPending   CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryEntryType added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryEntryType string
const (
	CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryEntryTypeIncrement CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryEntryType = "increment"
)

func (CustomerCreditLedgerNewEntryByExternalIDResponseIncrementLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntry added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntry struct {
	ID                   string                                                                              `json:"id,required"`
	Amount               float64                                                                             `json:"amount,required"`
	CreatedAt            time.Time                                                                           `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                              `json:"currency,required"`
	Customer             CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                              `json:"description,required,nullable"`
	EndingBalance        float64                                                                             `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                               `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata           map[string]string                                                            `json:"metadata,required"`
	NewBlockExpiryDate time.Time                                                                    `json:"new_block_expiry_date,required" format:"date-time"`
	StartingBalance    float64                                                                      `json:"starting_balance,required"`
	VoidAmount         float64                                                                      `json:"void_amount,required"`
	VoidReason         string                                                                       `json:"void_reason,required,nullable"`
	JSON               customerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntry) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryCreditBlock added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryCreditBlock struct {
	ID               string                                                                                  `json:"id,required"`
	ExpiryDate       time.Time                                                                               `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                                  `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryCreditBlock) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryCustomer added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryCustomer struct {
	ID                 string                                                                               `json:"id,required"`
	ExternalCustomerID string                                                                               `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryCustomer) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryEntryStatus added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryEntryStatusCommitted CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryEntryStatusPending   CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryEntryType added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryEntryType string
const (
	CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryEntryTypeVoidInitiated CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryEntryType = "void_initiated"
)

func (CustomerCreditLedgerNewEntryByExternalIDResponseVoidInitiatedLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntry added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntry struct {
	ID                   string                                                                     `json:"id,required"`
	Amount               float64                                                                    `json:"amount,required"`
	CreatedAt            time.Time                                                                  `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                     `json:"currency,required"`
	Customer             CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                     `json:"description,required,nullable"`
	EndingBalance        float64                                                                    `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                      `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                                   `json:"metadata,required"`
	StartingBalance float64                                                             `json:"starting_balance,required"`
	VoidAmount      float64                                                             `json:"void_amount,required"`
	VoidReason      string                                                              `json:"void_reason,required,nullable"`
	JSON            customerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntry) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryCreditBlock added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryCreditBlock struct {
	ID               string                                                                         `json:"id,required"`
	ExpiryDate       time.Time                                                                      `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                         `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryCreditBlock) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryCustomer added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryCustomer struct {
	ID                 string                                                                      `json:"id,required"`
	ExternalCustomerID string                                                                      `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryCustomer) UnmarshalJSON added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryEntryStatus added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryEntryStatusCommitted CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryEntryStatusPending   CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryEntryType added in v0.2.1

type CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryEntryType string
const (
	CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryEntryTypeVoid CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryEntryType = "void"
)

func (CustomerCreditLedgerNewEntryByExternalIDResponseVoidLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryParamsAddAmendmentCreditLedgerEntryRequestParams

type CustomerCreditLedgerNewEntryParamsAddAmendmentCreditLedgerEntryRequestParams struct {
	// The number of credits to effect. Note that this is required for increment,
	// decrement or void operations.
	Amount param.Field[float64] `json:"amount,required"`
	// The ID of the block to reverse a decrement from.
	BlockID   param.Field[string]                                                                                `json:"block_id,required"`
	EntryType param.Field[CustomerCreditLedgerNewEntryParamsAddAmendmentCreditLedgerEntryRequestParamsEntryType] `json:"entry_type,required"`
	// The currency or custom pricing unit to use for this ledger entry. If this is a
	// real-world currency, it must match the customer's invoicing currency.
	Currency param.Field[string] `json:"currency"`
	// Optional metadata that can be specified when adding ledger results via the API.
	// For example, this can be used to note an increment refers to trial credits, or
	// for noting corrections as a result of an incident, etc.
	Description param.Field[string] `json:"description"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (CustomerCreditLedgerNewEntryParamsAddAmendmentCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryParams

func (CustomerCreditLedgerNewEntryParamsAddAmendmentCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryParams()

func (CustomerCreditLedgerNewEntryParamsAddAmendmentCreditLedgerEntryRequestParams) MarshalJSON

type CustomerCreditLedgerNewEntryParamsAddAmendmentCreditLedgerEntryRequestParamsEntryType

type CustomerCreditLedgerNewEntryParamsAddAmendmentCreditLedgerEntryRequestParamsEntryType string
const (
	CustomerCreditLedgerNewEntryParamsAddAmendmentCreditLedgerEntryRequestParamsEntryTypeAmendment CustomerCreditLedgerNewEntryParamsAddAmendmentCreditLedgerEntryRequestParamsEntryType = "amendment"
)

func (CustomerCreditLedgerNewEntryParamsAddAmendmentCreditLedgerEntryRequestParamsEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryParamsAddDecrementCreditLedgerEntryRequestParams

type CustomerCreditLedgerNewEntryParamsAddDecrementCreditLedgerEntryRequestParams struct {
	// The number of credits to effect. Note that this is required for increment,
	// decrement, void, or undo operations.
	Amount    param.Field[float64]                                                                               `json:"amount,required"`
	EntryType param.Field[CustomerCreditLedgerNewEntryParamsAddDecrementCreditLedgerEntryRequestParamsEntryType] `json:"entry_type,required"`
	// The currency or custom pricing unit to use for this ledger entry. If this is a
	// real-world currency, it must match the customer's invoicing currency.
	Currency param.Field[string] `json:"currency"`
	// Optional metadata that can be specified when adding ledger results via the API.
	// For example, this can be used to note an increment refers to trial credits, or
	// for noting corrections as a result of an incident, etc.
	Description param.Field[string] `json:"description"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (CustomerCreditLedgerNewEntryParamsAddDecrementCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryParams

func (CustomerCreditLedgerNewEntryParamsAddDecrementCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryParams()

func (CustomerCreditLedgerNewEntryParamsAddDecrementCreditLedgerEntryRequestParams) MarshalJSON

type CustomerCreditLedgerNewEntryParamsAddDecrementCreditLedgerEntryRequestParamsEntryType

type CustomerCreditLedgerNewEntryParamsAddDecrementCreditLedgerEntryRequestParamsEntryType string
const (
	CustomerCreditLedgerNewEntryParamsAddDecrementCreditLedgerEntryRequestParamsEntryTypeDecrement CustomerCreditLedgerNewEntryParamsAddDecrementCreditLedgerEntryRequestParamsEntryType = "decrement"
)

func (CustomerCreditLedgerNewEntryParamsAddDecrementCreditLedgerEntryRequestParamsEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryParamsAddExpirationChangeCreditLedgerEntryRequestParams

type CustomerCreditLedgerNewEntryParamsAddExpirationChangeCreditLedgerEntryRequestParams struct {
	EntryType param.Field[CustomerCreditLedgerNewEntryParamsAddExpirationChangeCreditLedgerEntryRequestParamsEntryType] `json:"entry_type,required"`
	// An ISO 8601 format date that identifies the origination credit block to expire
	ExpiryDate param.Field[time.Time] `json:"expiry_date,required" format:"date-time"`
	// A future date (specified in YYYY-MM-DD format) used for expiration change,
	// denoting when credits transferred (as part of a partial block expiration) should
	// expire.
	TargetExpiryDate param.Field[time.Time] `json:"target_expiry_date,required" format:"date"`
	// The number of credits to effect. Note that this is required for increment,
	// decrement, void, or undo operations.
	Amount param.Field[float64] `json:"amount"`
	// The ID of the block affected by an expiration_change, used to differentiate
	// between multiple blocks with the same `expiry_date`.
	BlockID param.Field[string] `json:"block_id"`
	// The currency or custom pricing unit to use for this ledger entry. If this is a
	// real-world currency, it must match the customer's invoicing currency.
	Currency param.Field[string] `json:"currency"`
	// Optional metadata that can be specified when adding ledger results via the API.
	// For example, this can be used to note an increment refers to trial credits, or
	// for noting corrections as a result of an incident, etc.
	Description param.Field[string] `json:"description"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (CustomerCreditLedgerNewEntryParamsAddExpirationChangeCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryParams

func (CustomerCreditLedgerNewEntryParamsAddExpirationChangeCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryParams()

func (CustomerCreditLedgerNewEntryParamsAddExpirationChangeCreditLedgerEntryRequestParams) MarshalJSON

type CustomerCreditLedgerNewEntryParamsAddExpirationChangeCreditLedgerEntryRequestParamsEntryType

type CustomerCreditLedgerNewEntryParamsAddExpirationChangeCreditLedgerEntryRequestParamsEntryType string
const (
	CustomerCreditLedgerNewEntryParamsAddExpirationChangeCreditLedgerEntryRequestParamsEntryTypeExpirationChange CustomerCreditLedgerNewEntryParamsAddExpirationChangeCreditLedgerEntryRequestParamsEntryType = "expiration_change"
)

func (CustomerCreditLedgerNewEntryParamsAddExpirationChangeCreditLedgerEntryRequestParamsEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryParamsAddIncrementCreditLedgerEntryRequestParams

type CustomerCreditLedgerNewEntryParamsAddIncrementCreditLedgerEntryRequestParams struct {
	// The number of credits to effect. Note that this is required for increment,
	// decrement, void, or undo operations.
	Amount    param.Field[float64]                                                                               `json:"amount,required"`
	EntryType param.Field[CustomerCreditLedgerNewEntryParamsAddIncrementCreditLedgerEntryRequestParamsEntryType] `json:"entry_type,required"`
	// The currency or custom pricing unit to use for this ledger entry. If this is a
	// real-world currency, it must match the customer's invoicing currency.
	Currency param.Field[string] `json:"currency"`
	// Optional metadata that can be specified when adding ledger results via the API.
	// For example, this can be used to note an increment refers to trial credits, or
	// for noting corrections as a result of an incident, etc.
	Description param.Field[string] `json:"description"`
	// An ISO 8601 format date that denotes when this credit balance should become
	// available for use.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date-time"`
	// An ISO 8601 format date that denotes when this credit balance should expire.
	ExpiryDate param.Field[time.Time] `json:"expiry_date" format:"date-time"`
	// Passing `invoice_settings` automatically generates an invoice for the newly
	// added credits. If `invoice_settings` is passed, you must specify
	// per_unit_cost_basis, as the calculation of the invoice total is done on that
	// basis.
	InvoiceSettings param.Field[CustomerCreditLedgerNewEntryParamsAddIncrementCreditLedgerEntryRequestParamsInvoiceSettings] `json:"invoice_settings"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// Can only be specified when entry_type=increment. How much, in USD, a customer
	// paid for a single credit in this block
	PerUnitCostBasis param.Field[string] `json:"per_unit_cost_basis"`
}

func (CustomerCreditLedgerNewEntryParamsAddIncrementCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryParams

func (CustomerCreditLedgerNewEntryParamsAddIncrementCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryParams()

func (CustomerCreditLedgerNewEntryParamsAddIncrementCreditLedgerEntryRequestParams) MarshalJSON

type CustomerCreditLedgerNewEntryParamsAddIncrementCreditLedgerEntryRequestParamsEntryType

type CustomerCreditLedgerNewEntryParamsAddIncrementCreditLedgerEntryRequestParamsEntryType string
const (
	CustomerCreditLedgerNewEntryParamsAddIncrementCreditLedgerEntryRequestParamsEntryTypeIncrement CustomerCreditLedgerNewEntryParamsAddIncrementCreditLedgerEntryRequestParamsEntryType = "increment"
)

func (CustomerCreditLedgerNewEntryParamsAddIncrementCreditLedgerEntryRequestParamsEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryParamsAddIncrementCreditLedgerEntryRequestParamsInvoiceSettings

type CustomerCreditLedgerNewEntryParamsAddIncrementCreditLedgerEntryRequestParamsInvoiceSettings struct {
	// Whether the credits purchase invoice should auto collect with the customer's
	// saved payment method.
	AutoCollection param.Field[bool] `json:"auto_collection,required"`
	// The net terms determines the difference between the invoice date and the issue
	// date for the invoice. If you intend the invoice to be due on issue, set this
	// to 0.
	NetTerms param.Field[int64] `json:"net_terms,required"`
	// An optional memo to display on the invoice.
	Memo param.Field[string] `json:"memo"`
}

Passing `invoice_settings` automatically generates an invoice for the newly added credits. If `invoice_settings` is passed, you must specify per_unit_cost_basis, as the calculation of the invoice total is done on that basis.

func (CustomerCreditLedgerNewEntryParamsAddIncrementCreditLedgerEntryRequestParamsInvoiceSettings) MarshalJSON

type CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParams

type CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParams struct {
	// The number of credits to effect. Note that this is required for increment,
	// decrement, void, or undo operations.
	Amount param.Field[float64] `json:"amount,required"`
	// The ID of the block to void.
	BlockID   param.Field[string]                                                                           `json:"block_id,required"`
	EntryType param.Field[CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParamsEntryType] `json:"entry_type,required"`
	// The currency or custom pricing unit to use for this ledger entry. If this is a
	// real-world currency, it must match the customer's invoicing currency.
	Currency param.Field[string] `json:"currency"`
	// Optional metadata that can be specified when adding ledger results via the API.
	// For example, this can be used to note an increment refers to trial credits, or
	// for noting corrections as a result of an incident, etc.
	Description param.Field[string] `json:"description"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// Can only be specified when `entry_type=void`. The reason for the void.
	VoidReason param.Field[CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParamsVoidReason] `json:"void_reason"`
}

func (CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryParams

func (CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParams) ImplementsCustomerCreditLedgerNewEntryParams()

func (CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParams) MarshalJSON

type CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParamsEntryType

type CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParamsEntryType string
const (
	CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParamsEntryTypeVoid CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParamsEntryType = "void"
)

func (CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParamsEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParamsVoidReason

type CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParamsVoidReason string

Can only be specified when `entry_type=void`. The reason for the void.

const (
	CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParamsVoidReasonRefund CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParamsVoidReason = "refund"
)

func (CustomerCreditLedgerNewEntryParamsAddVoidCreditLedgerEntryRequestParamsVoidReason) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntry

type CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntry struct {
	ID                   string                                                              `json:"id,required"`
	Amount               float64                                                             `json:"amount,required"`
	CreatedAt            time.Time                                                           `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                              `json:"currency,required"`
	Customer             CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                              `json:"description,required,nullable"`
	EndingBalance        float64                                                             `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                               `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                            `json:"metadata,required"`
	StartingBalance float64                                                      `json:"starting_balance,required"`
	JSON            customerCreditLedgerNewEntryResponseAmendmentLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntry) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryCreditBlock

type CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryCreditBlock struct {
	ID               string                                                                  `json:"id,required"`
	ExpiryDate       time.Time                                                               `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                  `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerNewEntryResponseAmendmentLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryCustomer

type CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryCustomer struct {
	ID                 string                                                               `json:"id,required"`
	ExternalCustomerID string                                                               `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerNewEntryResponseAmendmentLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryEntryStatus

type CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryEntryStatusCommitted CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryEntryStatusPending   CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryEntryType

type CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryEntryType string
const (
	CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryEntryTypeAmendment CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryEntryType = "amendment"
)

func (CustomerCreditLedgerNewEntryResponseAmendmentLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntry

type CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntry struct {
	ID                   string                                                                      `json:"id,required"`
	Amount               float64                                                                     `json:"amount,required"`
	CreatedAt            time.Time                                                                   `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                      `json:"currency,required"`
	Customer             CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                      `json:"description,required,nullable"`
	EndingBalance        float64                                                                     `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                       `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                                    `json:"metadata,required"`
	StartingBalance float64                                                              `json:"starting_balance,required"`
	JSON            customerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntry) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryCreditBlock

type CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryCreditBlock struct {
	ID               string                                                                          `json:"id,required"`
	ExpiryDate       time.Time                                                                       `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                          `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryCustomer

type CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryCustomer struct {
	ID                 string                                                                       `json:"id,required"`
	ExternalCustomerID string                                                                       `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryEntryStatus

type CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryEntryStatusCommitted CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryEntryStatusPending   CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryEntryType

type CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryEntryType string
const (
	CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryEntryTypeCreditBlockExpiry CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryEntryType = "credit_block_expiry"
)

func (CustomerCreditLedgerNewEntryResponseCreditBlockExpiryLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryResponseDecrementLedgerEntry

type CustomerCreditLedgerNewEntryResponseDecrementLedgerEntry struct {
	ID                   string                                                              `json:"id,required"`
	Amount               float64                                                             `json:"amount,required"`
	CreatedAt            time.Time                                                           `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                              `json:"currency,required"`
	Customer             CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                              `json:"description,required,nullable"`
	EndingBalance        float64                                                             `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                               `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                            `json:"metadata,required"`
	StartingBalance float64                                                      `json:"starting_balance,required"`
	EventID         string                                                       `json:"event_id,nullable"`
	InvoiceID       string                                                       `json:"invoice_id,nullable"`
	PriceID         string                                                       `json:"price_id,nullable"`
	JSON            customerCreditLedgerNewEntryResponseDecrementLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseDecrementLedgerEntry) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryCreditBlock

type CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryCreditBlock struct {
	ID               string                                                                  `json:"id,required"`
	ExpiryDate       time.Time                                                               `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                  `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerNewEntryResponseDecrementLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryCustomer

type CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryCustomer struct {
	ID                 string                                                               `json:"id,required"`
	ExternalCustomerID string                                                               `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerNewEntryResponseDecrementLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryEntryStatus

type CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryEntryStatusCommitted CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryEntryStatusPending   CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryEntryType

type CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryEntryType string
const (
	CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryEntryTypeDecrement CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryEntryType = "decrement"
)

func (CustomerCreditLedgerNewEntryResponseDecrementLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntry

type CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntry struct {
	ID                   string                                                                     `json:"id,required"`
	Amount               float64                                                                    `json:"amount,required"`
	CreatedAt            time.Time                                                                  `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                     `json:"currency,required"`
	Customer             CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                     `json:"description,required,nullable"`
	EndingBalance        float64                                                                    `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                      `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata           map[string]string                                                   `json:"metadata,required"`
	NewBlockExpiryDate time.Time                                                           `json:"new_block_expiry_date,required" format:"date-time"`
	StartingBalance    float64                                                             `json:"starting_balance,required"`
	JSON               customerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntry) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryCreditBlock

type CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryCreditBlock struct {
	ID               string                                                                         `json:"id,required"`
	ExpiryDate       time.Time                                                                      `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                         `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryCustomer

type CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryCustomer struct {
	ID                 string                                                                      `json:"id,required"`
	ExternalCustomerID string                                                                      `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryEntryStatus

type CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryEntryStatusCommitted CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryEntryStatusPending   CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryEntryType

type CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryEntryType string
const (
	CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryEntryTypeExpirationChange CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryEntryType = "expiration_change"
)

func (CustomerCreditLedgerNewEntryResponseExpirationChangeLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryResponseIncrementLedgerEntry

type CustomerCreditLedgerNewEntryResponseIncrementLedgerEntry struct {
	ID                   string                                                              `json:"id,required"`
	Amount               float64                                                             `json:"amount,required"`
	CreatedAt            time.Time                                                           `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                              `json:"currency,required"`
	Customer             CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                              `json:"description,required,nullable"`
	EndingBalance        float64                                                             `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                               `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                            `json:"metadata,required"`
	StartingBalance float64                                                      `json:"starting_balance,required"`
	JSON            customerCreditLedgerNewEntryResponseIncrementLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseIncrementLedgerEntry) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryCreditBlock

type CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryCreditBlock struct {
	ID               string                                                                  `json:"id,required"`
	ExpiryDate       time.Time                                                               `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                  `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerNewEntryResponseIncrementLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryCustomer

type CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryCustomer struct {
	ID                 string                                                               `json:"id,required"`
	ExternalCustomerID string                                                               `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerNewEntryResponseIncrementLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryEntryStatus

type CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryEntryStatusCommitted CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryEntryStatusPending   CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryEntryType

type CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryEntryType string
const (
	CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryEntryTypeIncrement CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryEntryType = "increment"
)

func (CustomerCreditLedgerNewEntryResponseIncrementLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntry

type CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntry struct {
	ID                   string                                                                  `json:"id,required"`
	Amount               float64                                                                 `json:"amount,required"`
	CreatedAt            time.Time                                                               `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                                  `json:"currency,required"`
	Customer             CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                                  `json:"description,required,nullable"`
	EndingBalance        float64                                                                 `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                                   `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata           map[string]string                                                `json:"metadata,required"`
	NewBlockExpiryDate time.Time                                                        `json:"new_block_expiry_date,required" format:"date-time"`
	StartingBalance    float64                                                          `json:"starting_balance,required"`
	VoidAmount         float64                                                          `json:"void_amount,required"`
	VoidReason         string                                                           `json:"void_reason,required,nullable"`
	JSON               customerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntry) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryCreditBlock

type CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryCreditBlock struct {
	ID               string                                                                      `json:"id,required"`
	ExpiryDate       time.Time                                                                   `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                                      `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryCustomer

type CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryCustomer struct {
	ID                 string                                                                   `json:"id,required"`
	ExternalCustomerID string                                                                   `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryEntryStatus

type CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryEntryStatusCommitted CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryEntryStatusPending   CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryEntryType

type CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryEntryType string
const (
	CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryEntryTypeVoidInitiated CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryEntryType = "void_initiated"
)

func (CustomerCreditLedgerNewEntryResponseVoidInitiatedLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryResponseVoidLedgerEntry

type CustomerCreditLedgerNewEntryResponseVoidLedgerEntry struct {
	ID                   string                                                         `json:"id,required"`
	Amount               float64                                                        `json:"amount,required"`
	CreatedAt            time.Time                                                      `json:"created_at,required" format:"date-time"`
	CreditBlock          CustomerCreditLedgerNewEntryResponseVoidLedgerEntryCreditBlock `json:"credit_block,required"`
	Currency             string                                                         `json:"currency,required"`
	Customer             CustomerCreditLedgerNewEntryResponseVoidLedgerEntryCustomer    `json:"customer,required"`
	Description          string                                                         `json:"description,required,nullable"`
	EndingBalance        float64                                                        `json:"ending_balance,required"`
	EntryStatus          CustomerCreditLedgerNewEntryResponseVoidLedgerEntryEntryStatus `json:"entry_status,required"`
	EntryType            CustomerCreditLedgerNewEntryResponseVoidLedgerEntryEntryType   `json:"entry_type,required"`
	LedgerSequenceNumber int64                                                          `json:"ledger_sequence_number,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata        map[string]string                                       `json:"metadata,required"`
	StartingBalance float64                                                 `json:"starting_balance,required"`
	VoidAmount      float64                                                 `json:"void_amount,required"`
	VoidReason      string                                                  `json:"void_reason,required,nullable"`
	JSON            customerCreditLedgerNewEntryResponseVoidLedgerEntryJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseVoidLedgerEntry) UnmarshalJSON

func (r *CustomerCreditLedgerNewEntryResponseVoidLedgerEntry) UnmarshalJSON(data []byte) (err error)

type CustomerCreditLedgerNewEntryResponseVoidLedgerEntryCreditBlock

type CustomerCreditLedgerNewEntryResponseVoidLedgerEntryCreditBlock struct {
	ID               string                                                             `json:"id,required"`
	ExpiryDate       time.Time                                                          `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                                             `json:"per_unit_cost_basis,required,nullable"`
	JSON             customerCreditLedgerNewEntryResponseVoidLedgerEntryCreditBlockJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseVoidLedgerEntryCreditBlock) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseVoidLedgerEntryCustomer

type CustomerCreditLedgerNewEntryResponseVoidLedgerEntryCustomer struct {
	ID                 string                                                          `json:"id,required"`
	ExternalCustomerID string                                                          `json:"external_customer_id,required,nullable"`
	JSON               customerCreditLedgerNewEntryResponseVoidLedgerEntryCustomerJSON `json:"-"`
}

func (*CustomerCreditLedgerNewEntryResponseVoidLedgerEntryCustomer) UnmarshalJSON

type CustomerCreditLedgerNewEntryResponseVoidLedgerEntryEntryStatus

type CustomerCreditLedgerNewEntryResponseVoidLedgerEntryEntryStatus string
const (
	CustomerCreditLedgerNewEntryResponseVoidLedgerEntryEntryStatusCommitted CustomerCreditLedgerNewEntryResponseVoidLedgerEntryEntryStatus = "committed"
	CustomerCreditLedgerNewEntryResponseVoidLedgerEntryEntryStatusPending   CustomerCreditLedgerNewEntryResponseVoidLedgerEntryEntryStatus = "pending"
)

func (CustomerCreditLedgerNewEntryResponseVoidLedgerEntryEntryStatus) IsKnown added in v0.24.0

type CustomerCreditLedgerNewEntryResponseVoidLedgerEntryEntryType

type CustomerCreditLedgerNewEntryResponseVoidLedgerEntryEntryType string
const (
	CustomerCreditLedgerNewEntryResponseVoidLedgerEntryEntryTypeVoid CustomerCreditLedgerNewEntryResponseVoidLedgerEntryEntryType = "void"
)

func (CustomerCreditLedgerNewEntryResponseVoidLedgerEntryEntryType) IsKnown added in v0.24.0

type CustomerCreditLedgerService

type CustomerCreditLedgerService struct {
	Options []option.RequestOption
}

CustomerCreditLedgerService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCustomerCreditLedgerService method instead.

func NewCustomerCreditLedgerService

func NewCustomerCreditLedgerService(opts ...option.RequestOption) (r *CustomerCreditLedgerService)

NewCustomerCreditLedgerService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CustomerCreditLedgerService) List

The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have taken place to modify a customer's credit balance. This [paginated endpoint](../reference/pagination) lists these entries, starting from the most recent ledger entry.

More details on using Orb's real-time credit feature are [here](../guides/product-catalog/prepurchase.md).

There are four major types of modifications to credit balance, detailed below.

## Increment

Credits (which optionally expire on a future date) can be added via the API ([Add Ledger Entry](create-ledger-entry)). The ledger entry for such an action will always contain the total eligible starting and ending balance for the customer at the time the entry was added to the ledger.

## Decrement

Deductions can occur as a result of an API call to create a ledger entry (see [Add Ledger Entry](create-ledger-entry)), or automatically as a result of incurring usage. Both ledger entries present the `decrement` entry type.

As usage for a customer is reported into Orb, credits may be deducted according to the customer's plan configuration. An automated deduction of this type will result in a ledger entry, also with a starting and ending balance. In order to provide better tracing capabilities for automatic deductions, Orb always associates each automatic deduction with the `event_id` at the time of ingestion, used to pinpoint _why_ credit deduction took place and to ensure that credits are never deducted without an associated usage event.

By default, Orb uses an algorithm that automatically deducts from the _soonest expiring credit block_ first in order to ensure that all credits are utilized appropriately. As an example, if trial credits with an expiration date of 2 weeks from now are present for a customer, they will be used before any deductions take place from a non-expiring credit block.

If there are multiple blocks with the same expiration date, Orb will deduct from the block with the _lower cost basis_ first (e.g. trial credits with a $0 cost basis before paid credits with a $5.00 cost basis).

It's also possible for a single usage event's deduction to _span_ credit blocks. In this case, Orb will deduct from the next block, ending at the credit block which consists of unexpiring credits. Each of these deductions will lead to a _separate_ ledger entry, one per credit block that is deducted from. By default, the customer's total credit balance in Orb can be negative as a result of a decrement.

## Expiration change

The expiry of credits can be changed as a result of the API (See [Add Ledger Entry](create-ledger-entry)). This will create a ledger entry that specifies the balance as well as the initial and target expiry dates.

Note that for this entry type, `starting_balance` will equal `ending_balance`, and the `amount` represents the balance transferred. The credit block linked to the ledger entry is the source credit block from which there was an expiration change

## Credits expiry

When a set of credits expire on pre-set expiration date, the customer's balance automatically reflects this change and adds an entry to the ledger indicating this event. Note that credit expiry should always happen close to a date boundary in the customer's timezone.

## Void initiated

Credit blocks can be voided via the API. The `amount` on this entry corresponds to the number of credits that were remaining in the block at time of void. `void_reason` will be populated if the void is created with a reason.

## Void

When a set of credits is voided, the customer's balance automatically reflects this change and adds an entry to the ledger indicating this event.

## Amendment

When credits are added to a customer's balance as a result of a correction, this entry will be added to the ledger to indicate the adjustment of credits.

func (*CustomerCreditLedgerService) ListAutoPaging

The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have taken place to modify a customer's credit balance. This [paginated endpoint](../reference/pagination) lists these entries, starting from the most recent ledger entry.

More details on using Orb's real-time credit feature are [here](../guides/product-catalog/prepurchase.md).

There are four major types of modifications to credit balance, detailed below.

## Increment

Credits (which optionally expire on a future date) can be added via the API ([Add Ledger Entry](create-ledger-entry)). The ledger entry for such an action will always contain the total eligible starting and ending balance for the customer at the time the entry was added to the ledger.

## Decrement

Deductions can occur as a result of an API call to create a ledger entry (see [Add Ledger Entry](create-ledger-entry)), or automatically as a result of incurring usage. Both ledger entries present the `decrement` entry type.

As usage for a customer is reported into Orb, credits may be deducted according to the customer's plan configuration. An automated deduction of this type will result in a ledger entry, also with a starting and ending balance. In order to provide better tracing capabilities for automatic deductions, Orb always associates each automatic deduction with the `event_id` at the time of ingestion, used to pinpoint _why_ credit deduction took place and to ensure that credits are never deducted without an associated usage event.

By default, Orb uses an algorithm that automatically deducts from the _soonest expiring credit block_ first in order to ensure that all credits are utilized appropriately. As an example, if trial credits with an expiration date of 2 weeks from now are present for a customer, they will be used before any deductions take place from a non-expiring credit block.

If there are multiple blocks with the same expiration date, Orb will deduct from the block with the _lower cost basis_ first (e.g. trial credits with a $0 cost basis before paid credits with a $5.00 cost basis).

It's also possible for a single usage event's deduction to _span_ credit blocks. In this case, Orb will deduct from the next block, ending at the credit block which consists of unexpiring credits. Each of these deductions will lead to a _separate_ ledger entry, one per credit block that is deducted from. By default, the customer's total credit balance in Orb can be negative as a result of a decrement.

## Expiration change

The expiry of credits can be changed as a result of the API (See [Add Ledger Entry](create-ledger-entry)). This will create a ledger entry that specifies the balance as well as the initial and target expiry dates.

Note that for this entry type, `starting_balance` will equal `ending_balance`, and the `amount` represents the balance transferred. The credit block linked to the ledger entry is the source credit block from which there was an expiration change

## Credits expiry

When a set of credits expire on pre-set expiration date, the customer's balance automatically reflects this change and adds an entry to the ledger indicating this event. Note that credit expiry should always happen close to a date boundary in the customer's timezone.

## Void initiated

Credit blocks can be voided via the API. The `amount` on this entry corresponds to the number of credits that were remaining in the block at time of void. `void_reason` will be populated if the void is created with a reason.

## Void

When a set of credits is voided, the customer's balance automatically reflects this change and adds an entry to the ledger indicating this event.

## Amendment

When credits are added to a customer's balance as a result of a correction, this entry will be added to the ledger to indicate the adjustment of credits.

func (*CustomerCreditLedgerService) ListByExternalID

The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have taken place to modify a customer's credit balance. This [paginated endpoint](../reference/pagination) lists these entries, starting from the most recent ledger entry.

More details on using Orb's real-time credit feature are [here](../guides/product-catalog/prepurchase.md).

There are four major types of modifications to credit balance, detailed below.

## Increment

Credits (which optionally expire on a future date) can be added via the API ([Add Ledger Entry](create-ledger-entry)). The ledger entry for such an action will always contain the total eligible starting and ending balance for the customer at the time the entry was added to the ledger.

## Decrement

Deductions can occur as a result of an API call to create a ledger entry (see [Add Ledger Entry](create-ledger-entry)), or automatically as a result of incurring usage. Both ledger entries present the `decrement` entry type.

As usage for a customer is reported into Orb, credits may be deducted according to the customer's plan configuration. An automated deduction of this type will result in a ledger entry, also with a starting and ending balance. In order to provide better tracing capabilities for automatic deductions, Orb always associates each automatic deduction with the `event_id` at the time of ingestion, used to pinpoint _why_ credit deduction took place and to ensure that credits are never deducted without an associated usage event.

By default, Orb uses an algorithm that automatically deducts from the _soonest expiring credit block_ first in order to ensure that all credits are utilized appropriately. As an example, if trial credits with an expiration date of 2 weeks from now are present for a customer, they will be used before any deductions take place from a non-expiring credit block.

If there are multiple blocks with the same expiration date, Orb will deduct from the block with the _lower cost basis_ first (e.g. trial credits with a $0 cost basis before paid credits with a $5.00 cost basis).

It's also possible for a single usage event's deduction to _span_ credit blocks. In this case, Orb will deduct from the next block, ending at the credit block which consists of unexpiring credits. Each of these deductions will lead to a _separate_ ledger entry, one per credit block that is deducted from. By default, the customer's total credit balance in Orb can be negative as a result of a decrement.

## Expiration change

The expiry of credits can be changed as a result of the API (See [Add Ledger Entry](create-ledger-entry)). This will create a ledger entry that specifies the balance as well as the initial and target expiry dates.

Note that for this entry type, `starting_balance` will equal `ending_balance`, and the `amount` represents the balance transferred. The credit block linked to the ledger entry is the source credit block from which there was an expiration change

## Credits expiry

When a set of credits expire on pre-set expiration date, the customer's balance automatically reflects this change and adds an entry to the ledger indicating this event. Note that credit expiry should always happen close to a date boundary in the customer's timezone.

## Void initiated

Credit blocks can be voided via the API. The `amount` on this entry corresponds to the number of credits that were remaining in the block at time of void. `void_reason` will be populated if the void is created with a reason.

## Void

When a set of credits is voided, the customer's balance automatically reflects this change and adds an entry to the ledger indicating this event.

## Amendment

When credits are added to a customer's balance as a result of a correction, this entry will be added to the ledger to indicate the adjustment of credits.

func (*CustomerCreditLedgerService) ListByExternalIDAutoPaging

The credits ledger provides _auditing_ functionality over Orb's credits system with a list of actions that have taken place to modify a customer's credit balance. This [paginated endpoint](../reference/pagination) lists these entries, starting from the most recent ledger entry.

More details on using Orb's real-time credit feature are [here](../guides/product-catalog/prepurchase.md).

There are four major types of modifications to credit balance, detailed below.

## Increment

Credits (which optionally expire on a future date) can be added via the API ([Add Ledger Entry](create-ledger-entry)). The ledger entry for such an action will always contain the total eligible starting and ending balance for the customer at the time the entry was added to the ledger.

## Decrement

Deductions can occur as a result of an API call to create a ledger entry (see [Add Ledger Entry](create-ledger-entry)), or automatically as a result of incurring usage. Both ledger entries present the `decrement` entry type.

As usage for a customer is reported into Orb, credits may be deducted according to the customer's plan configuration. An automated deduction of this type will result in a ledger entry, also with a starting and ending balance. In order to provide better tracing capabilities for automatic deductions, Orb always associates each automatic deduction with the `event_id` at the time of ingestion, used to pinpoint _why_ credit deduction took place and to ensure that credits are never deducted without an associated usage event.

By default, Orb uses an algorithm that automatically deducts from the _soonest expiring credit block_ first in order to ensure that all credits are utilized appropriately. As an example, if trial credits with an expiration date of 2 weeks from now are present for a customer, they will be used before any deductions take place from a non-expiring credit block.

If there are multiple blocks with the same expiration date, Orb will deduct from the block with the _lower cost basis_ first (e.g. trial credits with a $0 cost basis before paid credits with a $5.00 cost basis).

It's also possible for a single usage event's deduction to _span_ credit blocks. In this case, Orb will deduct from the next block, ending at the credit block which consists of unexpiring credits. Each of these deductions will lead to a _separate_ ledger entry, one per credit block that is deducted from. By default, the customer's total credit balance in Orb can be negative as a result of a decrement.

## Expiration change

The expiry of credits can be changed as a result of the API (See [Add Ledger Entry](create-ledger-entry)). This will create a ledger entry that specifies the balance as well as the initial and target expiry dates.

Note that for this entry type, `starting_balance` will equal `ending_balance`, and the `amount` represents the balance transferred. The credit block linked to the ledger entry is the source credit block from which there was an expiration change

## Credits expiry

When a set of credits expire on pre-set expiration date, the customer's balance automatically reflects this change and adds an entry to the ledger indicating this event. Note that credit expiry should always happen close to a date boundary in the customer's timezone.

## Void initiated

Credit blocks can be voided via the API. The `amount` on this entry corresponds to the number of credits that were remaining in the block at time of void. `void_reason` will be populated if the void is created with a reason.

## Void

When a set of credits is voided, the customer's balance automatically reflects this change and adds an entry to the ledger indicating this event.

## Amendment

When credits are added to a customer's balance as a result of a correction, this entry will be added to the ledger to indicate the adjustment of credits.

func (*CustomerCreditLedgerService) NewEntry

This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the expiry date of existing credits.

## Effects of adding a ledger entry

  1. After calling this endpoint, [Fetch Credit Balance](fetch-customer-credits) will return a credit block that represents the changes (i.e. balance changes or transfers).
  2. A ledger entry will be added to the credits ledger for this customer, and therefore returned in the [View Credits Ledger](fetch-customer-credits) response as well as serialized in the response to this request. In the case of deductions without a specified block, multiple ledger entries may be created if the deduction spans credit blocks.
  3. If `invoice_settings` is specified, an invoice will be created that reflects the cost of the credits (based on `amount` and `per_unit_cost_basis`).

## Adding credits

Adding credits is done by creating an entry of type `increment`. This requires the caller to specify a number of credits as well as an optional expiry date in `YYYY-MM-DD` format. Orb also recommends specifying a description to assist with auditing. When adding credits, the caller can also specify a cost basis per-credit, to indicate how much in USD a customer paid for a single credit in a block. This can later be used for revenue recognition.

The following snippet illustrates a sample request body to increment credits which will expire in January of 2022.

```json

{
  "entry_type": "increment",
  "amount": 100,
  "expiry_date": "2022-12-28",
  "per_unit_cost_basis": "0.20",
  "description": "Purchased 100 credits"
}

```

Note that by default, Orb will always first increment any _negative_ balance in existing blocks before adding the remaining amount to the desired credit block.

### Invoicing for credits

By default, Orb manipulates the credit ledger but does not charge for credits. However, if you pass `invoice_settings` in the body of this request, Orb will also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of credit units added.

## Deducting Credits

Orb allows you to deduct credits from a customer by creating an entry of type `decrement`. Orb matches the algorithm for automatic deductions for determining which credit blocks to decrement from. In the case that the deduction leads to multiple ledger entries, the response from this endpoint will be the final deduction. Orb also optionally allows specifying a description to assist with auditing.

The following snippet illustrates a sample request body to decrement credits.

```json

{
  "entry_type": "decrement",
  "amount": 20,
  "description": "Removing excess credits"
}

```

## Changing credits expiry

If you'd like to change when existing credits expire, you should create a ledger entry of type `expiration_change`. For this entry, the required parameter `expiry_date` identifies the _originating_ block, and the required parameter `target_expiry_date` identifies when the transferred credits should now expire. A new credit block will be created with expiry date `target_expiry_date`, with the same cost basis data as the original credit block, if present.

Note that the balance of the block with the given `expiry_date` must be at least equal to the desired transfer amount determined by the `amount` parameter.

The following snippet illustrates a sample request body to extend the expiration date of credits by one year:

```json

{
  "entry_type": "expiration_change",
  "amount": 10,
  "expiry_date": "2022-12-28",
  "block_id": "UiUhFWeLHPrBY4Ad",
  "target_expiry_date": "2023-12-28",
  "description": "Extending credit validity"
}

```

## Voiding credits

If you'd like to void a credit block, create a ledger entry of type `void`. For this entry, `block_id` is required to identify the block, and `amount` indicates how many credits to void, up to the block's initial balance. Pass in a `void_reason` of `refund` if the void is due to a refund.

## Amendment

If you'd like to undo a decrement on a credit block, create a ledger entry of type `amendment`. For this entry, `block_id` is required to identify the block that was originally decremented from, and `amount` indicates how many credits to return to the customer, up to the block's initial balance.

func (*CustomerCreditLedgerService) NewEntryByExternalID added in v0.2.1

This endpoint allows you to create a new ledger entry for a specified customer's balance. This can be used to increment balance, deduct credits, and change the expiry date of existing credits.

## Effects of adding a ledger entry

  1. After calling this endpoint, [Fetch Credit Balance](fetch-customer-credits) will return a credit block that represents the changes (i.e. balance changes or transfers).
  2. A ledger entry will be added to the credits ledger for this customer, and therefore returned in the [View Credits Ledger](fetch-customer-credits) response as well as serialized in the response to this request. In the case of deductions without a specified block, multiple ledger entries may be created if the deduction spans credit blocks.
  3. If `invoice_settings` is specified, an invoice will be created that reflects the cost of the credits (based on `amount` and `per_unit_cost_basis`).

## Adding credits

Adding credits is done by creating an entry of type `increment`. This requires the caller to specify a number of credits as well as an optional expiry date in `YYYY-MM-DD` format. Orb also recommends specifying a description to assist with auditing. When adding credits, the caller can also specify a cost basis per-credit, to indicate how much in USD a customer paid for a single credit in a block. This can later be used for revenue recognition.

The following snippet illustrates a sample request body to increment credits which will expire in January of 2022.

```json

{
  "entry_type": "increment",
  "amount": 100,
  "expiry_date": "2022-12-28",
  "per_unit_cost_basis": "0.20",
  "description": "Purchased 100 credits"
}

```

Note that by default, Orb will always first increment any _negative_ balance in existing blocks before adding the remaining amount to the desired credit block.

### Invoicing for credits

By default, Orb manipulates the credit ledger but does not charge for credits. However, if you pass `invoice_settings` in the body of this request, Orb will also generate a one-off invoice for the customer for the credits pre-purchase. Note that you _must_ provide the `per_unit_cost_basis`, since the total charges on the invoice are calculated by multiplying the cost basis with the number of credit units added.

## Deducting Credits

Orb allows you to deduct credits from a customer by creating an entry of type `decrement`. Orb matches the algorithm for automatic deductions for determining which credit blocks to decrement from. In the case that the deduction leads to multiple ledger entries, the response from this endpoint will be the final deduction. Orb also optionally allows specifying a description to assist with auditing.

The following snippet illustrates a sample request body to decrement credits.

```json

{
  "entry_type": "decrement",
  "amount": 20,
  "description": "Removing excess credits"
}

```

## Changing credits expiry

If you'd like to change when existing credits expire, you should create a ledger entry of type `expiration_change`. For this entry, the required parameter `expiry_date` identifies the _originating_ block, and the required parameter `target_expiry_date` identifies when the transferred credits should now expire. A new credit block will be created with expiry date `target_expiry_date`, with the same cost basis data as the original credit block, if present.

Note that the balance of the block with the given `expiry_date` must be at least equal to the desired transfer amount determined by the `amount` parameter.

The following snippet illustrates a sample request body to extend the expiration date of credits by one year:

```json

{
  "entry_type": "expiration_change",
  "amount": 10,
  "expiry_date": "2022-12-28",
  "block_id": "UiUhFWeLHPrBY4Ad",
  "target_expiry_date": "2023-12-28",
  "description": "Extending credit validity"
}

```

## Voiding credits

If you'd like to void a credit block, create a ledger entry of type `void`. For this entry, `block_id` is required to identify the block, and `amount` indicates how many credits to void, up to the block's initial balance. Pass in a `void_reason` of `refund` if the void is due to a refund.

## Amendment

If you'd like to undo a decrement on a credit block, create a ledger entry of type `amendment`. For this entry, `block_id` is required to identify the block that was originally decremented from, and `amount` indicates how many credits to return to the customer, up to the block's initial balance.

type CustomerCreditListByExternalIDParams

type CustomerCreditListByExternalIDParams struct {
	// The ledger currency or custom pricing unit to use.
	Currency param.Field[string] `query:"currency"`
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor param.Field[string] `query:"cursor"`
	// The number of items to fetch. Defaults to 20.
	Limit param.Field[int64] `query:"limit"`
}

func (CustomerCreditListByExternalIDParams) URLQuery

URLQuery serializes CustomerCreditListByExternalIDParams's query parameters as `url.Values`.

type CustomerCreditListByExternalIDResponse

type CustomerCreditListByExternalIDResponse struct {
	ID               string                                       `json:"id,required"`
	Balance          float64                                      `json:"balance,required"`
	ExpiryDate       time.Time                                    `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                                       `json:"per_unit_cost_basis,required,nullable"`
	Status           CustomerCreditListByExternalIDResponseStatus `json:"status,required"`
	JSON             customerCreditListByExternalIDResponseJSON   `json:"-"`
}

func (*CustomerCreditListByExternalIDResponse) UnmarshalJSON

func (r *CustomerCreditListByExternalIDResponse) UnmarshalJSON(data []byte) (err error)

type CustomerCreditListByExternalIDResponseStatus added in v0.24.0

type CustomerCreditListByExternalIDResponseStatus string
const (
	CustomerCreditListByExternalIDResponseStatusActive         CustomerCreditListByExternalIDResponseStatus = "active"
	CustomerCreditListByExternalIDResponseStatusPendingPayment CustomerCreditListByExternalIDResponseStatus = "pending_payment"
)

func (CustomerCreditListByExternalIDResponseStatus) IsKnown added in v0.24.0

type CustomerCreditListParams

type CustomerCreditListParams struct {
	// The ledger currency or custom pricing unit to use.
	Currency param.Field[string] `query:"currency"`
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor param.Field[string] `query:"cursor"`
	// The number of items to fetch. Defaults to 20.
	Limit param.Field[int64] `query:"limit"`
}

func (CustomerCreditListParams) URLQuery

func (r CustomerCreditListParams) URLQuery() (v url.Values)

URLQuery serializes CustomerCreditListParams's query parameters as `url.Values`.

type CustomerCreditListResponse

type CustomerCreditListResponse struct {
	ID               string                           `json:"id,required"`
	Balance          float64                          `json:"balance,required"`
	ExpiryDate       time.Time                        `json:"expiry_date,required,nullable" format:"date-time"`
	PerUnitCostBasis string                           `json:"per_unit_cost_basis,required,nullable"`
	Status           CustomerCreditListResponseStatus `json:"status,required"`
	JSON             customerCreditListResponseJSON   `json:"-"`
}

func (*CustomerCreditListResponse) UnmarshalJSON

func (r *CustomerCreditListResponse) UnmarshalJSON(data []byte) (err error)

type CustomerCreditListResponseStatus added in v0.24.0

type CustomerCreditListResponseStatus string
const (
	CustomerCreditListResponseStatusActive         CustomerCreditListResponseStatus = "active"
	CustomerCreditListResponseStatusPendingPayment CustomerCreditListResponseStatus = "pending_payment"
)

func (CustomerCreditListResponseStatus) IsKnown added in v0.24.0

type CustomerCreditService

type CustomerCreditService struct {
	Options []option.RequestOption
	Ledger  *CustomerCreditLedgerService
	TopUps  *CustomerCreditTopUpService
}

CustomerCreditService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCustomerCreditService method instead.

func NewCustomerCreditService

func NewCustomerCreditService(opts ...option.RequestOption) (r *CustomerCreditService)

NewCustomerCreditService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CustomerCreditService) List

Returns a paginated list of unexpired, non-zero credit blocks for a customer.

func (*CustomerCreditService) ListAutoPaging

Returns a paginated list of unexpired, non-zero credit blocks for a customer.

func (*CustomerCreditService) ListByExternalID

Returns a paginated list of unexpired, non-zero credit blocks for a customer.

func (*CustomerCreditService) ListByExternalIDAutoPaging

Returns a paginated list of unexpired, non-zero credit blocks for a customer.

type CustomerCreditTopUpListByExternalIDParams added in v0.15.0

type CustomerCreditTopUpListByExternalIDParams struct {
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor param.Field[string] `query:"cursor"`
	// The number of items to fetch. Defaults to 20.
	Limit param.Field[int64] `query:"limit"`
}

func (CustomerCreditTopUpListByExternalIDParams) URLQuery added in v0.15.0

URLQuery serializes CustomerCreditTopUpListByExternalIDParams's query parameters as `url.Values`.

type CustomerCreditTopUpListByExternalIDResponse added in v0.15.0

type CustomerCreditTopUpListByExternalIDResponse struct {
	ID string `json:"id,required"`
	// The amount to increment when the threshold is reached.
	Amount string `json:"amount,required"`
	// The currency or custom pricing unit to use for this top-up. If this is a
	// real-world currency, it must match the customer's invoicing currency.
	Currency string `json:"currency,required"`
	// Settings for invoices generated by triggered top-ups.
	InvoiceSettings CustomerCreditTopUpListByExternalIDResponseInvoiceSettings `json:"invoice_settings,required"`
	// How much, in the customer's currency, to charge for each unit.
	PerUnitCostBasis string `json:"per_unit_cost_basis,required"`
	// The threshold at which to trigger the top-up. If the balance is at or below this
	// threshold, the top-up will be triggered.
	Threshold string `json:"threshold,required"`
	// The number of days or months after which the top-up expires. If unspecified, it
	// does not expire.
	ExpiresAfter int64 `json:"expires_after,nullable"`
	// The unit of expires_after.
	ExpiresAfterUnit CustomerCreditTopUpListByExternalIDResponseExpiresAfterUnit `json:"expires_after_unit,nullable"`
	JSON             customerCreditTopUpListByExternalIDResponseJSON             `json:"-"`
}

func (*CustomerCreditTopUpListByExternalIDResponse) UnmarshalJSON added in v0.15.0

func (r *CustomerCreditTopUpListByExternalIDResponse) UnmarshalJSON(data []byte) (err error)

type CustomerCreditTopUpListByExternalIDResponseExpiresAfterUnit added in v0.15.0

type CustomerCreditTopUpListByExternalIDResponseExpiresAfterUnit string

The unit of expires_after.

const (
	CustomerCreditTopUpListByExternalIDResponseExpiresAfterUnitDay   CustomerCreditTopUpListByExternalIDResponseExpiresAfterUnit = "day"
	CustomerCreditTopUpListByExternalIDResponseExpiresAfterUnitMonth CustomerCreditTopUpListByExternalIDResponseExpiresAfterUnit = "month"
)

func (CustomerCreditTopUpListByExternalIDResponseExpiresAfterUnit) IsKnown added in v0.24.0

type CustomerCreditTopUpListByExternalIDResponseInvoiceSettings added in v0.15.0

type CustomerCreditTopUpListByExternalIDResponseInvoiceSettings struct {
	// Whether the credits purchase invoice should auto collect with the customer's
	// saved payment method.
	AutoCollection bool `json:"auto_collection,required"`
	// The net terms determines the difference between the invoice date and the issue
	// date for the invoice. If you intend the invoice to be due on issue, set this
	// to 0.
	NetTerms int64 `json:"net_terms,required"`
	// An optional memo to display on the invoice.
	Memo string                                                         `json:"memo,nullable"`
	JSON customerCreditTopUpListByExternalIDResponseInvoiceSettingsJSON `json:"-"`
}

Settings for invoices generated by triggered top-ups.

func (*CustomerCreditTopUpListByExternalIDResponseInvoiceSettings) UnmarshalJSON added in v0.15.0

type CustomerCreditTopUpListParams added in v0.15.0

type CustomerCreditTopUpListParams struct {
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor param.Field[string] `query:"cursor"`
	// The number of items to fetch. Defaults to 20.
	Limit param.Field[int64] `query:"limit"`
}

func (CustomerCreditTopUpListParams) URLQuery added in v0.15.0

func (r CustomerCreditTopUpListParams) URLQuery() (v url.Values)

URLQuery serializes CustomerCreditTopUpListParams's query parameters as `url.Values`.

type CustomerCreditTopUpListResponse added in v0.15.0

type CustomerCreditTopUpListResponse struct {
	ID string `json:"id,required"`
	// The amount to increment when the threshold is reached.
	Amount string `json:"amount,required"`
	// The currency or custom pricing unit to use for this top-up. If this is a
	// real-world currency, it must match the customer's invoicing currency.
	Currency string `json:"currency,required"`
	// Settings for invoices generated by triggered top-ups.
	InvoiceSettings CustomerCreditTopUpListResponseInvoiceSettings `json:"invoice_settings,required"`
	// How much, in the customer's currency, to charge for each unit.
	PerUnitCostBasis string `json:"per_unit_cost_basis,required"`
	// The threshold at which to trigger the top-up. If the balance is at or below this
	// threshold, the top-up will be triggered.
	Threshold string `json:"threshold,required"`
	// The number of days or months after which the top-up expires. If unspecified, it
	// does not expire.
	ExpiresAfter int64 `json:"expires_after,nullable"`
	// The unit of expires_after.
	ExpiresAfterUnit CustomerCreditTopUpListResponseExpiresAfterUnit `json:"expires_after_unit,nullable"`
	JSON             customerCreditTopUpListResponseJSON             `json:"-"`
}

func (*CustomerCreditTopUpListResponse) UnmarshalJSON added in v0.15.0

func (r *CustomerCreditTopUpListResponse) UnmarshalJSON(data []byte) (err error)

type CustomerCreditTopUpListResponseExpiresAfterUnit added in v0.15.0

type CustomerCreditTopUpListResponseExpiresAfterUnit string

The unit of expires_after.

const (
	CustomerCreditTopUpListResponseExpiresAfterUnitDay   CustomerCreditTopUpListResponseExpiresAfterUnit = "day"
	CustomerCreditTopUpListResponseExpiresAfterUnitMonth CustomerCreditTopUpListResponseExpiresAfterUnit = "month"
)

func (CustomerCreditTopUpListResponseExpiresAfterUnit) IsKnown added in v0.24.0

type CustomerCreditTopUpListResponseInvoiceSettings added in v0.15.0

type CustomerCreditTopUpListResponseInvoiceSettings struct {
	// Whether the credits purchase invoice should auto collect with the customer's
	// saved payment method.
	AutoCollection bool `json:"auto_collection,required"`
	// The net terms determines the difference between the invoice date and the issue
	// date for the invoice. If you intend the invoice to be due on issue, set this
	// to 0.
	NetTerms int64 `json:"net_terms,required"`
	// An optional memo to display on the invoice.
	Memo string                                             `json:"memo,nullable"`
	JSON customerCreditTopUpListResponseInvoiceSettingsJSON `json:"-"`
}

Settings for invoices generated by triggered top-ups.

func (*CustomerCreditTopUpListResponseInvoiceSettings) UnmarshalJSON added in v0.15.0

func (r *CustomerCreditTopUpListResponseInvoiceSettings) UnmarshalJSON(data []byte) (err error)

type CustomerCreditTopUpNewByExternalIDParams added in v0.15.0

type CustomerCreditTopUpNewByExternalIDParams struct {
	// The amount to increment when the threshold is reached.
	Amount param.Field[string] `json:"amount,required"`
	// The currency or custom pricing unit to use for this top-up. If this is a
	// real-world currency, it must match the customer's invoicing currency.
	Currency param.Field[string] `json:"currency,required"`
	// Settings for invoices generated by triggered top-ups.
	InvoiceSettings param.Field[CustomerCreditTopUpNewByExternalIDParamsInvoiceSettings] `json:"invoice_settings,required"`
	// How much, in the customer's currency, to charge for each unit.
	PerUnitCostBasis param.Field[string] `json:"per_unit_cost_basis,required"`
	// The threshold at which to trigger the top-up. If the balance is at or below this
	// threshold, the top-up will be triggered.
	Threshold param.Field[string] `json:"threshold,required"`
	// The number of days or months after which the top-up expires. If unspecified, it
	// does not expire.
	ExpiresAfter param.Field[int64] `json:"expires_after"`
	// The unit of expires_after.
	ExpiresAfterUnit param.Field[CustomerCreditTopUpNewByExternalIDParamsExpiresAfterUnit] `json:"expires_after_unit"`
}

func (CustomerCreditTopUpNewByExternalIDParams) MarshalJSON added in v0.15.0

func (r CustomerCreditTopUpNewByExternalIDParams) MarshalJSON() (data []byte, err error)

type CustomerCreditTopUpNewByExternalIDParamsExpiresAfterUnit added in v0.15.0

type CustomerCreditTopUpNewByExternalIDParamsExpiresAfterUnit string

The unit of expires_after.

const (
	CustomerCreditTopUpNewByExternalIDParamsExpiresAfterUnitDay   CustomerCreditTopUpNewByExternalIDParamsExpiresAfterUnit = "day"
	CustomerCreditTopUpNewByExternalIDParamsExpiresAfterUnitMonth CustomerCreditTopUpNewByExternalIDParamsExpiresAfterUnit = "month"
)

func (CustomerCreditTopUpNewByExternalIDParamsExpiresAfterUnit) IsKnown added in v0.24.0

type CustomerCreditTopUpNewByExternalIDParamsInvoiceSettings added in v0.15.0

type CustomerCreditTopUpNewByExternalIDParamsInvoiceSettings struct {
	// Whether the credits purchase invoice should auto collect with the customer's
	// saved payment method.
	AutoCollection param.Field[bool] `json:"auto_collection,required"`
	// The net terms determines the difference between the invoice date and the issue
	// date for the invoice. If you intend the invoice to be due on issue, set this
	// to 0.
	NetTerms param.Field[int64] `json:"net_terms,required"`
	// An optional memo to display on the invoice.
	Memo param.Field[string] `json:"memo"`
}

Settings for invoices generated by triggered top-ups.

func (CustomerCreditTopUpNewByExternalIDParamsInvoiceSettings) MarshalJSON added in v0.15.0

type CustomerCreditTopUpNewByExternalIDResponse added in v0.15.0

type CustomerCreditTopUpNewByExternalIDResponse struct {
	ID string `json:"id,required"`
	// The amount to increment when the threshold is reached.
	Amount string `json:"amount,required"`
	// The currency or custom pricing unit to use for this top-up. If this is a
	// real-world currency, it must match the customer's invoicing currency.
	Currency string `json:"currency,required"`
	// Settings for invoices generated by triggered top-ups.
	InvoiceSettings CustomerCreditTopUpNewByExternalIDResponseInvoiceSettings `json:"invoice_settings,required"`
	// How much, in the customer's currency, to charge for each unit.
	PerUnitCostBasis string `json:"per_unit_cost_basis,required"`
	// The threshold at which to trigger the top-up. If the balance is at or below this
	// threshold, the top-up will be triggered.
	Threshold string `json:"threshold,required"`
	// The number of days or months after which the top-up expires. If unspecified, it
	// does not expire.
	ExpiresAfter int64 `json:"expires_after,nullable"`
	// The unit of expires_after.
	ExpiresAfterUnit CustomerCreditTopUpNewByExternalIDResponseExpiresAfterUnit `json:"expires_after_unit,nullable"`
	JSON             customerCreditTopUpNewByExternalIDResponseJSON             `json:"-"`
}

func (*CustomerCreditTopUpNewByExternalIDResponse) UnmarshalJSON added in v0.15.0

func (r *CustomerCreditTopUpNewByExternalIDResponse) UnmarshalJSON(data []byte) (err error)

type CustomerCreditTopUpNewByExternalIDResponseExpiresAfterUnit added in v0.15.0

type CustomerCreditTopUpNewByExternalIDResponseExpiresAfterUnit string

The unit of expires_after.

const (
	CustomerCreditTopUpNewByExternalIDResponseExpiresAfterUnitDay   CustomerCreditTopUpNewByExternalIDResponseExpiresAfterUnit = "day"
	CustomerCreditTopUpNewByExternalIDResponseExpiresAfterUnitMonth CustomerCreditTopUpNewByExternalIDResponseExpiresAfterUnit = "month"
)

func (CustomerCreditTopUpNewByExternalIDResponseExpiresAfterUnit) IsKnown added in v0.24.0

type CustomerCreditTopUpNewByExternalIDResponseInvoiceSettings added in v0.15.0

type CustomerCreditTopUpNewByExternalIDResponseInvoiceSettings struct {
	// Whether the credits purchase invoice should auto collect with the customer's
	// saved payment method.
	AutoCollection bool `json:"auto_collection,required"`
	// The net terms determines the difference between the invoice date and the issue
	// date for the invoice. If you intend the invoice to be due on issue, set this
	// to 0.
	NetTerms int64 `json:"net_terms,required"`
	// An optional memo to display on the invoice.
	Memo string                                                        `json:"memo,nullable"`
	JSON customerCreditTopUpNewByExternalIDResponseInvoiceSettingsJSON `json:"-"`
}

Settings for invoices generated by triggered top-ups.

func (*CustomerCreditTopUpNewByExternalIDResponseInvoiceSettings) UnmarshalJSON added in v0.15.0

type CustomerCreditTopUpNewParams added in v0.15.0

type CustomerCreditTopUpNewParams struct {
	// The amount to increment when the threshold is reached.
	Amount param.Field[string] `json:"amount,required"`
	// The currency or custom pricing unit to use for this top-up. If this is a
	// real-world currency, it must match the customer's invoicing currency.
	Currency param.Field[string] `json:"currency,required"`
	// Settings for invoices generated by triggered top-ups.
	InvoiceSettings param.Field[CustomerCreditTopUpNewParamsInvoiceSettings] `json:"invoice_settings,required"`
	// How much, in the customer's currency, to charge for each unit.
	PerUnitCostBasis param.Field[string] `json:"per_unit_cost_basis,required"`
	// The threshold at which to trigger the top-up. If the balance is at or below this
	// threshold, the top-up will be triggered.
	Threshold param.Field[string] `json:"threshold,required"`
	// The number of days or months after which the top-up expires. If unspecified, it
	// does not expire.
	ExpiresAfter param.Field[int64] `json:"expires_after"`
	// The unit of expires_after.
	ExpiresAfterUnit param.Field[CustomerCreditTopUpNewParamsExpiresAfterUnit] `json:"expires_after_unit"`
}

func (CustomerCreditTopUpNewParams) MarshalJSON added in v0.15.0

func (r CustomerCreditTopUpNewParams) MarshalJSON() (data []byte, err error)

type CustomerCreditTopUpNewParamsExpiresAfterUnit added in v0.15.0

type CustomerCreditTopUpNewParamsExpiresAfterUnit string

The unit of expires_after.

const (
	CustomerCreditTopUpNewParamsExpiresAfterUnitDay   CustomerCreditTopUpNewParamsExpiresAfterUnit = "day"
	CustomerCreditTopUpNewParamsExpiresAfterUnitMonth CustomerCreditTopUpNewParamsExpiresAfterUnit = "month"
)

func (CustomerCreditTopUpNewParamsExpiresAfterUnit) IsKnown added in v0.24.0

type CustomerCreditTopUpNewParamsInvoiceSettings added in v0.15.0

type CustomerCreditTopUpNewParamsInvoiceSettings struct {
	// Whether the credits purchase invoice should auto collect with the customer's
	// saved payment method.
	AutoCollection param.Field[bool] `json:"auto_collection,required"`
	// The net terms determines the difference between the invoice date and the issue
	// date for the invoice. If you intend the invoice to be due on issue, set this
	// to 0.
	NetTerms param.Field[int64] `json:"net_terms,required"`
	// An optional memo to display on the invoice.
	Memo param.Field[string] `json:"memo"`
}

Settings for invoices generated by triggered top-ups.

func (CustomerCreditTopUpNewParamsInvoiceSettings) MarshalJSON added in v0.15.0

func (r CustomerCreditTopUpNewParamsInvoiceSettings) MarshalJSON() (data []byte, err error)

type CustomerCreditTopUpNewResponse added in v0.15.0

type CustomerCreditTopUpNewResponse struct {
	ID string `json:"id,required"`
	// The amount to increment when the threshold is reached.
	Amount string `json:"amount,required"`
	// The currency or custom pricing unit to use for this top-up. If this is a
	// real-world currency, it must match the customer's invoicing currency.
	Currency string `json:"currency,required"`
	// Settings for invoices generated by triggered top-ups.
	InvoiceSettings CustomerCreditTopUpNewResponseInvoiceSettings `json:"invoice_settings,required"`
	// How much, in the customer's currency, to charge for each unit.
	PerUnitCostBasis string `json:"per_unit_cost_basis,required"`
	// The threshold at which to trigger the top-up. If the balance is at or below this
	// threshold, the top-up will be triggered.
	Threshold string `json:"threshold,required"`
	// The number of days or months after which the top-up expires. If unspecified, it
	// does not expire.
	ExpiresAfter int64 `json:"expires_after,nullable"`
	// The unit of expires_after.
	ExpiresAfterUnit CustomerCreditTopUpNewResponseExpiresAfterUnit `json:"expires_after_unit,nullable"`
	JSON             customerCreditTopUpNewResponseJSON             `json:"-"`
}

func (*CustomerCreditTopUpNewResponse) UnmarshalJSON added in v0.15.0

func (r *CustomerCreditTopUpNewResponse) UnmarshalJSON(data []byte) (err error)

type CustomerCreditTopUpNewResponseExpiresAfterUnit added in v0.15.0

type CustomerCreditTopUpNewResponseExpiresAfterUnit string

The unit of expires_after.

const (
	CustomerCreditTopUpNewResponseExpiresAfterUnitDay   CustomerCreditTopUpNewResponseExpiresAfterUnit = "day"
	CustomerCreditTopUpNewResponseExpiresAfterUnitMonth CustomerCreditTopUpNewResponseExpiresAfterUnit = "month"
)

func (CustomerCreditTopUpNewResponseExpiresAfterUnit) IsKnown added in v0.24.0

type CustomerCreditTopUpNewResponseInvoiceSettings added in v0.15.0

type CustomerCreditTopUpNewResponseInvoiceSettings struct {
	// Whether the credits purchase invoice should auto collect with the customer's
	// saved payment method.
	AutoCollection bool `json:"auto_collection,required"`
	// The net terms determines the difference between the invoice date and the issue
	// date for the invoice. If you intend the invoice to be due on issue, set this
	// to 0.
	NetTerms int64 `json:"net_terms,required"`
	// An optional memo to display on the invoice.
	Memo string                                            `json:"memo,nullable"`
	JSON customerCreditTopUpNewResponseInvoiceSettingsJSON `json:"-"`
}

Settings for invoices generated by triggered top-ups.

func (*CustomerCreditTopUpNewResponseInvoiceSettings) UnmarshalJSON added in v0.15.0

func (r *CustomerCreditTopUpNewResponseInvoiceSettings) UnmarshalJSON(data []byte) (err error)

type CustomerCreditTopUpService added in v0.15.0

type CustomerCreditTopUpService struct {
	Options []option.RequestOption
}

CustomerCreditTopUpService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCustomerCreditTopUpService method instead.

func NewCustomerCreditTopUpService added in v0.15.0

func NewCustomerCreditTopUpService(opts ...option.RequestOption) (r *CustomerCreditTopUpService)

NewCustomerCreditTopUpService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CustomerCreditTopUpService) Delete added in v0.15.0

func (r *CustomerCreditTopUpService) Delete(ctx context.Context, customerID string, topUpID string, opts ...option.RequestOption) (err error)

Delete top-up

func (*CustomerCreditTopUpService) DeleteByExternalID added in v0.15.0

func (r *CustomerCreditTopUpService) DeleteByExternalID(ctx context.Context, externalCustomerID string, topUpID string, opts ...option.RequestOption) (err error)

Delete top-up by external ID

func (*CustomerCreditTopUpService) List added in v0.15.0

List top-ups

func (*CustomerCreditTopUpService) ListAutoPaging added in v0.15.0

List top-ups

func (*CustomerCreditTopUpService) ListByExternalID added in v0.15.0

List top-ups by external ID

func (*CustomerCreditTopUpService) ListByExternalIDAutoPaging added in v0.15.0

List top-ups by external ID

func (*CustomerCreditTopUpService) New added in v0.15.0

This endpoint allows you to create a new top-up for a specified customer's balance. While this top-up is active, the customer's balance will added in increments of the specified amount whenever the balance reaches the specified threshold.

If a top-up already exists for this customer in the same currency, the existing top-up will be replaced.

func (*CustomerCreditTopUpService) NewByExternalID added in v0.15.0

This endpoint allows you to create a new top-up for a specified customer's balance. While this top-up is active, the customer's balance will added in increments of the specified amount whenever the balance reaches the specified threshold.

If a top-up already exists for this customer in the same currency, the existing top-up will be replaced.

type CustomerListParams

type CustomerListParams struct {
	CreatedAtGt  param.Field[time.Time] `query:"created_at[gt]" format:"date-time"`
	CreatedAtGte param.Field[time.Time] `query:"created_at[gte]" format:"date-time"`
	CreatedAtLt  param.Field[time.Time] `query:"created_at[lt]" format:"date-time"`
	CreatedAtLte param.Field[time.Time] `query:"created_at[lte]" format:"date-time"`
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor param.Field[string] `query:"cursor"`
	// The number of items to fetch. Defaults to 20.
	Limit param.Field[int64] `query:"limit"`
}

func (CustomerListParams) URLQuery

func (r CustomerListParams) URLQuery() (v url.Values)

URLQuery serializes CustomerListParams's query parameters as `url.Values`.

type CustomerNewParams

type CustomerNewParams struct {
	// A valid customer email, to be used for notifications. When Orb triggers payment
	// through a payment gateway, this email will be used for any automatically issued
	// receipts.
	Email param.Field[string] `json:"email,required"`
	// The full name of the customer
	Name                        param.Field[string]                                       `json:"name,required"`
	AccountingSyncConfiguration param.Field[CustomerNewParamsAccountingSyncConfiguration] `json:"accounting_sync_configuration"`
	// Additional email addresses for this customer. If populated, these email
	// addresses will be CC'd for customer communications.
	AdditionalEmails param.Field[[]string] `json:"additional_emails"`
	// Used to determine if invoices for this customer will automatically attempt to
	// charge a saved payment method, if available. This parameter defaults to `True`
	// when a payment provider is provided on customer creation.
	AutoCollection param.Field[bool]                            `json:"auto_collection"`
	BillingAddress param.Field[CustomerNewParamsBillingAddress] `json:"billing_address"`
	// An ISO 4217 currency string used for the customer's invoices and balance. If not
	// set at creation time, will be set at subscription creation time.
	Currency      param.Field[string] `json:"currency"`
	EmailDelivery param.Field[bool]   `json:"email_delivery"`
	// An optional user-defined ID for this customer resource, used throughout the
	// system as an alias for this Customer. Use this field to identify a customer by
	// an existing identifier in your system.
	ExternalCustomerID param.Field[string] `json:"external_customer_id"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// This is used for creating charges or invoices in an external system via Orb.
	// When not in test mode, the connection must first be configured in the Orb
	// webapp.
	PaymentProvider param.Field[CustomerNewParamsPaymentProvider] `json:"payment_provider"`
	// The ID of this customer in an external payments solution, such as Stripe. This
	// is used for creating charges or invoices in the external system via Orb.
	PaymentProviderID      param.Field[string]                                  `json:"payment_provider_id"`
	ReportingConfiguration param.Field[CustomerNewParamsReportingConfiguration] `json:"reporting_configuration"`
	ShippingAddress        param.Field[CustomerNewParamsShippingAddress]        `json:"shipping_address"`
	// Tax IDs are commonly required to be displayed on customer invoices, which are
	// added to the headers of invoices.
	//
	// ### Supported Tax ID Countries and Types
	//
	// | Country              | Type         | Description                                                                                             |
	// | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
	// | Andorra              | `ad_nrt`     | Andorran NRT number                                                                                     |
	// | Australia            | `au_abn`     | Australian Business Number (AU ABN)                                                                     |
	// | Australia            | `au_arn`     | Australian Taxation Office Reference Number                                                             |
	// | Austria              | `eu_vat`     | European VAT number                                                                                     |
	// | Belgium              | `eu_vat`     | European VAT number                                                                                     |
	// | Brazil               | `br_cnpj`    | Brazilian CNPJ number                                                                                   |
	// | Brazil               | `br_cpf`     | Brazilian CPF number                                                                                    |
	// | Bulgaria             | `bg_uic`     | Bulgaria Unified Identification Code                                                                    |
	// | Bulgaria             | `eu_vat`     | European VAT number                                                                                     |
	// | Canada               | `ca_bn`      | Canadian BN                                                                                             |
	// | Canada               | `ca_gst_hst` | Canadian GST/HST number                                                                                 |
	// | Canada               | `ca_pst_bc`  | Canadian PST number (British Columbia)                                                                  |
	// | Canada               | `ca_pst_mb`  | Canadian PST number (Manitoba)                                                                          |
	// | Canada               | `ca_pst_sk`  | Canadian PST number (Saskatchewan)                                                                      |
	// | Canada               | `ca_qst`     | Canadian QST number (Québec)                                                                            |
	// | Chile                | `cl_tin`     | Chilean TIN                                                                                             |
	// | Croatia              | `eu_vat`     | European VAT number                                                                                     |
	// | Cyprus               | `eu_vat`     | European VAT number                                                                                     |
	// | Czech Republic       | `eu_vat`     | European VAT number                                                                                     |
	// | Denmark              | `eu_vat`     | European VAT number                                                                                     |
	// | Egypt                | `eg_tin`     | Egyptian Tax Identification Number                                                                      |
	// | Estonia              | `eu_vat`     | European VAT number                                                                                     |
	// | EU                   | `eu_oss_vat` | European One Stop Shop VAT number for non-Union scheme                                                  |
	// | Finland              | `eu_vat`     | European VAT number                                                                                     |
	// | France               | `eu_vat`     | European VAT number                                                                                     |
	// | Georgia              | `ge_vat`     | Georgian VAT                                                                                            |
	// | Germany              | `eu_vat`     | European VAT number                                                                                     |
	// | Greece               | `eu_vat`     | European VAT number                                                                                     |
	// | Hong Kong            | `hk_br`      | Hong Kong BR number                                                                                     |
	// | Hungary              | `eu_vat`     | European VAT number                                                                                     |
	// | Hungary              | `hu_tin`     | Hungary tax number (adószám)                                                                            |
	// | Iceland              | `is_vat`     | Icelandic VAT                                                                                           |
	// | India                | `in_gst`     | Indian GST number                                                                                       |
	// | Indonesia            | `id_npwp`    | Indonesian NPWP number                                                                                  |
	// | Ireland              | `eu_vat`     | European VAT number                                                                                     |
	// | Israel               | `il_vat`     | Israel VAT                                                                                              |
	// | Italy                | `eu_vat`     | European VAT number                                                                                     |
	// | Japan                | `jp_cn`      | Japanese Corporate Number (_Hōjin Bangō_)                                                               |
	// | Japan                | `jp_rn`      | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
	// | Japan                | `jp_trn`     | Japanese Tax Registration Number (_Tōroku Bangō_)                                                       |
	// | Kenya                | `ke_pin`     | Kenya Revenue Authority Personal Identification Number                                                  |
	// | Latvia               | `eu_vat`     | European VAT number                                                                                     |
	// | Liechtenstein        | `li_uid`     | Liechtensteinian UID number                                                                             |
	// | Lithuania            | `eu_vat`     | European VAT number                                                                                     |
	// | Luxembourg           | `eu_vat`     | European VAT number                                                                                     |
	// | Malaysia             | `my_frp`     | Malaysian FRP number                                                                                    |
	// | Malaysia             | `my_itn`     | Malaysian ITN                                                                                           |
	// | Malaysia             | `my_sst`     | Malaysian SST number                                                                                    |
	// | Malta                | `eu_vat `    | European VAT number                                                                                     |
	// | Mexico               | `mx_rfc`     | Mexican RFC number                                                                                      |
	// | Netherlands          | `eu_vat`     | European VAT number                                                                                     |
	// | New Zealand          | `nz_gst`     | New Zealand GST number                                                                                  |
	// | Norway               | `no_vat`     | Norwegian VAT number                                                                                    |
	// | Philippines          | `ph_tin `    | Philippines Tax Identification Number                                                                   |
	// | Poland               | `eu_vat`     | European VAT number                                                                                     |
	// | Portugal             | `eu_vat`     | European VAT number                                                                                     |
	// | Romania              | `eu_vat`     | European VAT number                                                                                     |
	// | Russia               | `ru_inn`     | Russian INN                                                                                             |
	// | Russia               | `ru_kpp`     | Russian KPP                                                                                             |
	// | Saudi Arabia         | `sg_gst`     | Singaporean GST                                                                                         |
	// | Singapore            | `sg_uen`     | Singaporean UEN                                                                                         |
	// | Slovakia             | `eu_vat`     | European VAT number                                                                                     |
	// | Slovenia             | `eu_vat`     | European VAT number                                                                                     |
	// | Slovenia             | `si_tin`     | Slovenia tax number (davčna številka)                                                                   |
	// | South Africa         | `za_vat`     | South African VAT number                                                                                |
	// | South Korea          | `kr_brn`     | Korean BRN                                                                                              |
	// | Spain                | `es_cif`     | Spanish NIF number (previously Spanish CIF number)                                                      |
	// | Spain                | `eu_vat`     | European VAT number                                                                                     |
	// | Sweden               | `eu_vat`     | European VAT number                                                                                     |
	// | Switzerland          | `ch_vat`     | Switzerland VAT number                                                                                  |
	// | Taiwan               | `tw_vat`     | Taiwanese VAT                                                                                           |
	// | Thailand             | `th_vat`     | Thai VAT                                                                                                |
	// | Turkey               | `tr_tin`     | Turkish Tax Identification Number                                                                       |
	// | Ukraine              | `ua_vat`     | Ukrainian VAT                                                                                           |
	// | United Arab Emirates | `ae_trn`     | United Arab Emirates TRN                                                                                |
	// | United Kingdom       | `eu_vat`     | Northern Ireland VAT number                                                                             |
	// | United Kingdom       | `gb_vat`     | United Kingdom VAT number                                                                               |
	// | United States        | `us_ein`     | United States EIN                                                                                       |
	TaxID param.Field[CustomerNewParamsTaxID] `json:"tax_id"`
	// A timezone identifier from the IANA timezone database, such as
	// `"America/Los_Angeles"`. This defaults to your account's timezone if not set.
	// This cannot be changed after customer creation.
	Timezone param.Field[string] `json:"timezone"`
}

func (CustomerNewParams) MarshalJSON

func (r CustomerNewParams) MarshalJSON() (data []byte, err error)

type CustomerNewParamsAccountingSyncConfiguration

type CustomerNewParamsAccountingSyncConfiguration struct {
	AccountingProviders param.Field[[]CustomerNewParamsAccountingSyncConfigurationAccountingProvider] `json:"accounting_providers"`
	Excluded            param.Field[bool]                                                             `json:"excluded"`
}

func (CustomerNewParamsAccountingSyncConfiguration) MarshalJSON

func (r CustomerNewParamsAccountingSyncConfiguration) MarshalJSON() (data []byte, err error)

type CustomerNewParamsAccountingSyncConfigurationAccountingProvider

type CustomerNewParamsAccountingSyncConfigurationAccountingProvider struct {
	ExternalProviderID param.Field[string] `json:"external_provider_id,required"`
	ProviderType       param.Field[string] `json:"provider_type,required"`
}

func (CustomerNewParamsAccountingSyncConfigurationAccountingProvider) MarshalJSON

type CustomerNewParamsBillingAddress

type CustomerNewParamsBillingAddress struct {
	City       param.Field[string] `json:"city"`
	Country    param.Field[string] `json:"country"`
	Line1      param.Field[string] `json:"line1"`
	Line2      param.Field[string] `json:"line2"`
	PostalCode param.Field[string] `json:"postal_code"`
	State      param.Field[string] `json:"state"`
}

func (CustomerNewParamsBillingAddress) MarshalJSON

func (r CustomerNewParamsBillingAddress) MarshalJSON() (data []byte, err error)

type CustomerNewParamsPaymentProvider

type CustomerNewParamsPaymentProvider string

This is used for creating charges or invoices in an external system via Orb. When not in test mode, the connection must first be configured in the Orb webapp.

const (
	CustomerNewParamsPaymentProviderQuickbooks    CustomerNewParamsPaymentProvider = "quickbooks"
	CustomerNewParamsPaymentProviderBillCom       CustomerNewParamsPaymentProvider = "bill.com"
	CustomerNewParamsPaymentProviderStripeCharge  CustomerNewParamsPaymentProvider = "stripe_charge"
	CustomerNewParamsPaymentProviderStripeInvoice CustomerNewParamsPaymentProvider = "stripe_invoice"
	CustomerNewParamsPaymentProviderNetsuite      CustomerNewParamsPaymentProvider = "netsuite"
)

func (CustomerNewParamsPaymentProvider) IsKnown added in v0.24.0

type CustomerNewParamsReportingConfiguration

type CustomerNewParamsReportingConfiguration struct {
	Exempt param.Field[bool] `json:"exempt,required"`
}

func (CustomerNewParamsReportingConfiguration) MarshalJSON

func (r CustomerNewParamsReportingConfiguration) MarshalJSON() (data []byte, err error)

type CustomerNewParamsShippingAddress

type CustomerNewParamsShippingAddress struct {
	City       param.Field[string] `json:"city"`
	Country    param.Field[string] `json:"country"`
	Line1      param.Field[string] `json:"line1"`
	Line2      param.Field[string] `json:"line2"`
	PostalCode param.Field[string] `json:"postal_code"`
	State      param.Field[string] `json:"state"`
}

func (CustomerNewParamsShippingAddress) MarshalJSON

func (r CustomerNewParamsShippingAddress) MarshalJSON() (data []byte, err error)

type CustomerNewParamsTaxID

type CustomerNewParamsTaxID struct {
	Country param.Field[CustomerNewParamsTaxIDCountry] `json:"country,required"`
	Type    param.Field[CustomerNewParamsTaxIDType]    `json:"type,required"`
	Value   param.Field[string]                        `json:"value,required"`
}

Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices.

### Supported Tax ID Countries and Types

| Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | | Belgium | `eu_vat` | European VAT number | | Brazil | `br_cnpj` | Brazilian CNPJ number | | Brazil | `br_cpf` | Brazilian CPF number | | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | | Bulgaria | `eu_vat` | European VAT number | | Canada | `ca_bn` | Canadian BN | | Canada | `ca_gst_hst` | Canadian GST/HST number | | Canada | `ca_pst_bc` | Canadian PST number (British Columbia) | | Canada | `ca_pst_mb` | Canadian PST number (Manitoba) | | Canada | `ca_pst_sk` | Canadian PST number (Saskatchewan) | | Canada | `ca_qst` | Canadian QST number (Québec) | | Chile | `cl_tin` | Chilean TIN | | Croatia | `eu_vat` | European VAT number | | Cyprus | `eu_vat` | European VAT number | | Czech Republic | `eu_vat` | European VAT number | | Denmark | `eu_vat` | European VAT number | | Egypt | `eg_tin` | Egyptian Tax Identification Number | | Estonia | `eu_vat` | European VAT number | | EU | `eu_oss_vat` | European One Stop Shop VAT number for non-Union scheme | | Finland | `eu_vat` | European VAT number | | France | `eu_vat` | European VAT number | | Georgia | `ge_vat` | Georgian VAT | | Germany | `eu_vat` | European VAT number | | Greece | `eu_vat` | European VAT number | | Hong Kong | `hk_br` | Hong Kong BR number | | Hungary | `eu_vat` | European VAT number | | Hungary | `hu_tin` | Hungary tax number (adószám) | | Iceland | `is_vat` | Icelandic VAT | | India | `in_gst` | Indian GST number | | Indonesia | `id_npwp` | Indonesian NPWP number | | Ireland | `eu_vat` | European VAT number | | Israel | `il_vat` | Israel VAT | | Italy | `eu_vat` | European VAT number | | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | | Latvia | `eu_vat` | European VAT number | | Liechtenstein | `li_uid` | Liechtensteinian UID number | | Lithuania | `eu_vat` | European VAT number | | Luxembourg | `eu_vat` | European VAT number | | Malaysia | `my_frp` | Malaysian FRP number | | Malaysia | `my_itn` | Malaysian ITN | | Malaysia | `my_sst` | Malaysian SST number | | Malta | `eu_vat ` | European VAT number | | Mexico | `mx_rfc` | Mexican RFC number | | Netherlands | `eu_vat` | European VAT number | | New Zealand | `nz_gst` | New Zealand GST number | | Norway | `no_vat` | Norwegian VAT number | | Philippines | `ph_tin ` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT number | | Portugal | `eu_vat` | European VAT number | | Romania | `eu_vat` | European VAT number | | Russia | `ru_inn` | Russian INN | | Russia | `ru_kpp` | Russian KPP | | Saudi Arabia | `sg_gst` | Singaporean GST | | Singapore | `sg_uen` | Singaporean UEN | | Slovakia | `eu_vat` | European VAT number | | Slovenia | `eu_vat` | European VAT number | | Slovenia | `si_tin` | Slovenia tax number (davčna številka) | | South Africa | `za_vat` | South African VAT number | | South Korea | `kr_brn` | Korean BRN | | Spain | `es_cif` | Spanish NIF number (previously Spanish CIF number) | | Spain | `eu_vat` | European VAT number | | Sweden | `eu_vat` | European VAT number | | Switzerland | `ch_vat` | Switzerland VAT number | | Taiwan | `tw_vat` | Taiwanese VAT | | Thailand | `th_vat` | Thai VAT | | Turkey | `tr_tin` | Turkish Tax Identification Number | | Ukraine | `ua_vat` | Ukrainian VAT | | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | | United Kingdom | `eu_vat` | Northern Ireland VAT number | | United Kingdom | `gb_vat` | United Kingdom VAT number | | United States | `us_ein` | United States EIN |

func (CustomerNewParamsTaxID) MarshalJSON

func (r CustomerNewParamsTaxID) MarshalJSON() (data []byte, err error)

type CustomerNewParamsTaxIDCountry added in v0.2.0

type CustomerNewParamsTaxIDCountry string
const (
	CustomerNewParamsTaxIDCountryAd CustomerNewParamsTaxIDCountry = "AD"
	CustomerNewParamsTaxIDCountryAe CustomerNewParamsTaxIDCountry = "AE"
	CustomerNewParamsTaxIDCountryAt CustomerNewParamsTaxIDCountry = "AT"
	CustomerNewParamsTaxIDCountryAu CustomerNewParamsTaxIDCountry = "AU"
	CustomerNewParamsTaxIDCountryBe CustomerNewParamsTaxIDCountry = "BE"
	CustomerNewParamsTaxIDCountryBg CustomerNewParamsTaxIDCountry = "BG"
	CustomerNewParamsTaxIDCountryBr CustomerNewParamsTaxIDCountry = "BR"
	CustomerNewParamsTaxIDCountryCa CustomerNewParamsTaxIDCountry = "CA"
	CustomerNewParamsTaxIDCountryCh CustomerNewParamsTaxIDCountry = "CH"
	CustomerNewParamsTaxIDCountryCl CustomerNewParamsTaxIDCountry = "CL"
	CustomerNewParamsTaxIDCountryCy CustomerNewParamsTaxIDCountry = "CY"
	CustomerNewParamsTaxIDCountryCz CustomerNewParamsTaxIDCountry = "CZ"
	CustomerNewParamsTaxIDCountryDe CustomerNewParamsTaxIDCountry = "DE"
	CustomerNewParamsTaxIDCountryDk CustomerNewParamsTaxIDCountry = "DK"
	CustomerNewParamsTaxIDCountryEe CustomerNewParamsTaxIDCountry = "EE"
	CustomerNewParamsTaxIDCountryEg CustomerNewParamsTaxIDCountry = "EG"
	CustomerNewParamsTaxIDCountryEs CustomerNewParamsTaxIDCountry = "ES"
	CustomerNewParamsTaxIDCountryEu CustomerNewParamsTaxIDCountry = "EU"
	CustomerNewParamsTaxIDCountryFi CustomerNewParamsTaxIDCountry = "FI"
	CustomerNewParamsTaxIDCountryFr CustomerNewParamsTaxIDCountry = "FR"
	CustomerNewParamsTaxIDCountryGB CustomerNewParamsTaxIDCountry = "GB"
	CustomerNewParamsTaxIDCountryGe CustomerNewParamsTaxIDCountry = "GE"
	CustomerNewParamsTaxIDCountryGr CustomerNewParamsTaxIDCountry = "GR"
	CustomerNewParamsTaxIDCountryHk CustomerNewParamsTaxIDCountry = "HK"
	CustomerNewParamsTaxIDCountryHr CustomerNewParamsTaxIDCountry = "HR"
	CustomerNewParamsTaxIDCountryHu CustomerNewParamsTaxIDCountry = "HU"
	CustomerNewParamsTaxIDCountryID CustomerNewParamsTaxIDCountry = "ID"
	CustomerNewParamsTaxIDCountryIe CustomerNewParamsTaxIDCountry = "IE"
	CustomerNewParamsTaxIDCountryIl CustomerNewParamsTaxIDCountry = "IL"
	CustomerNewParamsTaxIDCountryIn CustomerNewParamsTaxIDCountry = "IN"
	CustomerNewParamsTaxIDCountryIs CustomerNewParamsTaxIDCountry = "IS"
	CustomerNewParamsTaxIDCountryIt CustomerNewParamsTaxIDCountry = "IT"
	CustomerNewParamsTaxIDCountryJp CustomerNewParamsTaxIDCountry = "JP"
	CustomerNewParamsTaxIDCountryKe CustomerNewParamsTaxIDCountry = "KE"
	CustomerNewParamsTaxIDCountryKr CustomerNewParamsTaxIDCountry = "KR"
	CustomerNewParamsTaxIDCountryLi CustomerNewParamsTaxIDCountry = "LI"
	CustomerNewParamsTaxIDCountryLt CustomerNewParamsTaxIDCountry = "LT"
	CustomerNewParamsTaxIDCountryLu CustomerNewParamsTaxIDCountry = "LU"
	CustomerNewParamsTaxIDCountryLv CustomerNewParamsTaxIDCountry = "LV"
	CustomerNewParamsTaxIDCountryMt CustomerNewParamsTaxIDCountry = "MT"
	CustomerNewParamsTaxIDCountryMx CustomerNewParamsTaxIDCountry = "MX"
	CustomerNewParamsTaxIDCountryMy CustomerNewParamsTaxIDCountry = "MY"
	CustomerNewParamsTaxIDCountryNl CustomerNewParamsTaxIDCountry = "NL"
	CustomerNewParamsTaxIDCountryNo CustomerNewParamsTaxIDCountry = "NO"
	CustomerNewParamsTaxIDCountryNz CustomerNewParamsTaxIDCountry = "NZ"
	CustomerNewParamsTaxIDCountryPh CustomerNewParamsTaxIDCountry = "PH"
	CustomerNewParamsTaxIDCountryPl CustomerNewParamsTaxIDCountry = "PL"
	CustomerNewParamsTaxIDCountryPt CustomerNewParamsTaxIDCountry = "PT"
	CustomerNewParamsTaxIDCountryRo CustomerNewParamsTaxIDCountry = "RO"
	CustomerNewParamsTaxIDCountryRu CustomerNewParamsTaxIDCountry = "RU"
	CustomerNewParamsTaxIDCountrySa CustomerNewParamsTaxIDCountry = "SA"
	CustomerNewParamsTaxIDCountrySe CustomerNewParamsTaxIDCountry = "SE"
	CustomerNewParamsTaxIDCountrySg CustomerNewParamsTaxIDCountry = "SG"
	CustomerNewParamsTaxIDCountrySi CustomerNewParamsTaxIDCountry = "SI"
	CustomerNewParamsTaxIDCountrySk CustomerNewParamsTaxIDCountry = "SK"
	CustomerNewParamsTaxIDCountryTh CustomerNewParamsTaxIDCountry = "TH"
	CustomerNewParamsTaxIDCountryTr CustomerNewParamsTaxIDCountry = "TR"
	CustomerNewParamsTaxIDCountryTw CustomerNewParamsTaxIDCountry = "TW"
	CustomerNewParamsTaxIDCountryUa CustomerNewParamsTaxIDCountry = "UA"
	CustomerNewParamsTaxIDCountryUs CustomerNewParamsTaxIDCountry = "US"
	CustomerNewParamsTaxIDCountryZa CustomerNewParamsTaxIDCountry = "ZA"
)

func (CustomerNewParamsTaxIDCountry) IsKnown added in v0.24.0

func (r CustomerNewParamsTaxIDCountry) IsKnown() bool

type CustomerNewParamsTaxIDType added in v0.2.0

type CustomerNewParamsTaxIDType string
const (
	CustomerNewParamsTaxIDTypeAdNrt    CustomerNewParamsTaxIDType = "ad_nrt"
	CustomerNewParamsTaxIDTypeAeTrn    CustomerNewParamsTaxIDType = "ae_trn"
	CustomerNewParamsTaxIDTypeEuVat    CustomerNewParamsTaxIDType = "eu_vat"
	CustomerNewParamsTaxIDTypeAuAbn    CustomerNewParamsTaxIDType = "au_abn"
	CustomerNewParamsTaxIDTypeAuArn    CustomerNewParamsTaxIDType = "au_arn"
	CustomerNewParamsTaxIDTypeBgUic    CustomerNewParamsTaxIDType = "bg_uic"
	CustomerNewParamsTaxIDTypeBrCnpj   CustomerNewParamsTaxIDType = "br_cnpj"
	CustomerNewParamsTaxIDTypeBrCpf    CustomerNewParamsTaxIDType = "br_cpf"
	CustomerNewParamsTaxIDTypeCaBn     CustomerNewParamsTaxIDType = "ca_bn"
	CustomerNewParamsTaxIDTypeCaGstHst CustomerNewParamsTaxIDType = "ca_gst_hst"
	CustomerNewParamsTaxIDTypeCaPstBc  CustomerNewParamsTaxIDType = "ca_pst_bc"
	CustomerNewParamsTaxIDTypeCaPstMB  CustomerNewParamsTaxIDType = "ca_pst_mb"
	CustomerNewParamsTaxIDTypeCaPstSk  CustomerNewParamsTaxIDType = "ca_pst_sk"
	CustomerNewParamsTaxIDTypeCaQst    CustomerNewParamsTaxIDType = "ca_qst"
	CustomerNewParamsTaxIDTypeChVat    CustomerNewParamsTaxIDType = "ch_vat"
	CustomerNewParamsTaxIDTypeClTin    CustomerNewParamsTaxIDType = "cl_tin"
	CustomerNewParamsTaxIDTypeEgTin    CustomerNewParamsTaxIDType = "eg_tin"
	CustomerNewParamsTaxIDTypeEsCif    CustomerNewParamsTaxIDType = "es_cif"
	CustomerNewParamsTaxIDTypeEuOssVat CustomerNewParamsTaxIDType = "eu_oss_vat"
	CustomerNewParamsTaxIDTypeGBVat    CustomerNewParamsTaxIDType = "gb_vat"
	CustomerNewParamsTaxIDTypeGeVat    CustomerNewParamsTaxIDType = "ge_vat"
	CustomerNewParamsTaxIDTypeHkBr     CustomerNewParamsTaxIDType = "hk_br"
	CustomerNewParamsTaxIDTypeHuTin    CustomerNewParamsTaxIDType = "hu_tin"
	CustomerNewParamsTaxIDTypeIDNpwp   CustomerNewParamsTaxIDType = "id_npwp"
	CustomerNewParamsTaxIDTypeIlVat    CustomerNewParamsTaxIDType = "il_vat"
	CustomerNewParamsTaxIDTypeInGst    CustomerNewParamsTaxIDType = "in_gst"
	CustomerNewParamsTaxIDTypeIsVat    CustomerNewParamsTaxIDType = "is_vat"
	CustomerNewParamsTaxIDTypeJpCn     CustomerNewParamsTaxIDType = "jp_cn"
	CustomerNewParamsTaxIDTypeJpRn     CustomerNewParamsTaxIDType = "jp_rn"
	CustomerNewParamsTaxIDTypeJpTrn    CustomerNewParamsTaxIDType = "jp_trn"
	CustomerNewParamsTaxIDTypeKePin    CustomerNewParamsTaxIDType = "ke_pin"
	CustomerNewParamsTaxIDTypeKrBrn    CustomerNewParamsTaxIDType = "kr_brn"
	CustomerNewParamsTaxIDTypeLiUid    CustomerNewParamsTaxIDType = "li_uid"
	CustomerNewParamsTaxIDTypeMxRfc    CustomerNewParamsTaxIDType = "mx_rfc"
	CustomerNewParamsTaxIDTypeMyFrp    CustomerNewParamsTaxIDType = "my_frp"
	CustomerNewParamsTaxIDTypeMyItn    CustomerNewParamsTaxIDType = "my_itn"
	CustomerNewParamsTaxIDTypeMySst    CustomerNewParamsTaxIDType = "my_sst"
	CustomerNewParamsTaxIDTypeNoVat    CustomerNewParamsTaxIDType = "no_vat"
	CustomerNewParamsTaxIDTypeNzGst    CustomerNewParamsTaxIDType = "nz_gst"
	CustomerNewParamsTaxIDTypePhTin    CustomerNewParamsTaxIDType = "ph_tin"
	CustomerNewParamsTaxIDTypeRuInn    CustomerNewParamsTaxIDType = "ru_inn"
	CustomerNewParamsTaxIDTypeRuKpp    CustomerNewParamsTaxIDType = "ru_kpp"
	CustomerNewParamsTaxIDTypeSaVat    CustomerNewParamsTaxIDType = "sa_vat"
	CustomerNewParamsTaxIDTypeSgGst    CustomerNewParamsTaxIDType = "sg_gst"
	CustomerNewParamsTaxIDTypeSgUen    CustomerNewParamsTaxIDType = "sg_uen"
	CustomerNewParamsTaxIDTypeSiTin    CustomerNewParamsTaxIDType = "si_tin"
	CustomerNewParamsTaxIDTypeThVat    CustomerNewParamsTaxIDType = "th_vat"
	CustomerNewParamsTaxIDTypeTrTin    CustomerNewParamsTaxIDType = "tr_tin"
	CustomerNewParamsTaxIDTypeTwVat    CustomerNewParamsTaxIDType = "tw_vat"
	CustomerNewParamsTaxIDTypeUaVat    CustomerNewParamsTaxIDType = "ua_vat"
	CustomerNewParamsTaxIDTypeUsEin    CustomerNewParamsTaxIDType = "us_ein"
	CustomerNewParamsTaxIDTypeZaVat    CustomerNewParamsTaxIDType = "za_vat"
)

func (CustomerNewParamsTaxIDType) IsKnown added in v0.24.0

func (r CustomerNewParamsTaxIDType) IsKnown() bool

type CustomerPaymentProvider

type CustomerPaymentProvider string

This is used for creating charges or invoices in an external system via Orb. When not in test mode, the connection must first be configured in the Orb webapp.

const (
	CustomerPaymentProviderQuickbooks    CustomerPaymentProvider = "quickbooks"
	CustomerPaymentProviderBillCom       CustomerPaymentProvider = "bill.com"
	CustomerPaymentProviderStripeCharge  CustomerPaymentProvider = "stripe_charge"
	CustomerPaymentProviderStripeInvoice CustomerPaymentProvider = "stripe_invoice"
	CustomerPaymentProviderNetsuite      CustomerPaymentProvider = "netsuite"
)

func (CustomerPaymentProvider) IsKnown added in v0.24.0

func (r CustomerPaymentProvider) IsKnown() bool

type CustomerReportingConfiguration

type CustomerReportingConfiguration struct {
	Exempt bool                               `json:"exempt,required"`
	JSON   customerReportingConfigurationJSON `json:"-"`
}

func (*CustomerReportingConfiguration) UnmarshalJSON

func (r *CustomerReportingConfiguration) UnmarshalJSON(data []byte) (err error)

type CustomerService

type CustomerService struct {
	Options             []option.RequestOption
	Costs               *CustomerCostService
	Usage               *CustomerUsageService
	Credits             *CustomerCreditService
	BalanceTransactions *CustomerBalanceTransactionService
}

CustomerService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCustomerService method instead.

func NewCustomerService

func NewCustomerService(opts ...option.RequestOption) (r *CustomerService)

NewCustomerService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CustomerService) Delete

func (r *CustomerService) Delete(ctx context.Context, customerID string, opts ...option.RequestOption) (err error)

This performs a deletion of this customer, its subscriptions, and its invoices. This operation is irreversible. Note that this is a _soft_ deletion, but the data will be inaccessible through the API and Orb dashboard. For hard-deletion, please reach out to the Orb team directly.

**Note**: This operation happens asynchronously and can be expected to take a few minutes to propagate to related resources. However, querying for the customer on subsequent GET requests while deletion is in process will reflect its deletion with a `deleted: true` property. Once the customer deletion has been fully processed, the customer will not be returned in the API.

On successful processing, this returns an empty dictionary (`{}`) in the API.

func (*CustomerService) Fetch

func (r *CustomerService) Fetch(ctx context.Context, customerID string, opts ...option.RequestOption) (res *Customer, err error)

This endpoint is used to fetch customer details given an identifier. If the `Customer` is in the process of being deleted, only the properties `id` and `deleted: true` will be returned.

See the [Customer resource](../guides/core-concepts.mdx#customer) for a full discussion of the Customer model.

func (*CustomerService) FetchByExternalID

func (r *CustomerService) FetchByExternalID(ctx context.Context, externalCustomerID string, opts ...option.RequestOption) (res *Customer, err error)

This endpoint is used to fetch customer details given an `external_customer_id` (see [Customer ID Aliases](../guides/events-and-metrics/customer-aliases)).

Note that the resource and semantics of this endpoint exactly mirror [Get Customer](fetch-customer).

func (*CustomerService) List

func (r *CustomerService) List(ctx context.Context, query CustomerListParams, opts ...option.RequestOption) (res *shared.Page[Customer], err error)

This endpoint returns a list of all customers for an account. The list of customers is ordered starting from the most recently created customer. This endpoint follows Orb's [standardized pagination format](../reference/pagination).

See Customer(../guides/concepts#customer) for an overview of the customer model.

func (*CustomerService) ListAutoPaging

This endpoint returns a list of all customers for an account. The list of customers is ordered starting from the most recently created customer. This endpoint follows Orb's [standardized pagination format](../reference/pagination).

See Customer(../guides/concepts#customer) for an overview of the customer model.

func (*CustomerService) New

func (r *CustomerService) New(ctx context.Context, body CustomerNewParams, opts ...option.RequestOption) (res *Customer, err error)

This operation is used to create an Orb customer, who is party to the core billing relationship. See Customer(../guides/concepts#customer) for an overview of the customer resource.

This endpoint is critical in the following Orb functionality:

  • Automated charges can be configured by setting `payment_provider` and `payment_provider_id` to automatically issue invoices
  • [Customer ID Aliases](../guides/events-and-metrics/customer-aliases) can be configured by setting `external_customer_id`
  • [Timezone localization](../guides/product-catalog/timezones.md) can be configured on a per-customer basis by setting the `timezone` parameter

func (*CustomerService) Update

func (r *CustomerService) Update(ctx context.Context, customerID string, body CustomerUpdateParams, opts ...option.RequestOption) (res *Customer, err error)

This endpoint can be used to update the `payment_provider`, `payment_provider_id`, `name`, `email`, `email_delivery`, `tax_id`, `auto_collection`, `metadata`, `shipping_address`, `billing_address`, and `additional_emails` of an existing customer. Other fields on a customer are currently immutable.

func (*CustomerService) UpdateByExternalID

func (r *CustomerService) UpdateByExternalID(ctx context.Context, id string, body CustomerUpdateByExternalIDParams, opts ...option.RequestOption) (res *Customer, err error)

This endpoint is used to update customer details given an `external_customer_id` (see [Customer ID Aliases](../guides/events-and-metrics/customer-aliases)). Note that the resource and semantics of this endpoint exactly mirror [Update Customer](update-customer).

type CustomerShippingAddress

type CustomerShippingAddress struct {
	City       string                      `json:"city,required,nullable"`
	Country    string                      `json:"country,required,nullable"`
	Line1      string                      `json:"line1,required,nullable"`
	Line2      string                      `json:"line2,required,nullable"`
	PostalCode string                      `json:"postal_code,required,nullable"`
	State      string                      `json:"state,required,nullable"`
	JSON       customerShippingAddressJSON `json:"-"`
}

func (*CustomerShippingAddress) UnmarshalJSON

func (r *CustomerShippingAddress) UnmarshalJSON(data []byte) (err error)

type CustomerTaxID

type CustomerTaxID struct {
	Country CustomerTaxIDCountry `json:"country,required"`
	Type    CustomerTaxIDType    `json:"type,required"`
	Value   string               `json:"value,required"`
	JSON    customerTaxIDJSON    `json:"-"`
}

Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices.

### Supported Tax ID Countries and Types

| Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | | Belgium | `eu_vat` | European VAT number | | Brazil | `br_cnpj` | Brazilian CNPJ number | | Brazil | `br_cpf` | Brazilian CPF number | | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | | Bulgaria | `eu_vat` | European VAT number | | Canada | `ca_bn` | Canadian BN | | Canada | `ca_gst_hst` | Canadian GST/HST number | | Canada | `ca_pst_bc` | Canadian PST number (British Columbia) | | Canada | `ca_pst_mb` | Canadian PST number (Manitoba) | | Canada | `ca_pst_sk` | Canadian PST number (Saskatchewan) | | Canada | `ca_qst` | Canadian QST number (Québec) | | Chile | `cl_tin` | Chilean TIN | | Croatia | `eu_vat` | European VAT number | | Cyprus | `eu_vat` | European VAT number | | Czech Republic | `eu_vat` | European VAT number | | Denmark | `eu_vat` | European VAT number | | Egypt | `eg_tin` | Egyptian Tax Identification Number | | Estonia | `eu_vat` | European VAT number | | EU | `eu_oss_vat` | European One Stop Shop VAT number for non-Union scheme | | Finland | `eu_vat` | European VAT number | | France | `eu_vat` | European VAT number | | Georgia | `ge_vat` | Georgian VAT | | Germany | `eu_vat` | European VAT number | | Greece | `eu_vat` | European VAT number | | Hong Kong | `hk_br` | Hong Kong BR number | | Hungary | `eu_vat` | European VAT number | | Hungary | `hu_tin` | Hungary tax number (adószám) | | Iceland | `is_vat` | Icelandic VAT | | India | `in_gst` | Indian GST number | | Indonesia | `id_npwp` | Indonesian NPWP number | | Ireland | `eu_vat` | European VAT number | | Israel | `il_vat` | Israel VAT | | Italy | `eu_vat` | European VAT number | | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | | Latvia | `eu_vat` | European VAT number | | Liechtenstein | `li_uid` | Liechtensteinian UID number | | Lithuania | `eu_vat` | European VAT number | | Luxembourg | `eu_vat` | European VAT number | | Malaysia | `my_frp` | Malaysian FRP number | | Malaysia | `my_itn` | Malaysian ITN | | Malaysia | `my_sst` | Malaysian SST number | | Malta | `eu_vat ` | European VAT number | | Mexico | `mx_rfc` | Mexican RFC number | | Netherlands | `eu_vat` | European VAT number | | New Zealand | `nz_gst` | New Zealand GST number | | Norway | `no_vat` | Norwegian VAT number | | Philippines | `ph_tin ` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT number | | Portugal | `eu_vat` | European VAT number | | Romania | `eu_vat` | European VAT number | | Russia | `ru_inn` | Russian INN | | Russia | `ru_kpp` | Russian KPP | | Saudi Arabia | `sg_gst` | Singaporean GST | | Singapore | `sg_uen` | Singaporean UEN | | Slovakia | `eu_vat` | European VAT number | | Slovenia | `eu_vat` | European VAT number | | Slovenia | `si_tin` | Slovenia tax number (davčna številka) | | South Africa | `za_vat` | South African VAT number | | South Korea | `kr_brn` | Korean BRN | | Spain | `es_cif` | Spanish NIF number (previously Spanish CIF number) | | Spain | `eu_vat` | European VAT number | | Sweden | `eu_vat` | European VAT number | | Switzerland | `ch_vat` | Switzerland VAT number | | Taiwan | `tw_vat` | Taiwanese VAT | | Thailand | `th_vat` | Thai VAT | | Turkey | `tr_tin` | Turkish Tax Identification Number | | Ukraine | `ua_vat` | Ukrainian VAT | | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | | United Kingdom | `eu_vat` | Northern Ireland VAT number | | United Kingdom | `gb_vat` | United Kingdom VAT number | | United States | `us_ein` | United States EIN |

func (*CustomerTaxID) UnmarshalJSON

func (r *CustomerTaxID) UnmarshalJSON(data []byte) (err error)

type CustomerTaxIDCountry added in v0.2.0

type CustomerTaxIDCountry string
const (
	CustomerTaxIDCountryAd CustomerTaxIDCountry = "AD"
	CustomerTaxIDCountryAe CustomerTaxIDCountry = "AE"
	CustomerTaxIDCountryAt CustomerTaxIDCountry = "AT"
	CustomerTaxIDCountryAu CustomerTaxIDCountry = "AU"
	CustomerTaxIDCountryBe CustomerTaxIDCountry = "BE"
	CustomerTaxIDCountryBg CustomerTaxIDCountry = "BG"
	CustomerTaxIDCountryBr CustomerTaxIDCountry = "BR"
	CustomerTaxIDCountryCa CustomerTaxIDCountry = "CA"
	CustomerTaxIDCountryCh CustomerTaxIDCountry = "CH"
	CustomerTaxIDCountryCl CustomerTaxIDCountry = "CL"
	CustomerTaxIDCountryCy CustomerTaxIDCountry = "CY"
	CustomerTaxIDCountryCz CustomerTaxIDCountry = "CZ"
	CustomerTaxIDCountryDe CustomerTaxIDCountry = "DE"
	CustomerTaxIDCountryDk CustomerTaxIDCountry = "DK"
	CustomerTaxIDCountryEe CustomerTaxIDCountry = "EE"
	CustomerTaxIDCountryEg CustomerTaxIDCountry = "EG"
	CustomerTaxIDCountryEs CustomerTaxIDCountry = "ES"
	CustomerTaxIDCountryEu CustomerTaxIDCountry = "EU"
	CustomerTaxIDCountryFi CustomerTaxIDCountry = "FI"
	CustomerTaxIDCountryFr CustomerTaxIDCountry = "FR"
	CustomerTaxIDCountryGB CustomerTaxIDCountry = "GB"
	CustomerTaxIDCountryGe CustomerTaxIDCountry = "GE"
	CustomerTaxIDCountryGr CustomerTaxIDCountry = "GR"
	CustomerTaxIDCountryHk CustomerTaxIDCountry = "HK"
	CustomerTaxIDCountryHr CustomerTaxIDCountry = "HR"
	CustomerTaxIDCountryHu CustomerTaxIDCountry = "HU"
	CustomerTaxIDCountryID CustomerTaxIDCountry = "ID"
	CustomerTaxIDCountryIe CustomerTaxIDCountry = "IE"
	CustomerTaxIDCountryIl CustomerTaxIDCountry = "IL"
	CustomerTaxIDCountryIn CustomerTaxIDCountry = "IN"
	CustomerTaxIDCountryIs CustomerTaxIDCountry = "IS"
	CustomerTaxIDCountryIt CustomerTaxIDCountry = "IT"
	CustomerTaxIDCountryJp CustomerTaxIDCountry = "JP"
	CustomerTaxIDCountryKe CustomerTaxIDCountry = "KE"
	CustomerTaxIDCountryKr CustomerTaxIDCountry = "KR"
	CustomerTaxIDCountryLi CustomerTaxIDCountry = "LI"
	CustomerTaxIDCountryLt CustomerTaxIDCountry = "LT"
	CustomerTaxIDCountryLu CustomerTaxIDCountry = "LU"
	CustomerTaxIDCountryLv CustomerTaxIDCountry = "LV"
	CustomerTaxIDCountryMt CustomerTaxIDCountry = "MT"
	CustomerTaxIDCountryMx CustomerTaxIDCountry = "MX"
	CustomerTaxIDCountryMy CustomerTaxIDCountry = "MY"
	CustomerTaxIDCountryNl CustomerTaxIDCountry = "NL"
	CustomerTaxIDCountryNo CustomerTaxIDCountry = "NO"
	CustomerTaxIDCountryNz CustomerTaxIDCountry = "NZ"
	CustomerTaxIDCountryPh CustomerTaxIDCountry = "PH"
	CustomerTaxIDCountryPl CustomerTaxIDCountry = "PL"
	CustomerTaxIDCountryPt CustomerTaxIDCountry = "PT"
	CustomerTaxIDCountryRo CustomerTaxIDCountry = "RO"
	CustomerTaxIDCountryRu CustomerTaxIDCountry = "RU"
	CustomerTaxIDCountrySa CustomerTaxIDCountry = "SA"
	CustomerTaxIDCountrySe CustomerTaxIDCountry = "SE"
	CustomerTaxIDCountrySg CustomerTaxIDCountry = "SG"
	CustomerTaxIDCountrySi CustomerTaxIDCountry = "SI"
	CustomerTaxIDCountrySk CustomerTaxIDCountry = "SK"
	CustomerTaxIDCountryTh CustomerTaxIDCountry = "TH"
	CustomerTaxIDCountryTr CustomerTaxIDCountry = "TR"
	CustomerTaxIDCountryTw CustomerTaxIDCountry = "TW"
	CustomerTaxIDCountryUa CustomerTaxIDCountry = "UA"
	CustomerTaxIDCountryUs CustomerTaxIDCountry = "US"
	CustomerTaxIDCountryZa CustomerTaxIDCountry = "ZA"
)

func (CustomerTaxIDCountry) IsKnown added in v0.24.0

func (r CustomerTaxIDCountry) IsKnown() bool

type CustomerTaxIDType added in v0.2.0

type CustomerTaxIDType string
const (
	CustomerTaxIDTypeAdNrt    CustomerTaxIDType = "ad_nrt"
	CustomerTaxIDTypeAeTrn    CustomerTaxIDType = "ae_trn"
	CustomerTaxIDTypeEuVat    CustomerTaxIDType = "eu_vat"
	CustomerTaxIDTypeAuAbn    CustomerTaxIDType = "au_abn"
	CustomerTaxIDTypeAuArn    CustomerTaxIDType = "au_arn"
	CustomerTaxIDTypeBgUic    CustomerTaxIDType = "bg_uic"
	CustomerTaxIDTypeBrCnpj   CustomerTaxIDType = "br_cnpj"
	CustomerTaxIDTypeBrCpf    CustomerTaxIDType = "br_cpf"
	CustomerTaxIDTypeCaBn     CustomerTaxIDType = "ca_bn"
	CustomerTaxIDTypeCaGstHst CustomerTaxIDType = "ca_gst_hst"
	CustomerTaxIDTypeCaPstBc  CustomerTaxIDType = "ca_pst_bc"
	CustomerTaxIDTypeCaPstMB  CustomerTaxIDType = "ca_pst_mb"
	CustomerTaxIDTypeCaPstSk  CustomerTaxIDType = "ca_pst_sk"
	CustomerTaxIDTypeCaQst    CustomerTaxIDType = "ca_qst"
	CustomerTaxIDTypeChVat    CustomerTaxIDType = "ch_vat"
	CustomerTaxIDTypeClTin    CustomerTaxIDType = "cl_tin"
	CustomerTaxIDTypeEgTin    CustomerTaxIDType = "eg_tin"
	CustomerTaxIDTypeEsCif    CustomerTaxIDType = "es_cif"
	CustomerTaxIDTypeEuOssVat CustomerTaxIDType = "eu_oss_vat"
	CustomerTaxIDTypeGBVat    CustomerTaxIDType = "gb_vat"
	CustomerTaxIDTypeGeVat    CustomerTaxIDType = "ge_vat"
	CustomerTaxIDTypeHkBr     CustomerTaxIDType = "hk_br"
	CustomerTaxIDTypeHuTin    CustomerTaxIDType = "hu_tin"
	CustomerTaxIDTypeIDNpwp   CustomerTaxIDType = "id_npwp"
	CustomerTaxIDTypeIlVat    CustomerTaxIDType = "il_vat"
	CustomerTaxIDTypeInGst    CustomerTaxIDType = "in_gst"
	CustomerTaxIDTypeIsVat    CustomerTaxIDType = "is_vat"
	CustomerTaxIDTypeJpCn     CustomerTaxIDType = "jp_cn"
	CustomerTaxIDTypeJpRn     CustomerTaxIDType = "jp_rn"
	CustomerTaxIDTypeJpTrn    CustomerTaxIDType = "jp_trn"
	CustomerTaxIDTypeKePin    CustomerTaxIDType = "ke_pin"
	CustomerTaxIDTypeKrBrn    CustomerTaxIDType = "kr_brn"
	CustomerTaxIDTypeLiUid    CustomerTaxIDType = "li_uid"
	CustomerTaxIDTypeMxRfc    CustomerTaxIDType = "mx_rfc"
	CustomerTaxIDTypeMyFrp    CustomerTaxIDType = "my_frp"
	CustomerTaxIDTypeMyItn    CustomerTaxIDType = "my_itn"
	CustomerTaxIDTypeMySst    CustomerTaxIDType = "my_sst"
	CustomerTaxIDTypeNoVat    CustomerTaxIDType = "no_vat"
	CustomerTaxIDTypeNzGst    CustomerTaxIDType = "nz_gst"
	CustomerTaxIDTypePhTin    CustomerTaxIDType = "ph_tin"
	CustomerTaxIDTypeRuInn    CustomerTaxIDType = "ru_inn"
	CustomerTaxIDTypeRuKpp    CustomerTaxIDType = "ru_kpp"
	CustomerTaxIDTypeSaVat    CustomerTaxIDType = "sa_vat"
	CustomerTaxIDTypeSgGst    CustomerTaxIDType = "sg_gst"
	CustomerTaxIDTypeSgUen    CustomerTaxIDType = "sg_uen"
	CustomerTaxIDTypeSiTin    CustomerTaxIDType = "si_tin"
	CustomerTaxIDTypeThVat    CustomerTaxIDType = "th_vat"
	CustomerTaxIDTypeTrTin    CustomerTaxIDType = "tr_tin"
	CustomerTaxIDTypeTwVat    CustomerTaxIDType = "tw_vat"
	CustomerTaxIDTypeUaVat    CustomerTaxIDType = "ua_vat"
	CustomerTaxIDTypeUsEin    CustomerTaxIDType = "us_ein"
	CustomerTaxIDTypeZaVat    CustomerTaxIDType = "za_vat"
)

func (CustomerTaxIDType) IsKnown added in v0.24.0

func (r CustomerTaxIDType) IsKnown() bool

type CustomerUpdateByExternalIDParams

type CustomerUpdateByExternalIDParams struct {
	AccountingSyncConfiguration param.Field[CustomerUpdateByExternalIDParamsAccountingSyncConfiguration] `json:"accounting_sync_configuration"`
	// Additional email addresses for this customer. If populated, these email
	// addresses will be CC'd for customer communications.
	AdditionalEmails param.Field[[]string] `json:"additional_emails"`
	// Used to determine if invoices for this customer will automatically attempt to
	// charge a saved payment method, if available. This parameter defaults to `True`
	// when a payment provider is provided on customer creation.
	AutoCollection param.Field[bool]                                           `json:"auto_collection"`
	BillingAddress param.Field[CustomerUpdateByExternalIDParamsBillingAddress] `json:"billing_address"`
	// An ISO 4217 currency string used for the customer's invoices and balance. If not
	// set at creation time, will be set at subscription creation time.
	Currency param.Field[string] `json:"currency"`
	// A valid customer email, to be used for invoicing and notifications.
	Email         param.Field[string] `json:"email"`
	EmailDelivery param.Field[bool]   `json:"email_delivery"`
	// The external customer ID. This can only be set if empty and the customer has no
	// past or current subscriptions.
	ExternalCustomerID param.Field[string] `json:"external_customer_id"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// The full name of the customer
	Name param.Field[string] `json:"name"`
	// This is used for creating charges or invoices in an external system via Orb.
	// When not in test mode:
	//
	//   - the connection must first be configured in the Orb webapp.
	//   - if the provider is an invoicing provider (`stripe_invoice`, `quickbooks`,
	//     `bill.com`, `netsuite`), any product mappings must first be configured with
	//     the Orb team.
	PaymentProvider param.Field[CustomerUpdateByExternalIDParamsPaymentProvider] `json:"payment_provider"`
	// The ID of this customer in an external payments solution, such as Stripe. This
	// is used for creating charges or invoices in the external system via Orb.
	PaymentProviderID      param.Field[string]                                                 `json:"payment_provider_id"`
	ReportingConfiguration param.Field[CustomerUpdateByExternalIDParamsReportingConfiguration] `json:"reporting_configuration"`
	ShippingAddress        param.Field[CustomerUpdateByExternalIDParamsShippingAddress]        `json:"shipping_address"`
	// Tax IDs are commonly required to be displayed on customer invoices, which are
	// added to the headers of invoices.
	//
	// ### Supported Tax ID Countries and Types
	//
	// | Country              | Type         | Description                                                                                             |
	// | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
	// | Andorra              | `ad_nrt`     | Andorran NRT number                                                                                     |
	// | Australia            | `au_abn`     | Australian Business Number (AU ABN)                                                                     |
	// | Australia            | `au_arn`     | Australian Taxation Office Reference Number                                                             |
	// | Austria              | `eu_vat`     | European VAT number                                                                                     |
	// | Belgium              | `eu_vat`     | European VAT number                                                                                     |
	// | Brazil               | `br_cnpj`    | Brazilian CNPJ number                                                                                   |
	// | Brazil               | `br_cpf`     | Brazilian CPF number                                                                                    |
	// | Bulgaria             | `bg_uic`     | Bulgaria Unified Identification Code                                                                    |
	// | Bulgaria             | `eu_vat`     | European VAT number                                                                                     |
	// | Canada               | `ca_bn`      | Canadian BN                                                                                             |
	// | Canada               | `ca_gst_hst` | Canadian GST/HST number                                                                                 |
	// | Canada               | `ca_pst_bc`  | Canadian PST number (British Columbia)                                                                  |
	// | Canada               | `ca_pst_mb`  | Canadian PST number (Manitoba)                                                                          |
	// | Canada               | `ca_pst_sk`  | Canadian PST number (Saskatchewan)                                                                      |
	// | Canada               | `ca_qst`     | Canadian QST number (Québec)                                                                            |
	// | Chile                | `cl_tin`     | Chilean TIN                                                                                             |
	// | Croatia              | `eu_vat`     | European VAT number                                                                                     |
	// | Cyprus               | `eu_vat`     | European VAT number                                                                                     |
	// | Czech Republic       | `eu_vat`     | European VAT number                                                                                     |
	// | Denmark              | `eu_vat`     | European VAT number                                                                                     |
	// | Egypt                | `eg_tin`     | Egyptian Tax Identification Number                                                                      |
	// | Estonia              | `eu_vat`     | European VAT number                                                                                     |
	// | EU                   | `eu_oss_vat` | European One Stop Shop VAT number for non-Union scheme                                                  |
	// | Finland              | `eu_vat`     | European VAT number                                                                                     |
	// | France               | `eu_vat`     | European VAT number                                                                                     |
	// | Georgia              | `ge_vat`     | Georgian VAT                                                                                            |
	// | Germany              | `eu_vat`     | European VAT number                                                                                     |
	// | Greece               | `eu_vat`     | European VAT number                                                                                     |
	// | Hong Kong            | `hk_br`      | Hong Kong BR number                                                                                     |
	// | Hungary              | `eu_vat`     | European VAT number                                                                                     |
	// | Hungary              | `hu_tin`     | Hungary tax number (adószám)                                                                            |
	// | Iceland              | `is_vat`     | Icelandic VAT                                                                                           |
	// | India                | `in_gst`     | Indian GST number                                                                                       |
	// | Indonesia            | `id_npwp`    | Indonesian NPWP number                                                                                  |
	// | Ireland              | `eu_vat`     | European VAT number                                                                                     |
	// | Israel               | `il_vat`     | Israel VAT                                                                                              |
	// | Italy                | `eu_vat`     | European VAT number                                                                                     |
	// | Japan                | `jp_cn`      | Japanese Corporate Number (_Hōjin Bangō_)                                                               |
	// | Japan                | `jp_rn`      | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
	// | Japan                | `jp_trn`     | Japanese Tax Registration Number (_Tōroku Bangō_)                                                       |
	// | Kenya                | `ke_pin`     | Kenya Revenue Authority Personal Identification Number                                                  |
	// | Latvia               | `eu_vat`     | European VAT number                                                                                     |
	// | Liechtenstein        | `li_uid`     | Liechtensteinian UID number                                                                             |
	// | Lithuania            | `eu_vat`     | European VAT number                                                                                     |
	// | Luxembourg           | `eu_vat`     | European VAT number                                                                                     |
	// | Malaysia             | `my_frp`     | Malaysian FRP number                                                                                    |
	// | Malaysia             | `my_itn`     | Malaysian ITN                                                                                           |
	// | Malaysia             | `my_sst`     | Malaysian SST number                                                                                    |
	// | Malta                | `eu_vat `    | European VAT number                                                                                     |
	// | Mexico               | `mx_rfc`     | Mexican RFC number                                                                                      |
	// | Netherlands          | `eu_vat`     | European VAT number                                                                                     |
	// | New Zealand          | `nz_gst`     | New Zealand GST number                                                                                  |
	// | Norway               | `no_vat`     | Norwegian VAT number                                                                                    |
	// | Philippines          | `ph_tin `    | Philippines Tax Identification Number                                                                   |
	// | Poland               | `eu_vat`     | European VAT number                                                                                     |
	// | Portugal             | `eu_vat`     | European VAT number                                                                                     |
	// | Romania              | `eu_vat`     | European VAT number                                                                                     |
	// | Russia               | `ru_inn`     | Russian INN                                                                                             |
	// | Russia               | `ru_kpp`     | Russian KPP                                                                                             |
	// | Saudi Arabia         | `sg_gst`     | Singaporean GST                                                                                         |
	// | Singapore            | `sg_uen`     | Singaporean UEN                                                                                         |
	// | Slovakia             | `eu_vat`     | European VAT number                                                                                     |
	// | Slovenia             | `eu_vat`     | European VAT number                                                                                     |
	// | Slovenia             | `si_tin`     | Slovenia tax number (davčna številka)                                                                   |
	// | South Africa         | `za_vat`     | South African VAT number                                                                                |
	// | South Korea          | `kr_brn`     | Korean BRN                                                                                              |
	// | Spain                | `es_cif`     | Spanish NIF number (previously Spanish CIF number)                                                      |
	// | Spain                | `eu_vat`     | European VAT number                                                                                     |
	// | Sweden               | `eu_vat`     | European VAT number                                                                                     |
	// | Switzerland          | `ch_vat`     | Switzerland VAT number                                                                                  |
	// | Taiwan               | `tw_vat`     | Taiwanese VAT                                                                                           |
	// | Thailand             | `th_vat`     | Thai VAT                                                                                                |
	// | Turkey               | `tr_tin`     | Turkish Tax Identification Number                                                                       |
	// | Ukraine              | `ua_vat`     | Ukrainian VAT                                                                                           |
	// | United Arab Emirates | `ae_trn`     | United Arab Emirates TRN                                                                                |
	// | United Kingdom       | `eu_vat`     | Northern Ireland VAT number                                                                             |
	// | United Kingdom       | `gb_vat`     | United Kingdom VAT number                                                                               |
	// | United States        | `us_ein`     | United States EIN                                                                                       |
	TaxID param.Field[CustomerUpdateByExternalIDParamsTaxID] `json:"tax_id"`
}

func (CustomerUpdateByExternalIDParams) MarshalJSON

func (r CustomerUpdateByExternalIDParams) MarshalJSON() (data []byte, err error)

type CustomerUpdateByExternalIDParamsAccountingSyncConfiguration

type CustomerUpdateByExternalIDParamsAccountingSyncConfiguration struct {
	AccountingProviders param.Field[[]CustomerUpdateByExternalIDParamsAccountingSyncConfigurationAccountingProvider] `json:"accounting_providers"`
	Excluded            param.Field[bool]                                                                            `json:"excluded"`
}

func (CustomerUpdateByExternalIDParamsAccountingSyncConfiguration) MarshalJSON

type CustomerUpdateByExternalIDParamsAccountingSyncConfigurationAccountingProvider

type CustomerUpdateByExternalIDParamsAccountingSyncConfigurationAccountingProvider struct {
	ExternalProviderID param.Field[string] `json:"external_provider_id,required"`
	ProviderType       param.Field[string] `json:"provider_type,required"`
}

func (CustomerUpdateByExternalIDParamsAccountingSyncConfigurationAccountingProvider) MarshalJSON

type CustomerUpdateByExternalIDParamsBillingAddress

type CustomerUpdateByExternalIDParamsBillingAddress struct {
	City       param.Field[string] `json:"city"`
	Country    param.Field[string] `json:"country"`
	Line1      param.Field[string] `json:"line1"`
	Line2      param.Field[string] `json:"line2"`
	PostalCode param.Field[string] `json:"postal_code"`
	State      param.Field[string] `json:"state"`
}

func (CustomerUpdateByExternalIDParamsBillingAddress) MarshalJSON

func (r CustomerUpdateByExternalIDParamsBillingAddress) MarshalJSON() (data []byte, err error)

type CustomerUpdateByExternalIDParamsPaymentProvider

type CustomerUpdateByExternalIDParamsPaymentProvider string

This is used for creating charges or invoices in an external system via Orb. When not in test mode:

  • the connection must first be configured in the Orb webapp.
  • if the provider is an invoicing provider (`stripe_invoice`, `quickbooks`, `bill.com`, `netsuite`), any product mappings must first be configured with the Orb team.
const (
	CustomerUpdateByExternalIDParamsPaymentProviderQuickbooks    CustomerUpdateByExternalIDParamsPaymentProvider = "quickbooks"
	CustomerUpdateByExternalIDParamsPaymentProviderBillCom       CustomerUpdateByExternalIDParamsPaymentProvider = "bill.com"
	CustomerUpdateByExternalIDParamsPaymentProviderStripeCharge  CustomerUpdateByExternalIDParamsPaymentProvider = "stripe_charge"
	CustomerUpdateByExternalIDParamsPaymentProviderStripeInvoice CustomerUpdateByExternalIDParamsPaymentProvider = "stripe_invoice"
	CustomerUpdateByExternalIDParamsPaymentProviderNetsuite      CustomerUpdateByExternalIDParamsPaymentProvider = "netsuite"
)

func (CustomerUpdateByExternalIDParamsPaymentProvider) IsKnown added in v0.24.0

type CustomerUpdateByExternalIDParamsReportingConfiguration

type CustomerUpdateByExternalIDParamsReportingConfiguration struct {
	Exempt param.Field[bool] `json:"exempt,required"`
}

func (CustomerUpdateByExternalIDParamsReportingConfiguration) MarshalJSON

type CustomerUpdateByExternalIDParamsShippingAddress

type CustomerUpdateByExternalIDParamsShippingAddress struct {
	City       param.Field[string] `json:"city"`
	Country    param.Field[string] `json:"country"`
	Line1      param.Field[string] `json:"line1"`
	Line2      param.Field[string] `json:"line2"`
	PostalCode param.Field[string] `json:"postal_code"`
	State      param.Field[string] `json:"state"`
}

func (CustomerUpdateByExternalIDParamsShippingAddress) MarshalJSON

func (r CustomerUpdateByExternalIDParamsShippingAddress) MarshalJSON() (data []byte, err error)

type CustomerUpdateByExternalIDParamsTaxID

type CustomerUpdateByExternalIDParamsTaxID struct {
	Country param.Field[CustomerUpdateByExternalIDParamsTaxIDCountry] `json:"country,required"`
	Type    param.Field[CustomerUpdateByExternalIDParamsTaxIDType]    `json:"type,required"`
	Value   param.Field[string]                                       `json:"value,required"`
}

Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices.

### Supported Tax ID Countries and Types

| Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | | Belgium | `eu_vat` | European VAT number | | Brazil | `br_cnpj` | Brazilian CNPJ number | | Brazil | `br_cpf` | Brazilian CPF number | | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | | Bulgaria | `eu_vat` | European VAT number | | Canada | `ca_bn` | Canadian BN | | Canada | `ca_gst_hst` | Canadian GST/HST number | | Canada | `ca_pst_bc` | Canadian PST number (British Columbia) | | Canada | `ca_pst_mb` | Canadian PST number (Manitoba) | | Canada | `ca_pst_sk` | Canadian PST number (Saskatchewan) | | Canada | `ca_qst` | Canadian QST number (Québec) | | Chile | `cl_tin` | Chilean TIN | | Croatia | `eu_vat` | European VAT number | | Cyprus | `eu_vat` | European VAT number | | Czech Republic | `eu_vat` | European VAT number | | Denmark | `eu_vat` | European VAT number | | Egypt | `eg_tin` | Egyptian Tax Identification Number | | Estonia | `eu_vat` | European VAT number | | EU | `eu_oss_vat` | European One Stop Shop VAT number for non-Union scheme | | Finland | `eu_vat` | European VAT number | | France | `eu_vat` | European VAT number | | Georgia | `ge_vat` | Georgian VAT | | Germany | `eu_vat` | European VAT number | | Greece | `eu_vat` | European VAT number | | Hong Kong | `hk_br` | Hong Kong BR number | | Hungary | `eu_vat` | European VAT number | | Hungary | `hu_tin` | Hungary tax number (adószám) | | Iceland | `is_vat` | Icelandic VAT | | India | `in_gst` | Indian GST number | | Indonesia | `id_npwp` | Indonesian NPWP number | | Ireland | `eu_vat` | European VAT number | | Israel | `il_vat` | Israel VAT | | Italy | `eu_vat` | European VAT number | | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | | Latvia | `eu_vat` | European VAT number | | Liechtenstein | `li_uid` | Liechtensteinian UID number | | Lithuania | `eu_vat` | European VAT number | | Luxembourg | `eu_vat` | European VAT number | | Malaysia | `my_frp` | Malaysian FRP number | | Malaysia | `my_itn` | Malaysian ITN | | Malaysia | `my_sst` | Malaysian SST number | | Malta | `eu_vat ` | European VAT number | | Mexico | `mx_rfc` | Mexican RFC number | | Netherlands | `eu_vat` | European VAT number | | New Zealand | `nz_gst` | New Zealand GST number | | Norway | `no_vat` | Norwegian VAT number | | Philippines | `ph_tin ` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT number | | Portugal | `eu_vat` | European VAT number | | Romania | `eu_vat` | European VAT number | | Russia | `ru_inn` | Russian INN | | Russia | `ru_kpp` | Russian KPP | | Saudi Arabia | `sg_gst` | Singaporean GST | | Singapore | `sg_uen` | Singaporean UEN | | Slovakia | `eu_vat` | European VAT number | | Slovenia | `eu_vat` | European VAT number | | Slovenia | `si_tin` | Slovenia tax number (davčna številka) | | South Africa | `za_vat` | South African VAT number | | South Korea | `kr_brn` | Korean BRN | | Spain | `es_cif` | Spanish NIF number (previously Spanish CIF number) | | Spain | `eu_vat` | European VAT number | | Sweden | `eu_vat` | European VAT number | | Switzerland | `ch_vat` | Switzerland VAT number | | Taiwan | `tw_vat` | Taiwanese VAT | | Thailand | `th_vat` | Thai VAT | | Turkey | `tr_tin` | Turkish Tax Identification Number | | Ukraine | `ua_vat` | Ukrainian VAT | | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | | United Kingdom | `eu_vat` | Northern Ireland VAT number | | United Kingdom | `gb_vat` | United Kingdom VAT number | | United States | `us_ein` | United States EIN |

func (CustomerUpdateByExternalIDParamsTaxID) MarshalJSON

func (r CustomerUpdateByExternalIDParamsTaxID) MarshalJSON() (data []byte, err error)

type CustomerUpdateByExternalIDParamsTaxIDCountry added in v0.2.0

type CustomerUpdateByExternalIDParamsTaxIDCountry string
const (
	CustomerUpdateByExternalIDParamsTaxIDCountryAd CustomerUpdateByExternalIDParamsTaxIDCountry = "AD"
	CustomerUpdateByExternalIDParamsTaxIDCountryAe CustomerUpdateByExternalIDParamsTaxIDCountry = "AE"
	CustomerUpdateByExternalIDParamsTaxIDCountryAt CustomerUpdateByExternalIDParamsTaxIDCountry = "AT"
	CustomerUpdateByExternalIDParamsTaxIDCountryAu CustomerUpdateByExternalIDParamsTaxIDCountry = "AU"
	CustomerUpdateByExternalIDParamsTaxIDCountryBe CustomerUpdateByExternalIDParamsTaxIDCountry = "BE"
	CustomerUpdateByExternalIDParamsTaxIDCountryBg CustomerUpdateByExternalIDParamsTaxIDCountry = "BG"
	CustomerUpdateByExternalIDParamsTaxIDCountryBr CustomerUpdateByExternalIDParamsTaxIDCountry = "BR"
	CustomerUpdateByExternalIDParamsTaxIDCountryCa CustomerUpdateByExternalIDParamsTaxIDCountry = "CA"
	CustomerUpdateByExternalIDParamsTaxIDCountryCh CustomerUpdateByExternalIDParamsTaxIDCountry = "CH"
	CustomerUpdateByExternalIDParamsTaxIDCountryCl CustomerUpdateByExternalIDParamsTaxIDCountry = "CL"
	CustomerUpdateByExternalIDParamsTaxIDCountryCy CustomerUpdateByExternalIDParamsTaxIDCountry = "CY"
	CustomerUpdateByExternalIDParamsTaxIDCountryCz CustomerUpdateByExternalIDParamsTaxIDCountry = "CZ"
	CustomerUpdateByExternalIDParamsTaxIDCountryDe CustomerUpdateByExternalIDParamsTaxIDCountry = "DE"
	CustomerUpdateByExternalIDParamsTaxIDCountryDk CustomerUpdateByExternalIDParamsTaxIDCountry = "DK"
	CustomerUpdateByExternalIDParamsTaxIDCountryEe CustomerUpdateByExternalIDParamsTaxIDCountry = "EE"
	CustomerUpdateByExternalIDParamsTaxIDCountryEg CustomerUpdateByExternalIDParamsTaxIDCountry = "EG"
	CustomerUpdateByExternalIDParamsTaxIDCountryEs CustomerUpdateByExternalIDParamsTaxIDCountry = "ES"
	CustomerUpdateByExternalIDParamsTaxIDCountryEu CustomerUpdateByExternalIDParamsTaxIDCountry = "EU"
	CustomerUpdateByExternalIDParamsTaxIDCountryFi CustomerUpdateByExternalIDParamsTaxIDCountry = "FI"
	CustomerUpdateByExternalIDParamsTaxIDCountryFr CustomerUpdateByExternalIDParamsTaxIDCountry = "FR"
	CustomerUpdateByExternalIDParamsTaxIDCountryGB CustomerUpdateByExternalIDParamsTaxIDCountry = "GB"
	CustomerUpdateByExternalIDParamsTaxIDCountryGe CustomerUpdateByExternalIDParamsTaxIDCountry = "GE"
	CustomerUpdateByExternalIDParamsTaxIDCountryGr CustomerUpdateByExternalIDParamsTaxIDCountry = "GR"
	CustomerUpdateByExternalIDParamsTaxIDCountryHk CustomerUpdateByExternalIDParamsTaxIDCountry = "HK"
	CustomerUpdateByExternalIDParamsTaxIDCountryHr CustomerUpdateByExternalIDParamsTaxIDCountry = "HR"
	CustomerUpdateByExternalIDParamsTaxIDCountryHu CustomerUpdateByExternalIDParamsTaxIDCountry = "HU"
	CustomerUpdateByExternalIDParamsTaxIDCountryID CustomerUpdateByExternalIDParamsTaxIDCountry = "ID"
	CustomerUpdateByExternalIDParamsTaxIDCountryIe CustomerUpdateByExternalIDParamsTaxIDCountry = "IE"
	CustomerUpdateByExternalIDParamsTaxIDCountryIl CustomerUpdateByExternalIDParamsTaxIDCountry = "IL"
	CustomerUpdateByExternalIDParamsTaxIDCountryIn CustomerUpdateByExternalIDParamsTaxIDCountry = "IN"
	CustomerUpdateByExternalIDParamsTaxIDCountryIs CustomerUpdateByExternalIDParamsTaxIDCountry = "IS"
	CustomerUpdateByExternalIDParamsTaxIDCountryIt CustomerUpdateByExternalIDParamsTaxIDCountry = "IT"
	CustomerUpdateByExternalIDParamsTaxIDCountryJp CustomerUpdateByExternalIDParamsTaxIDCountry = "JP"
	CustomerUpdateByExternalIDParamsTaxIDCountryKe CustomerUpdateByExternalIDParamsTaxIDCountry = "KE"
	CustomerUpdateByExternalIDParamsTaxIDCountryKr CustomerUpdateByExternalIDParamsTaxIDCountry = "KR"
	CustomerUpdateByExternalIDParamsTaxIDCountryLi CustomerUpdateByExternalIDParamsTaxIDCountry = "LI"
	CustomerUpdateByExternalIDParamsTaxIDCountryLt CustomerUpdateByExternalIDParamsTaxIDCountry = "LT"
	CustomerUpdateByExternalIDParamsTaxIDCountryLu CustomerUpdateByExternalIDParamsTaxIDCountry = "LU"
	CustomerUpdateByExternalIDParamsTaxIDCountryLv CustomerUpdateByExternalIDParamsTaxIDCountry = "LV"
	CustomerUpdateByExternalIDParamsTaxIDCountryMt CustomerUpdateByExternalIDParamsTaxIDCountry = "MT"
	CustomerUpdateByExternalIDParamsTaxIDCountryMx CustomerUpdateByExternalIDParamsTaxIDCountry = "MX"
	CustomerUpdateByExternalIDParamsTaxIDCountryMy CustomerUpdateByExternalIDParamsTaxIDCountry = "MY"
	CustomerUpdateByExternalIDParamsTaxIDCountryNl CustomerUpdateByExternalIDParamsTaxIDCountry = "NL"
	CustomerUpdateByExternalIDParamsTaxIDCountryNo CustomerUpdateByExternalIDParamsTaxIDCountry = "NO"
	CustomerUpdateByExternalIDParamsTaxIDCountryNz CustomerUpdateByExternalIDParamsTaxIDCountry = "NZ"
	CustomerUpdateByExternalIDParamsTaxIDCountryPh CustomerUpdateByExternalIDParamsTaxIDCountry = "PH"
	CustomerUpdateByExternalIDParamsTaxIDCountryPl CustomerUpdateByExternalIDParamsTaxIDCountry = "PL"
	CustomerUpdateByExternalIDParamsTaxIDCountryPt CustomerUpdateByExternalIDParamsTaxIDCountry = "PT"
	CustomerUpdateByExternalIDParamsTaxIDCountryRo CustomerUpdateByExternalIDParamsTaxIDCountry = "RO"
	CustomerUpdateByExternalIDParamsTaxIDCountryRu CustomerUpdateByExternalIDParamsTaxIDCountry = "RU"
	CustomerUpdateByExternalIDParamsTaxIDCountrySa CustomerUpdateByExternalIDParamsTaxIDCountry = "SA"
	CustomerUpdateByExternalIDParamsTaxIDCountrySe CustomerUpdateByExternalIDParamsTaxIDCountry = "SE"
	CustomerUpdateByExternalIDParamsTaxIDCountrySg CustomerUpdateByExternalIDParamsTaxIDCountry = "SG"
	CustomerUpdateByExternalIDParamsTaxIDCountrySi CustomerUpdateByExternalIDParamsTaxIDCountry = "SI"
	CustomerUpdateByExternalIDParamsTaxIDCountrySk CustomerUpdateByExternalIDParamsTaxIDCountry = "SK"
	CustomerUpdateByExternalIDParamsTaxIDCountryTh CustomerUpdateByExternalIDParamsTaxIDCountry = "TH"
	CustomerUpdateByExternalIDParamsTaxIDCountryTr CustomerUpdateByExternalIDParamsTaxIDCountry = "TR"
	CustomerUpdateByExternalIDParamsTaxIDCountryTw CustomerUpdateByExternalIDParamsTaxIDCountry = "TW"
	CustomerUpdateByExternalIDParamsTaxIDCountryUa CustomerUpdateByExternalIDParamsTaxIDCountry = "UA"
	CustomerUpdateByExternalIDParamsTaxIDCountryUs CustomerUpdateByExternalIDParamsTaxIDCountry = "US"
	CustomerUpdateByExternalIDParamsTaxIDCountryZa CustomerUpdateByExternalIDParamsTaxIDCountry = "ZA"
)

func (CustomerUpdateByExternalIDParamsTaxIDCountry) IsKnown added in v0.24.0

type CustomerUpdateByExternalIDParamsTaxIDType added in v0.2.0

type CustomerUpdateByExternalIDParamsTaxIDType string
const (
	CustomerUpdateByExternalIDParamsTaxIDTypeAdNrt    CustomerUpdateByExternalIDParamsTaxIDType = "ad_nrt"
	CustomerUpdateByExternalIDParamsTaxIDTypeAeTrn    CustomerUpdateByExternalIDParamsTaxIDType = "ae_trn"
	CustomerUpdateByExternalIDParamsTaxIDTypeEuVat    CustomerUpdateByExternalIDParamsTaxIDType = "eu_vat"
	CustomerUpdateByExternalIDParamsTaxIDTypeAuAbn    CustomerUpdateByExternalIDParamsTaxIDType = "au_abn"
	CustomerUpdateByExternalIDParamsTaxIDTypeAuArn    CustomerUpdateByExternalIDParamsTaxIDType = "au_arn"
	CustomerUpdateByExternalIDParamsTaxIDTypeBgUic    CustomerUpdateByExternalIDParamsTaxIDType = "bg_uic"
	CustomerUpdateByExternalIDParamsTaxIDTypeBrCnpj   CustomerUpdateByExternalIDParamsTaxIDType = "br_cnpj"
	CustomerUpdateByExternalIDParamsTaxIDTypeBrCpf    CustomerUpdateByExternalIDParamsTaxIDType = "br_cpf"
	CustomerUpdateByExternalIDParamsTaxIDTypeCaBn     CustomerUpdateByExternalIDParamsTaxIDType = "ca_bn"
	CustomerUpdateByExternalIDParamsTaxIDTypeCaGstHst CustomerUpdateByExternalIDParamsTaxIDType = "ca_gst_hst"
	CustomerUpdateByExternalIDParamsTaxIDTypeCaPstBc  CustomerUpdateByExternalIDParamsTaxIDType = "ca_pst_bc"
	CustomerUpdateByExternalIDParamsTaxIDTypeCaPstMB  CustomerUpdateByExternalIDParamsTaxIDType = "ca_pst_mb"
	CustomerUpdateByExternalIDParamsTaxIDTypeCaPstSk  CustomerUpdateByExternalIDParamsTaxIDType = "ca_pst_sk"
	CustomerUpdateByExternalIDParamsTaxIDTypeCaQst    CustomerUpdateByExternalIDParamsTaxIDType = "ca_qst"
	CustomerUpdateByExternalIDParamsTaxIDTypeChVat    CustomerUpdateByExternalIDParamsTaxIDType = "ch_vat"
	CustomerUpdateByExternalIDParamsTaxIDTypeClTin    CustomerUpdateByExternalIDParamsTaxIDType = "cl_tin"
	CustomerUpdateByExternalIDParamsTaxIDTypeEgTin    CustomerUpdateByExternalIDParamsTaxIDType = "eg_tin"
	CustomerUpdateByExternalIDParamsTaxIDTypeEsCif    CustomerUpdateByExternalIDParamsTaxIDType = "es_cif"
	CustomerUpdateByExternalIDParamsTaxIDTypeEuOssVat CustomerUpdateByExternalIDParamsTaxIDType = "eu_oss_vat"
	CustomerUpdateByExternalIDParamsTaxIDTypeGBVat    CustomerUpdateByExternalIDParamsTaxIDType = "gb_vat"
	CustomerUpdateByExternalIDParamsTaxIDTypeGeVat    CustomerUpdateByExternalIDParamsTaxIDType = "ge_vat"
	CustomerUpdateByExternalIDParamsTaxIDTypeHkBr     CustomerUpdateByExternalIDParamsTaxIDType = "hk_br"
	CustomerUpdateByExternalIDParamsTaxIDTypeHuTin    CustomerUpdateByExternalIDParamsTaxIDType = "hu_tin"
	CustomerUpdateByExternalIDParamsTaxIDTypeIDNpwp   CustomerUpdateByExternalIDParamsTaxIDType = "id_npwp"
	CustomerUpdateByExternalIDParamsTaxIDTypeIlVat    CustomerUpdateByExternalIDParamsTaxIDType = "il_vat"
	CustomerUpdateByExternalIDParamsTaxIDTypeInGst    CustomerUpdateByExternalIDParamsTaxIDType = "in_gst"
	CustomerUpdateByExternalIDParamsTaxIDTypeIsVat    CustomerUpdateByExternalIDParamsTaxIDType = "is_vat"
	CustomerUpdateByExternalIDParamsTaxIDTypeJpCn     CustomerUpdateByExternalIDParamsTaxIDType = "jp_cn"
	CustomerUpdateByExternalIDParamsTaxIDTypeJpRn     CustomerUpdateByExternalIDParamsTaxIDType = "jp_rn"
	CustomerUpdateByExternalIDParamsTaxIDTypeJpTrn    CustomerUpdateByExternalIDParamsTaxIDType = "jp_trn"
	CustomerUpdateByExternalIDParamsTaxIDTypeKePin    CustomerUpdateByExternalIDParamsTaxIDType = "ke_pin"
	CustomerUpdateByExternalIDParamsTaxIDTypeKrBrn    CustomerUpdateByExternalIDParamsTaxIDType = "kr_brn"
	CustomerUpdateByExternalIDParamsTaxIDTypeLiUid    CustomerUpdateByExternalIDParamsTaxIDType = "li_uid"
	CustomerUpdateByExternalIDParamsTaxIDTypeMxRfc    CustomerUpdateByExternalIDParamsTaxIDType = "mx_rfc"
	CustomerUpdateByExternalIDParamsTaxIDTypeMyFrp    CustomerUpdateByExternalIDParamsTaxIDType = "my_frp"
	CustomerUpdateByExternalIDParamsTaxIDTypeMyItn    CustomerUpdateByExternalIDParamsTaxIDType = "my_itn"
	CustomerUpdateByExternalIDParamsTaxIDTypeMySst    CustomerUpdateByExternalIDParamsTaxIDType = "my_sst"
	CustomerUpdateByExternalIDParamsTaxIDTypeNoVat    CustomerUpdateByExternalIDParamsTaxIDType = "no_vat"
	CustomerUpdateByExternalIDParamsTaxIDTypeNzGst    CustomerUpdateByExternalIDParamsTaxIDType = "nz_gst"
	CustomerUpdateByExternalIDParamsTaxIDTypePhTin    CustomerUpdateByExternalIDParamsTaxIDType = "ph_tin"
	CustomerUpdateByExternalIDParamsTaxIDTypeRuInn    CustomerUpdateByExternalIDParamsTaxIDType = "ru_inn"
	CustomerUpdateByExternalIDParamsTaxIDTypeRuKpp    CustomerUpdateByExternalIDParamsTaxIDType = "ru_kpp"
	CustomerUpdateByExternalIDParamsTaxIDTypeSaVat    CustomerUpdateByExternalIDParamsTaxIDType = "sa_vat"
	CustomerUpdateByExternalIDParamsTaxIDTypeSgGst    CustomerUpdateByExternalIDParamsTaxIDType = "sg_gst"
	CustomerUpdateByExternalIDParamsTaxIDTypeSgUen    CustomerUpdateByExternalIDParamsTaxIDType = "sg_uen"
	CustomerUpdateByExternalIDParamsTaxIDTypeSiTin    CustomerUpdateByExternalIDParamsTaxIDType = "si_tin"
	CustomerUpdateByExternalIDParamsTaxIDTypeThVat    CustomerUpdateByExternalIDParamsTaxIDType = "th_vat"
	CustomerUpdateByExternalIDParamsTaxIDTypeTrTin    CustomerUpdateByExternalIDParamsTaxIDType = "tr_tin"
	CustomerUpdateByExternalIDParamsTaxIDTypeTwVat    CustomerUpdateByExternalIDParamsTaxIDType = "tw_vat"
	CustomerUpdateByExternalIDParamsTaxIDTypeUaVat    CustomerUpdateByExternalIDParamsTaxIDType = "ua_vat"
	CustomerUpdateByExternalIDParamsTaxIDTypeUsEin    CustomerUpdateByExternalIDParamsTaxIDType = "us_ein"
	CustomerUpdateByExternalIDParamsTaxIDTypeZaVat    CustomerUpdateByExternalIDParamsTaxIDType = "za_vat"
)

func (CustomerUpdateByExternalIDParamsTaxIDType) IsKnown added in v0.24.0

type CustomerUpdateParams

type CustomerUpdateParams struct {
	AccountingSyncConfiguration param.Field[CustomerUpdateParamsAccountingSyncConfiguration] `json:"accounting_sync_configuration"`
	// Additional email addresses for this customer. If populated, these email
	// addresses will be CC'd for customer communications.
	AdditionalEmails param.Field[[]string] `json:"additional_emails"`
	// Used to determine if invoices for this customer will automatically attempt to
	// charge a saved payment method, if available. This parameter defaults to `True`
	// when a payment provider is provided on customer creation.
	AutoCollection param.Field[bool]                               `json:"auto_collection"`
	BillingAddress param.Field[CustomerUpdateParamsBillingAddress] `json:"billing_address"`
	// An ISO 4217 currency string used for the customer's invoices and balance. If not
	// set at creation time, will be set at subscription creation time.
	Currency param.Field[string] `json:"currency"`
	// A valid customer email, to be used for invoicing and notifications.
	Email         param.Field[string] `json:"email"`
	EmailDelivery param.Field[bool]   `json:"email_delivery"`
	// The external customer ID. This can only be set if empty and the customer has no
	// past or current subscriptions.
	ExternalCustomerID param.Field[string] `json:"external_customer_id"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// The full name of the customer
	Name param.Field[string] `json:"name"`
	// This is used for creating charges or invoices in an external system via Orb.
	// When not in test mode:
	//
	//   - the connection must first be configured in the Orb webapp.
	//   - if the provider is an invoicing provider (`stripe_invoice`, `quickbooks`,
	//     `bill.com`, `netsuite`), any product mappings must first be configured with
	//     the Orb team.
	PaymentProvider param.Field[CustomerUpdateParamsPaymentProvider] `json:"payment_provider"`
	// The ID of this customer in an external payments solution, such as Stripe. This
	// is used for creating charges or invoices in the external system via Orb.
	PaymentProviderID      param.Field[string]                                     `json:"payment_provider_id"`
	ReportingConfiguration param.Field[CustomerUpdateParamsReportingConfiguration] `json:"reporting_configuration"`
	ShippingAddress        param.Field[CustomerUpdateParamsShippingAddress]        `json:"shipping_address"`
	// Tax IDs are commonly required to be displayed on customer invoices, which are
	// added to the headers of invoices.
	//
	// ### Supported Tax ID Countries and Types
	//
	// | Country              | Type         | Description                                                                                             |
	// | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
	// | Andorra              | `ad_nrt`     | Andorran NRT number                                                                                     |
	// | Australia            | `au_abn`     | Australian Business Number (AU ABN)                                                                     |
	// | Australia            | `au_arn`     | Australian Taxation Office Reference Number                                                             |
	// | Austria              | `eu_vat`     | European VAT number                                                                                     |
	// | Belgium              | `eu_vat`     | European VAT number                                                                                     |
	// | Brazil               | `br_cnpj`    | Brazilian CNPJ number                                                                                   |
	// | Brazil               | `br_cpf`     | Brazilian CPF number                                                                                    |
	// | Bulgaria             | `bg_uic`     | Bulgaria Unified Identification Code                                                                    |
	// | Bulgaria             | `eu_vat`     | European VAT number                                                                                     |
	// | Canada               | `ca_bn`      | Canadian BN                                                                                             |
	// | Canada               | `ca_gst_hst` | Canadian GST/HST number                                                                                 |
	// | Canada               | `ca_pst_bc`  | Canadian PST number (British Columbia)                                                                  |
	// | Canada               | `ca_pst_mb`  | Canadian PST number (Manitoba)                                                                          |
	// | Canada               | `ca_pst_sk`  | Canadian PST number (Saskatchewan)                                                                      |
	// | Canada               | `ca_qst`     | Canadian QST number (Québec)                                                                            |
	// | Chile                | `cl_tin`     | Chilean TIN                                                                                             |
	// | Croatia              | `eu_vat`     | European VAT number                                                                                     |
	// | Cyprus               | `eu_vat`     | European VAT number                                                                                     |
	// | Czech Republic       | `eu_vat`     | European VAT number                                                                                     |
	// | Denmark              | `eu_vat`     | European VAT number                                                                                     |
	// | Egypt                | `eg_tin`     | Egyptian Tax Identification Number                                                                      |
	// | Estonia              | `eu_vat`     | European VAT number                                                                                     |
	// | EU                   | `eu_oss_vat` | European One Stop Shop VAT number for non-Union scheme                                                  |
	// | Finland              | `eu_vat`     | European VAT number                                                                                     |
	// | France               | `eu_vat`     | European VAT number                                                                                     |
	// | Georgia              | `ge_vat`     | Georgian VAT                                                                                            |
	// | Germany              | `eu_vat`     | European VAT number                                                                                     |
	// | Greece               | `eu_vat`     | European VAT number                                                                                     |
	// | Hong Kong            | `hk_br`      | Hong Kong BR number                                                                                     |
	// | Hungary              | `eu_vat`     | European VAT number                                                                                     |
	// | Hungary              | `hu_tin`     | Hungary tax number (adószám)                                                                            |
	// | Iceland              | `is_vat`     | Icelandic VAT                                                                                           |
	// | India                | `in_gst`     | Indian GST number                                                                                       |
	// | Indonesia            | `id_npwp`    | Indonesian NPWP number                                                                                  |
	// | Ireland              | `eu_vat`     | European VAT number                                                                                     |
	// | Israel               | `il_vat`     | Israel VAT                                                                                              |
	// | Italy                | `eu_vat`     | European VAT number                                                                                     |
	// | Japan                | `jp_cn`      | Japanese Corporate Number (_Hōjin Bangō_)                                                               |
	// | Japan                | `jp_rn`      | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
	// | Japan                | `jp_trn`     | Japanese Tax Registration Number (_Tōroku Bangō_)                                                       |
	// | Kenya                | `ke_pin`     | Kenya Revenue Authority Personal Identification Number                                                  |
	// | Latvia               | `eu_vat`     | European VAT number                                                                                     |
	// | Liechtenstein        | `li_uid`     | Liechtensteinian UID number                                                                             |
	// | Lithuania            | `eu_vat`     | European VAT number                                                                                     |
	// | Luxembourg           | `eu_vat`     | European VAT number                                                                                     |
	// | Malaysia             | `my_frp`     | Malaysian FRP number                                                                                    |
	// | Malaysia             | `my_itn`     | Malaysian ITN                                                                                           |
	// | Malaysia             | `my_sst`     | Malaysian SST number                                                                                    |
	// | Malta                | `eu_vat `    | European VAT number                                                                                     |
	// | Mexico               | `mx_rfc`     | Mexican RFC number                                                                                      |
	// | Netherlands          | `eu_vat`     | European VAT number                                                                                     |
	// | New Zealand          | `nz_gst`     | New Zealand GST number                                                                                  |
	// | Norway               | `no_vat`     | Norwegian VAT number                                                                                    |
	// | Philippines          | `ph_tin `    | Philippines Tax Identification Number                                                                   |
	// | Poland               | `eu_vat`     | European VAT number                                                                                     |
	// | Portugal             | `eu_vat`     | European VAT number                                                                                     |
	// | Romania              | `eu_vat`     | European VAT number                                                                                     |
	// | Russia               | `ru_inn`     | Russian INN                                                                                             |
	// | Russia               | `ru_kpp`     | Russian KPP                                                                                             |
	// | Saudi Arabia         | `sg_gst`     | Singaporean GST                                                                                         |
	// | Singapore            | `sg_uen`     | Singaporean UEN                                                                                         |
	// | Slovakia             | `eu_vat`     | European VAT number                                                                                     |
	// | Slovenia             | `eu_vat`     | European VAT number                                                                                     |
	// | Slovenia             | `si_tin`     | Slovenia tax number (davčna številka)                                                                   |
	// | South Africa         | `za_vat`     | South African VAT number                                                                                |
	// | South Korea          | `kr_brn`     | Korean BRN                                                                                              |
	// | Spain                | `es_cif`     | Spanish NIF number (previously Spanish CIF number)                                                      |
	// | Spain                | `eu_vat`     | European VAT number                                                                                     |
	// | Sweden               | `eu_vat`     | European VAT number                                                                                     |
	// | Switzerland          | `ch_vat`     | Switzerland VAT number                                                                                  |
	// | Taiwan               | `tw_vat`     | Taiwanese VAT                                                                                           |
	// | Thailand             | `th_vat`     | Thai VAT                                                                                                |
	// | Turkey               | `tr_tin`     | Turkish Tax Identification Number                                                                       |
	// | Ukraine              | `ua_vat`     | Ukrainian VAT                                                                                           |
	// | United Arab Emirates | `ae_trn`     | United Arab Emirates TRN                                                                                |
	// | United Kingdom       | `eu_vat`     | Northern Ireland VAT number                                                                             |
	// | United Kingdom       | `gb_vat`     | United Kingdom VAT number                                                                               |
	// | United States        | `us_ein`     | United States EIN                                                                                       |
	TaxID param.Field[CustomerUpdateParamsTaxID] `json:"tax_id"`
}

func (CustomerUpdateParams) MarshalJSON

func (r CustomerUpdateParams) MarshalJSON() (data []byte, err error)

type CustomerUpdateParamsAccountingSyncConfiguration

type CustomerUpdateParamsAccountingSyncConfiguration struct {
	AccountingProviders param.Field[[]CustomerUpdateParamsAccountingSyncConfigurationAccountingProvider] `json:"accounting_providers"`
	Excluded            param.Field[bool]                                                                `json:"excluded"`
}

func (CustomerUpdateParamsAccountingSyncConfiguration) MarshalJSON

func (r CustomerUpdateParamsAccountingSyncConfiguration) MarshalJSON() (data []byte, err error)

type CustomerUpdateParamsAccountingSyncConfigurationAccountingProvider

type CustomerUpdateParamsAccountingSyncConfigurationAccountingProvider struct {
	ExternalProviderID param.Field[string] `json:"external_provider_id,required"`
	ProviderType       param.Field[string] `json:"provider_type,required"`
}

func (CustomerUpdateParamsAccountingSyncConfigurationAccountingProvider) MarshalJSON

type CustomerUpdateParamsBillingAddress

type CustomerUpdateParamsBillingAddress struct {
	City       param.Field[string] `json:"city"`
	Country    param.Field[string] `json:"country"`
	Line1      param.Field[string] `json:"line1"`
	Line2      param.Field[string] `json:"line2"`
	PostalCode param.Field[string] `json:"postal_code"`
	State      param.Field[string] `json:"state"`
}

func (CustomerUpdateParamsBillingAddress) MarshalJSON

func (r CustomerUpdateParamsBillingAddress) MarshalJSON() (data []byte, err error)

type CustomerUpdateParamsPaymentProvider

type CustomerUpdateParamsPaymentProvider string

This is used for creating charges or invoices in an external system via Orb. When not in test mode:

  • the connection must first be configured in the Orb webapp.
  • if the provider is an invoicing provider (`stripe_invoice`, `quickbooks`, `bill.com`, `netsuite`), any product mappings must first be configured with the Orb team.
const (
	CustomerUpdateParamsPaymentProviderQuickbooks    CustomerUpdateParamsPaymentProvider = "quickbooks"
	CustomerUpdateParamsPaymentProviderBillCom       CustomerUpdateParamsPaymentProvider = "bill.com"
	CustomerUpdateParamsPaymentProviderStripeCharge  CustomerUpdateParamsPaymentProvider = "stripe_charge"
	CustomerUpdateParamsPaymentProviderStripeInvoice CustomerUpdateParamsPaymentProvider = "stripe_invoice"
	CustomerUpdateParamsPaymentProviderNetsuite      CustomerUpdateParamsPaymentProvider = "netsuite"
)

func (CustomerUpdateParamsPaymentProvider) IsKnown added in v0.24.0

type CustomerUpdateParamsReportingConfiguration

type CustomerUpdateParamsReportingConfiguration struct {
	Exempt param.Field[bool] `json:"exempt,required"`
}

func (CustomerUpdateParamsReportingConfiguration) MarshalJSON

func (r CustomerUpdateParamsReportingConfiguration) MarshalJSON() (data []byte, err error)

type CustomerUpdateParamsShippingAddress

type CustomerUpdateParamsShippingAddress struct {
	City       param.Field[string] `json:"city"`
	Country    param.Field[string] `json:"country"`
	Line1      param.Field[string] `json:"line1"`
	Line2      param.Field[string] `json:"line2"`
	PostalCode param.Field[string] `json:"postal_code"`
	State      param.Field[string] `json:"state"`
}

func (CustomerUpdateParamsShippingAddress) MarshalJSON

func (r CustomerUpdateParamsShippingAddress) MarshalJSON() (data []byte, err error)

type CustomerUpdateParamsTaxID

type CustomerUpdateParamsTaxID struct {
	Country param.Field[CustomerUpdateParamsTaxIDCountry] `json:"country,required"`
	Type    param.Field[CustomerUpdateParamsTaxIDType]    `json:"type,required"`
	Value   param.Field[string]                           `json:"value,required"`
}

Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices.

### Supported Tax ID Countries and Types

| Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | | Belgium | `eu_vat` | European VAT number | | Brazil | `br_cnpj` | Brazilian CNPJ number | | Brazil | `br_cpf` | Brazilian CPF number | | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | | Bulgaria | `eu_vat` | European VAT number | | Canada | `ca_bn` | Canadian BN | | Canada | `ca_gst_hst` | Canadian GST/HST number | | Canada | `ca_pst_bc` | Canadian PST number (British Columbia) | | Canada | `ca_pst_mb` | Canadian PST number (Manitoba) | | Canada | `ca_pst_sk` | Canadian PST number (Saskatchewan) | | Canada | `ca_qst` | Canadian QST number (Québec) | | Chile | `cl_tin` | Chilean TIN | | Croatia | `eu_vat` | European VAT number | | Cyprus | `eu_vat` | European VAT number | | Czech Republic | `eu_vat` | European VAT number | | Denmark | `eu_vat` | European VAT number | | Egypt | `eg_tin` | Egyptian Tax Identification Number | | Estonia | `eu_vat` | European VAT number | | EU | `eu_oss_vat` | European One Stop Shop VAT number for non-Union scheme | | Finland | `eu_vat` | European VAT number | | France | `eu_vat` | European VAT number | | Georgia | `ge_vat` | Georgian VAT | | Germany | `eu_vat` | European VAT number | | Greece | `eu_vat` | European VAT number | | Hong Kong | `hk_br` | Hong Kong BR number | | Hungary | `eu_vat` | European VAT number | | Hungary | `hu_tin` | Hungary tax number (adószám) | | Iceland | `is_vat` | Icelandic VAT | | India | `in_gst` | Indian GST number | | Indonesia | `id_npwp` | Indonesian NPWP number | | Ireland | `eu_vat` | European VAT number | | Israel | `il_vat` | Israel VAT | | Italy | `eu_vat` | European VAT number | | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | | Latvia | `eu_vat` | European VAT number | | Liechtenstein | `li_uid` | Liechtensteinian UID number | | Lithuania | `eu_vat` | European VAT number | | Luxembourg | `eu_vat` | European VAT number | | Malaysia | `my_frp` | Malaysian FRP number | | Malaysia | `my_itn` | Malaysian ITN | | Malaysia | `my_sst` | Malaysian SST number | | Malta | `eu_vat ` | European VAT number | | Mexico | `mx_rfc` | Mexican RFC number | | Netherlands | `eu_vat` | European VAT number | | New Zealand | `nz_gst` | New Zealand GST number | | Norway | `no_vat` | Norwegian VAT number | | Philippines | `ph_tin ` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT number | | Portugal | `eu_vat` | European VAT number | | Romania | `eu_vat` | European VAT number | | Russia | `ru_inn` | Russian INN | | Russia | `ru_kpp` | Russian KPP | | Saudi Arabia | `sg_gst` | Singaporean GST | | Singapore | `sg_uen` | Singaporean UEN | | Slovakia | `eu_vat` | European VAT number | | Slovenia | `eu_vat` | European VAT number | | Slovenia | `si_tin` | Slovenia tax number (davčna številka) | | South Africa | `za_vat` | South African VAT number | | South Korea | `kr_brn` | Korean BRN | | Spain | `es_cif` | Spanish NIF number (previously Spanish CIF number) | | Spain | `eu_vat` | European VAT number | | Sweden | `eu_vat` | European VAT number | | Switzerland | `ch_vat` | Switzerland VAT number | | Taiwan | `tw_vat` | Taiwanese VAT | | Thailand | `th_vat` | Thai VAT | | Turkey | `tr_tin` | Turkish Tax Identification Number | | Ukraine | `ua_vat` | Ukrainian VAT | | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | | United Kingdom | `eu_vat` | Northern Ireland VAT number | | United Kingdom | `gb_vat` | United Kingdom VAT number | | United States | `us_ein` | United States EIN |

func (CustomerUpdateParamsTaxID) MarshalJSON

func (r CustomerUpdateParamsTaxID) MarshalJSON() (data []byte, err error)

type CustomerUpdateParamsTaxIDCountry added in v0.2.0

type CustomerUpdateParamsTaxIDCountry string
const (
	CustomerUpdateParamsTaxIDCountryAd CustomerUpdateParamsTaxIDCountry = "AD"
	CustomerUpdateParamsTaxIDCountryAe CustomerUpdateParamsTaxIDCountry = "AE"
	CustomerUpdateParamsTaxIDCountryAt CustomerUpdateParamsTaxIDCountry = "AT"
	CustomerUpdateParamsTaxIDCountryAu CustomerUpdateParamsTaxIDCountry = "AU"
	CustomerUpdateParamsTaxIDCountryBe CustomerUpdateParamsTaxIDCountry = "BE"
	CustomerUpdateParamsTaxIDCountryBg CustomerUpdateParamsTaxIDCountry = "BG"
	CustomerUpdateParamsTaxIDCountryBr CustomerUpdateParamsTaxIDCountry = "BR"
	CustomerUpdateParamsTaxIDCountryCa CustomerUpdateParamsTaxIDCountry = "CA"
	CustomerUpdateParamsTaxIDCountryCh CustomerUpdateParamsTaxIDCountry = "CH"
	CustomerUpdateParamsTaxIDCountryCl CustomerUpdateParamsTaxIDCountry = "CL"
	CustomerUpdateParamsTaxIDCountryCy CustomerUpdateParamsTaxIDCountry = "CY"
	CustomerUpdateParamsTaxIDCountryCz CustomerUpdateParamsTaxIDCountry = "CZ"
	CustomerUpdateParamsTaxIDCountryDe CustomerUpdateParamsTaxIDCountry = "DE"
	CustomerUpdateParamsTaxIDCountryDk CustomerUpdateParamsTaxIDCountry = "DK"
	CustomerUpdateParamsTaxIDCountryEe CustomerUpdateParamsTaxIDCountry = "EE"
	CustomerUpdateParamsTaxIDCountryEg CustomerUpdateParamsTaxIDCountry = "EG"
	CustomerUpdateParamsTaxIDCountryEs CustomerUpdateParamsTaxIDCountry = "ES"
	CustomerUpdateParamsTaxIDCountryEu CustomerUpdateParamsTaxIDCountry = "EU"
	CustomerUpdateParamsTaxIDCountryFi CustomerUpdateParamsTaxIDCountry = "FI"
	CustomerUpdateParamsTaxIDCountryFr CustomerUpdateParamsTaxIDCountry = "FR"
	CustomerUpdateParamsTaxIDCountryGB CustomerUpdateParamsTaxIDCountry = "GB"
	CustomerUpdateParamsTaxIDCountryGe CustomerUpdateParamsTaxIDCountry = "GE"
	CustomerUpdateParamsTaxIDCountryGr CustomerUpdateParamsTaxIDCountry = "GR"
	CustomerUpdateParamsTaxIDCountryHk CustomerUpdateParamsTaxIDCountry = "HK"
	CustomerUpdateParamsTaxIDCountryHr CustomerUpdateParamsTaxIDCountry = "HR"
	CustomerUpdateParamsTaxIDCountryHu CustomerUpdateParamsTaxIDCountry = "HU"
	CustomerUpdateParamsTaxIDCountryID CustomerUpdateParamsTaxIDCountry = "ID"
	CustomerUpdateParamsTaxIDCountryIe CustomerUpdateParamsTaxIDCountry = "IE"
	CustomerUpdateParamsTaxIDCountryIl CustomerUpdateParamsTaxIDCountry = "IL"
	CustomerUpdateParamsTaxIDCountryIn CustomerUpdateParamsTaxIDCountry = "IN"
	CustomerUpdateParamsTaxIDCountryIs CustomerUpdateParamsTaxIDCountry = "IS"
	CustomerUpdateParamsTaxIDCountryIt CustomerUpdateParamsTaxIDCountry = "IT"
	CustomerUpdateParamsTaxIDCountryJp CustomerUpdateParamsTaxIDCountry = "JP"
	CustomerUpdateParamsTaxIDCountryKe CustomerUpdateParamsTaxIDCountry = "KE"
	CustomerUpdateParamsTaxIDCountryKr CustomerUpdateParamsTaxIDCountry = "KR"
	CustomerUpdateParamsTaxIDCountryLi CustomerUpdateParamsTaxIDCountry = "LI"
	CustomerUpdateParamsTaxIDCountryLt CustomerUpdateParamsTaxIDCountry = "LT"
	CustomerUpdateParamsTaxIDCountryLu CustomerUpdateParamsTaxIDCountry = "LU"
	CustomerUpdateParamsTaxIDCountryLv CustomerUpdateParamsTaxIDCountry = "LV"
	CustomerUpdateParamsTaxIDCountryMt CustomerUpdateParamsTaxIDCountry = "MT"
	CustomerUpdateParamsTaxIDCountryMx CustomerUpdateParamsTaxIDCountry = "MX"
	CustomerUpdateParamsTaxIDCountryMy CustomerUpdateParamsTaxIDCountry = "MY"
	CustomerUpdateParamsTaxIDCountryNl CustomerUpdateParamsTaxIDCountry = "NL"
	CustomerUpdateParamsTaxIDCountryNo CustomerUpdateParamsTaxIDCountry = "NO"
	CustomerUpdateParamsTaxIDCountryNz CustomerUpdateParamsTaxIDCountry = "NZ"
	CustomerUpdateParamsTaxIDCountryPh CustomerUpdateParamsTaxIDCountry = "PH"
	CustomerUpdateParamsTaxIDCountryPl CustomerUpdateParamsTaxIDCountry = "PL"
	CustomerUpdateParamsTaxIDCountryPt CustomerUpdateParamsTaxIDCountry = "PT"
	CustomerUpdateParamsTaxIDCountryRo CustomerUpdateParamsTaxIDCountry = "RO"
	CustomerUpdateParamsTaxIDCountryRu CustomerUpdateParamsTaxIDCountry = "RU"
	CustomerUpdateParamsTaxIDCountrySa CustomerUpdateParamsTaxIDCountry = "SA"
	CustomerUpdateParamsTaxIDCountrySe CustomerUpdateParamsTaxIDCountry = "SE"
	CustomerUpdateParamsTaxIDCountrySg CustomerUpdateParamsTaxIDCountry = "SG"
	CustomerUpdateParamsTaxIDCountrySi CustomerUpdateParamsTaxIDCountry = "SI"
	CustomerUpdateParamsTaxIDCountrySk CustomerUpdateParamsTaxIDCountry = "SK"
	CustomerUpdateParamsTaxIDCountryTh CustomerUpdateParamsTaxIDCountry = "TH"
	CustomerUpdateParamsTaxIDCountryTr CustomerUpdateParamsTaxIDCountry = "TR"
	CustomerUpdateParamsTaxIDCountryTw CustomerUpdateParamsTaxIDCountry = "TW"
	CustomerUpdateParamsTaxIDCountryUa CustomerUpdateParamsTaxIDCountry = "UA"
	CustomerUpdateParamsTaxIDCountryUs CustomerUpdateParamsTaxIDCountry = "US"
	CustomerUpdateParamsTaxIDCountryZa CustomerUpdateParamsTaxIDCountry = "ZA"
)

func (CustomerUpdateParamsTaxIDCountry) IsKnown added in v0.24.0

type CustomerUpdateParamsTaxIDType added in v0.2.0

type CustomerUpdateParamsTaxIDType string
const (
	CustomerUpdateParamsTaxIDTypeAdNrt    CustomerUpdateParamsTaxIDType = "ad_nrt"
	CustomerUpdateParamsTaxIDTypeAeTrn    CustomerUpdateParamsTaxIDType = "ae_trn"
	CustomerUpdateParamsTaxIDTypeEuVat    CustomerUpdateParamsTaxIDType = "eu_vat"
	CustomerUpdateParamsTaxIDTypeAuAbn    CustomerUpdateParamsTaxIDType = "au_abn"
	CustomerUpdateParamsTaxIDTypeAuArn    CustomerUpdateParamsTaxIDType = "au_arn"
	CustomerUpdateParamsTaxIDTypeBgUic    CustomerUpdateParamsTaxIDType = "bg_uic"
	CustomerUpdateParamsTaxIDTypeBrCnpj   CustomerUpdateParamsTaxIDType = "br_cnpj"
	CustomerUpdateParamsTaxIDTypeBrCpf    CustomerUpdateParamsTaxIDType = "br_cpf"
	CustomerUpdateParamsTaxIDTypeCaBn     CustomerUpdateParamsTaxIDType = "ca_bn"
	CustomerUpdateParamsTaxIDTypeCaGstHst CustomerUpdateParamsTaxIDType = "ca_gst_hst"
	CustomerUpdateParamsTaxIDTypeCaPstBc  CustomerUpdateParamsTaxIDType = "ca_pst_bc"
	CustomerUpdateParamsTaxIDTypeCaPstMB  CustomerUpdateParamsTaxIDType = "ca_pst_mb"
	CustomerUpdateParamsTaxIDTypeCaPstSk  CustomerUpdateParamsTaxIDType = "ca_pst_sk"
	CustomerUpdateParamsTaxIDTypeCaQst    CustomerUpdateParamsTaxIDType = "ca_qst"
	CustomerUpdateParamsTaxIDTypeChVat    CustomerUpdateParamsTaxIDType = "ch_vat"
	CustomerUpdateParamsTaxIDTypeClTin    CustomerUpdateParamsTaxIDType = "cl_tin"
	CustomerUpdateParamsTaxIDTypeEgTin    CustomerUpdateParamsTaxIDType = "eg_tin"
	CustomerUpdateParamsTaxIDTypeEsCif    CustomerUpdateParamsTaxIDType = "es_cif"
	CustomerUpdateParamsTaxIDTypeEuOssVat CustomerUpdateParamsTaxIDType = "eu_oss_vat"
	CustomerUpdateParamsTaxIDTypeGBVat    CustomerUpdateParamsTaxIDType = "gb_vat"
	CustomerUpdateParamsTaxIDTypeGeVat    CustomerUpdateParamsTaxIDType = "ge_vat"
	CustomerUpdateParamsTaxIDTypeHkBr     CustomerUpdateParamsTaxIDType = "hk_br"
	CustomerUpdateParamsTaxIDTypeHuTin    CustomerUpdateParamsTaxIDType = "hu_tin"
	CustomerUpdateParamsTaxIDTypeIDNpwp   CustomerUpdateParamsTaxIDType = "id_npwp"
	CustomerUpdateParamsTaxIDTypeIlVat    CustomerUpdateParamsTaxIDType = "il_vat"
	CustomerUpdateParamsTaxIDTypeInGst    CustomerUpdateParamsTaxIDType = "in_gst"
	CustomerUpdateParamsTaxIDTypeIsVat    CustomerUpdateParamsTaxIDType = "is_vat"
	CustomerUpdateParamsTaxIDTypeJpCn     CustomerUpdateParamsTaxIDType = "jp_cn"
	CustomerUpdateParamsTaxIDTypeJpRn     CustomerUpdateParamsTaxIDType = "jp_rn"
	CustomerUpdateParamsTaxIDTypeJpTrn    CustomerUpdateParamsTaxIDType = "jp_trn"
	CustomerUpdateParamsTaxIDTypeKePin    CustomerUpdateParamsTaxIDType = "ke_pin"
	CustomerUpdateParamsTaxIDTypeKrBrn    CustomerUpdateParamsTaxIDType = "kr_brn"
	CustomerUpdateParamsTaxIDTypeLiUid    CustomerUpdateParamsTaxIDType = "li_uid"
	CustomerUpdateParamsTaxIDTypeMxRfc    CustomerUpdateParamsTaxIDType = "mx_rfc"
	CustomerUpdateParamsTaxIDTypeMyFrp    CustomerUpdateParamsTaxIDType = "my_frp"
	CustomerUpdateParamsTaxIDTypeMyItn    CustomerUpdateParamsTaxIDType = "my_itn"
	CustomerUpdateParamsTaxIDTypeMySst    CustomerUpdateParamsTaxIDType = "my_sst"
	CustomerUpdateParamsTaxIDTypeNoVat    CustomerUpdateParamsTaxIDType = "no_vat"
	CustomerUpdateParamsTaxIDTypeNzGst    CustomerUpdateParamsTaxIDType = "nz_gst"
	CustomerUpdateParamsTaxIDTypePhTin    CustomerUpdateParamsTaxIDType = "ph_tin"
	CustomerUpdateParamsTaxIDTypeRuInn    CustomerUpdateParamsTaxIDType = "ru_inn"
	CustomerUpdateParamsTaxIDTypeRuKpp    CustomerUpdateParamsTaxIDType = "ru_kpp"
	CustomerUpdateParamsTaxIDTypeSaVat    CustomerUpdateParamsTaxIDType = "sa_vat"
	CustomerUpdateParamsTaxIDTypeSgGst    CustomerUpdateParamsTaxIDType = "sg_gst"
	CustomerUpdateParamsTaxIDTypeSgUen    CustomerUpdateParamsTaxIDType = "sg_uen"
	CustomerUpdateParamsTaxIDTypeSiTin    CustomerUpdateParamsTaxIDType = "si_tin"
	CustomerUpdateParamsTaxIDTypeThVat    CustomerUpdateParamsTaxIDType = "th_vat"
	CustomerUpdateParamsTaxIDTypeTrTin    CustomerUpdateParamsTaxIDType = "tr_tin"
	CustomerUpdateParamsTaxIDTypeTwVat    CustomerUpdateParamsTaxIDType = "tw_vat"
	CustomerUpdateParamsTaxIDTypeUaVat    CustomerUpdateParamsTaxIDType = "ua_vat"
	CustomerUpdateParamsTaxIDTypeUsEin    CustomerUpdateParamsTaxIDType = "us_ein"
	CustomerUpdateParamsTaxIDTypeZaVat    CustomerUpdateParamsTaxIDType = "za_vat"
)

func (CustomerUpdateParamsTaxIDType) IsKnown added in v0.24.0

func (r CustomerUpdateParamsTaxIDType) IsKnown() bool

type CustomerUsageService

type CustomerUsageService struct {
	Options []option.RequestOption
}

CustomerUsageService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCustomerUsageService method instead.

func NewCustomerUsageService

func NewCustomerUsageService(opts ...option.RequestOption) (r *CustomerUsageService)

NewCustomerUsageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CustomerUsageService) Update

This endpoint is used to amend usage within a timeframe for a customer that has an active subscription.

This endpoint will mark _all_ existing events within `[timeframe_start, timeframe_end)` as _ignored_ for billing purposes, and Orb will only use the _new_ events passed in the body of this request as the source of truth for that timeframe moving forwards. Note that a given time period can be amended any number of times, so events can be overwritten in subsequent calls to th is endpoint.

This is a powerful and audit-safe mechanism to retroactively change usage data in cases where you need to:

  • decrease historical usage consumption because of degraded service availability in your systems

  • account for gaps from your usage reporting mechanism

  • make point-in-time fixes for specific event records, while retaining the original time of usage and associated metadata. This amendment API is designed with two explicit goals:

    1. Amendments are **always audit-safe**. The amendment process will still retain original events in the timeframe, though they will be ignored for billing calculations. For auditing a nd data fidelity purposes, Orb never overwrites or permanently deletes ingested usage data. 2. Amendments always preserve data **consistency**. In other words, either an amendment is fully processed by the system (and the new events for the timeframe are honored rather than the existing ones) or the amendment request fails. To maintain this important property, Orb prevents _partial event ingestion_ on this endpoint.

## Response semantics

  • Either all events are ingested successfully, or all fail to ingest (returning a `4xx` or `5xx` response code).
  • Any event that fails schema validation will lead to a `4xx` response. In this case, to maintain data consistency, Orb will not ingest any events and will also not deprecate existing events in the time period.
  • You can assume that the amendment is successful on receipt of a `2xx` response.While a successful response from this endpoint indicates that the new events have been ingested, updating usage totals happens asynchronously and may be delayed by a few minutes.

As emphasized above, Orb will never show an inconsistent state (e.g. in invoice previews or dashboards); either it will show the existing state (before the amendment) or the new state (with new events in the requested timeframe).

## Sample request body

```json

{
  "events": [
    {
      "event_name": "payment_processed",
      "timestamp": "2022-03-24T07:15:00Z",
      "properties": {
        "amount": 100
      }
    },
    {
      "event_name": "payment_failed",
      "timestamp": "2022-03-24T07:15:00Z",
      "properties": {
        "amount": 100
      }
    }
  ]
}

```

## Request Validation

  • The `timestamp` of each event reported must fall within the bounds of `timeframe_start` and `timeframe_end`. As with ingestion, all timesta mps must be sent in ISO8601 format with UTC timezone offset.

  • Orb **does not accept an `idempotency_key`** with each event in this endpoint, since the entirety of the event list must be ingested to ensure consistency. On retryable errors , you should retry the request in its entirety, and assume that the amendment operation has not succeeded until receipt of a `2xx`.

  • Both `timeframe_start` and `timeframe_end` must be timestamps in the past. Furthermore, Orb will genera lly validate that the `timeframe_start` and `timeframe_end` fall within the customer's _current_ subscription billing pe riod. However, Orb does allow amendments while in the grace period of the previous billing period; in this instance, the timeframe can start before the current period.

## API Limits

Note that Orb does not currently enforce a hard rate- limit for API usage or a maximum request payload size. Similar to the event ingestion API, this API is architected for h igh-throughput ingestion. It is also safe to _programmatically_ call this endpoint if your system can automatically dete ct a need for historical amendment.

In order to overwrite timeframes with a very large number of events, we suggest using multiple calls with small adjacent (e.g. every hour) timeframes.

func (*CustomerUsageService) UpdateByExternalID

This endpoint is used to amend usage within a timeframe for a customer that has an active subscription.

This endpoint will mark _all_ existing events within `[timeframe_start, timeframe_end)` as _ignored_ for billing purposes, and Orb will only use the _new_ events passed in the body of this request as the source of truth for that timeframe moving forwards. Note that a given time period can be amended any number of times, so events can be overwritten in subsequent calls to th is endpoint.

This is a powerful and audit-safe mechanism to retroactively change usage data in cases where you need to:

  • decrease historical usage consumption because of degraded service availability in your systems

  • account for gaps from your usage reporting mechanism

  • make point-in-time fixes for specific event records, while retaining the original time of usage and associated metadata. This amendment API is designed with two explicit goals:

    1. Amendments are **always audit-safe**. The amendment process will still retain original events in the timeframe, though they will be ignored for billing calculations. For auditing a nd data fidelity purposes, Orb never overwrites or permanently deletes ingested usage data. 2. Amendments always preserve data **consistency**. In other words, either an amendment is fully processed by the system (and the new events for the timeframe are honored rather than the existing ones) or the amendment request fails. To maintain this important property, Orb prevents _partial event ingestion_ on this endpoint.

## Response semantics

  • Either all events are ingested successfully, or all fail to ingest (returning a `4xx` or `5xx` response code).
  • Any event that fails schema validation will lead to a `4xx` response. In this case, to maintain data consistency, Orb will not ingest any events and will also not deprecate existing events in the time period.
  • You can assume that the amendment is successful on receipt of a `2xx` response.While a successful response from this endpoint indicates that the new events have been ingested, updating usage totals happens asynchronously and may be delayed by a few minutes.

As emphasized above, Orb will never show an inconsistent state (e.g. in invoice previews or dashboards); either it will show the existing state (before the amendment) or the new state (with new events in the requested timeframe).

## Sample request body

```json

{
  "events": [
    {
      "event_name": "payment_processed",
      "timestamp": "2022-03-24T07:15:00Z",
      "properties": {
        "amount": 100
      }
    },
    {
      "event_name": "payment_failed",
      "timestamp": "2022-03-24T07:15:00Z",
      "properties": {
        "amount": 100
      }
    }
  ]
}

```

## Request Validation

  • The `timestamp` of each event reported must fall within the bounds of `timeframe_start` and `timeframe_end`. As with ingestion, all timesta mps must be sent in ISO8601 format with UTC timezone offset.

  • Orb **does not accept an `idempotency_key`** with each event in this endpoint, since the entirety of the event list must be ingested to ensure consistency. On retryable errors , you should retry the request in its entirety, and assume that the amendment operation has not succeeded until receipt of a `2xx`.

  • Both `timeframe_start` and `timeframe_end` must be timestamps in the past. Furthermore, Orb will genera lly validate that the `timeframe_start` and `timeframe_end` fall within the customer's _current_ subscription billing pe riod. However, Orb does allow amendments while in the grace period of the previous billing period; in this instance, the timeframe can start before the current period.

## API Limits

Note that Orb does not currently enforce a hard rate- limit for API usage or a maximum request payload size. Similar to the event ingestion API, this API is architected for h igh-throughput ingestion. It is also safe to _programmatically_ call this endpoint if your system can automatically dete ct a need for historical amendment.

In order to overwrite timeframes with a very large number of events, we suggest using multiple calls with small adjacent (e.g. every hour) timeframes.

type CustomerUsageUpdateByExternalIDParams

type CustomerUsageUpdateByExternalIDParams struct {
	// Events to update
	Events param.Field[[]CustomerUsageUpdateByExternalIDParamsEvent] `json:"events,required"`
	// This bound is exclusive (i.e. events before this timestamp will be updated)
	TimeframeEnd param.Field[time.Time] `query:"timeframe_end" format:"date-time"`
	// This bound is inclusive (i.e. events with this timestamp onward, inclusive will
	// be updated)
	TimeframeStart param.Field[time.Time] `query:"timeframe_start" format:"date-time"`
}

func (CustomerUsageUpdateByExternalIDParams) MarshalJSON

func (r CustomerUsageUpdateByExternalIDParams) MarshalJSON() (data []byte, err error)

func (CustomerUsageUpdateByExternalIDParams) URLQuery

URLQuery serializes CustomerUsageUpdateByExternalIDParams's query parameters as `url.Values`.

type CustomerUsageUpdateByExternalIDParamsEvent added in v0.2.0

type CustomerUsageUpdateByExternalIDParamsEvent struct {
	// A name to meaningfully identify the action or event type.
	EventName param.Field[string] `json:"event_name,required"`
	// A dictionary of custom properties. Values in this dictionary must be numeric,
	// boolean, or strings. Nested dictionaries are disallowed.
	Properties param.Field[interface{}] `json:"properties,required"`
	// An ISO 8601 format date with no timezone offset (i.e. UTC). This should
	// represent the time that usage was recorded, and is particularly important to
	// attribute usage to a given billing period.
	Timestamp param.Field[time.Time] `json:"timestamp,required" format:"date-time"`
	// The Orb Customer identifier
	CustomerID param.Field[string] `json:"customer_id"`
	// An alias for the Orb customer, whose mapping is specified when creating the
	// customer
	ExternalCustomerID param.Field[string] `json:"external_customer_id"`
}

func (CustomerUsageUpdateByExternalIDParamsEvent) MarshalJSON added in v0.2.0

func (r CustomerUsageUpdateByExternalIDParamsEvent) MarshalJSON() (data []byte, err error)

type CustomerUsageUpdateByExternalIDResponse

type CustomerUsageUpdateByExternalIDResponse struct {
	// An array of strings, corresponding to idempotency_key's marked as duplicates
	// (previously ingested)
	Duplicate []string `json:"duplicate,required"`
	// An array of strings, corresponding to idempotency_key's which were successfully
	// ingested.
	Ingested []string                                    `json:"ingested,required"`
	JSON     customerUsageUpdateByExternalIDResponseJSON `json:"-"`
}

func (*CustomerUsageUpdateByExternalIDResponse) UnmarshalJSON

func (r *CustomerUsageUpdateByExternalIDResponse) UnmarshalJSON(data []byte) (err error)

type CustomerUsageUpdateParams

type CustomerUsageUpdateParams struct {
	// Events to update
	Events param.Field[[]CustomerUsageUpdateParamsEvent] `json:"events,required"`
	// This bound is exclusive (i.e. events before this timestamp will be updated)
	TimeframeEnd param.Field[time.Time] `query:"timeframe_end" format:"date-time"`
	// This bound is inclusive (i.e. events with this timestamp onward, inclusive will
	// be updated)
	TimeframeStart param.Field[time.Time] `query:"timeframe_start" format:"date-time"`
}

func (CustomerUsageUpdateParams) MarshalJSON

func (r CustomerUsageUpdateParams) MarshalJSON() (data []byte, err error)

func (CustomerUsageUpdateParams) URLQuery

func (r CustomerUsageUpdateParams) URLQuery() (v url.Values)

URLQuery serializes CustomerUsageUpdateParams's query parameters as `url.Values`.

type CustomerUsageUpdateParamsEvent added in v0.2.0

type CustomerUsageUpdateParamsEvent struct {
	// A name to meaningfully identify the action or event type.
	EventName param.Field[string] `json:"event_name,required"`
	// A dictionary of custom properties. Values in this dictionary must be numeric,
	// boolean, or strings. Nested dictionaries are disallowed.
	Properties param.Field[interface{}] `json:"properties,required"`
	// An ISO 8601 format date with no timezone offset (i.e. UTC). This should
	// represent the time that usage was recorded, and is particularly important to
	// attribute usage to a given billing period.
	Timestamp param.Field[time.Time] `json:"timestamp,required" format:"date-time"`
	// The Orb Customer identifier
	CustomerID param.Field[string] `json:"customer_id"`
	// An alias for the Orb customer, whose mapping is specified when creating the
	// customer
	ExternalCustomerID param.Field[string] `json:"external_customer_id"`
}

func (CustomerUsageUpdateParamsEvent) MarshalJSON added in v0.2.0

func (r CustomerUsageUpdateParamsEvent) MarshalJSON() (data []byte, err error)

type CustomerUsageUpdateResponse

type CustomerUsageUpdateResponse struct {
	// An array of strings, corresponding to idempotency_key's marked as duplicates
	// (previously ingested)
	Duplicate []string `json:"duplicate,required"`
	// An array of strings, corresponding to idempotency_key's which were successfully
	// ingested.
	Ingested []string                        `json:"ingested,required"`
	JSON     customerUsageUpdateResponseJSON `json:"-"`
}

func (*CustomerUsageUpdateResponse) UnmarshalJSON

func (r *CustomerUsageUpdateResponse) UnmarshalJSON(data []byte) (err error)

type Discount added in v0.2.0

type Discount = shared.Discount

This is an alias to an internal type.

type DiscountAmountDiscount added in v0.2.0

type DiscountAmountDiscount = shared.DiscountAmountDiscount

This is an alias to an internal type.

type DiscountAmountDiscountDiscountType added in v0.2.0

type DiscountAmountDiscountDiscountType = shared.DiscountAmountDiscountDiscountType

This is an alias to an internal type.

type DiscountPercentageDiscount added in v0.2.0

type DiscountPercentageDiscount = shared.DiscountPercentageDiscount

This is an alias to an internal type.

type DiscountPercentageDiscountDiscountType added in v0.2.0

type DiscountPercentageDiscountDiscountType = shared.DiscountPercentageDiscountDiscountType

This is an alias to an internal type.

type DiscountTrialDiscount added in v0.2.0

type DiscountTrialDiscount = shared.DiscountTrialDiscount

This is an alias to an internal type.

type DiscountTrialDiscountDiscountType added in v0.2.0

type DiscountTrialDiscountDiscountType = shared.DiscountTrialDiscountDiscountType

This is an alias to an internal type.

type DiscountUsageDiscount added in v0.2.0

type DiscountUsageDiscount = shared.DiscountUsageDiscount

This is an alias to an internal type.

type DiscountUsageDiscountDiscountType added in v0.2.0

type DiscountUsageDiscountDiscountType = shared.DiscountUsageDiscountDiscountType

This is an alias to an internal type.

type Error

type Error = apierror.Error

type EvaluatePriceGroup added in v0.12.0

type EvaluatePriceGroup struct {
	// The price's output for the group
	Amount string `json:"amount,required"`
	// The values for the group in the order specified by `grouping_keys`
	GroupingValues []EvaluatePriceGroupGroupingValue `json:"grouping_values,required"`
	// The price's usage quantity for the group
	Quantity float64                `json:"quantity,required"`
	JSON     evaluatePriceGroupJSON `json:"-"`
}

func (*EvaluatePriceGroup) UnmarshalJSON added in v0.12.0

func (r *EvaluatePriceGroup) UnmarshalJSON(data []byte) (err error)

type EvaluatePriceGroupGroupingValue added in v0.12.0

type EvaluatePriceGroupGroupingValue interface {
	ImplementsEvaluatePriceGroupGroupingValue()
}

Union satisfied by shared.UnionString, shared.UnionFloat or shared.UnionBool.

type EventBackfillCloseResponse

type EventBackfillCloseResponse struct {
	ID string `json:"id,required"`
	// If in the future, the time at which the backfill will automatically close. If in
	// the past, the time at which the backfill was closed.
	CloseTime time.Time `json:"close_time,required,nullable" format:"date-time"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The customer ID this backfill is scoped to. If null, this backfill is not scoped
	// to a single customer.
	CustomerID string `json:"customer_id,required,nullable"`
	// The time at which this backfill was reverted.
	RevertedAt time.Time `json:"reverted_at,required,nullable" format:"date-time"`
	// The status of the backfill.
	Status         EventBackfillCloseResponseStatus `json:"status,required"`
	TimeframeEnd   time.Time                        `json:"timeframe_end,required" format:"date-time"`
	TimeframeStart time.Time                        `json:"timeframe_start,required" format:"date-time"`
	JSON           eventBackfillCloseResponseJSON   `json:"-"`
}

A backfill represents an update to historical usage data, adding or replacing events in a timeframe.

func (*EventBackfillCloseResponse) UnmarshalJSON

func (r *EventBackfillCloseResponse) UnmarshalJSON(data []byte) (err error)

type EventBackfillCloseResponseStatus

type EventBackfillCloseResponseStatus string

The status of the backfill.

const (
	EventBackfillCloseResponseStatusPending       EventBackfillCloseResponseStatus = "pending"
	EventBackfillCloseResponseStatusReflected     EventBackfillCloseResponseStatus = "reflected"
	EventBackfillCloseResponseStatusPendingRevert EventBackfillCloseResponseStatus = "pending_revert"
	EventBackfillCloseResponseStatusReverted      EventBackfillCloseResponseStatus = "reverted"
)

func (EventBackfillCloseResponseStatus) IsKnown added in v0.24.0

type EventBackfillFetchResponse

type EventBackfillFetchResponse struct {
	ID string `json:"id,required"`
	// If in the future, the time at which the backfill will automatically close. If in
	// the past, the time at which the backfill was closed.
	CloseTime time.Time `json:"close_time,required,nullable" format:"date-time"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The customer ID this backfill is scoped to. If null, this backfill is not scoped
	// to a single customer.
	CustomerID string `json:"customer_id,required,nullable"`
	// The time at which this backfill was reverted.
	RevertedAt time.Time `json:"reverted_at,required,nullable" format:"date-time"`
	// The status of the backfill.
	Status         EventBackfillFetchResponseStatus `json:"status,required"`
	TimeframeEnd   time.Time                        `json:"timeframe_end,required" format:"date-time"`
	TimeframeStart time.Time                        `json:"timeframe_start,required" format:"date-time"`
	JSON           eventBackfillFetchResponseJSON   `json:"-"`
}

A backfill represents an update to historical usage data, adding or replacing events in a timeframe.

func (*EventBackfillFetchResponse) UnmarshalJSON

func (r *EventBackfillFetchResponse) UnmarshalJSON(data []byte) (err error)

type EventBackfillFetchResponseStatus

type EventBackfillFetchResponseStatus string

The status of the backfill.

const (
	EventBackfillFetchResponseStatusPending       EventBackfillFetchResponseStatus = "pending"
	EventBackfillFetchResponseStatusReflected     EventBackfillFetchResponseStatus = "reflected"
	EventBackfillFetchResponseStatusPendingRevert EventBackfillFetchResponseStatus = "pending_revert"
	EventBackfillFetchResponseStatusReverted      EventBackfillFetchResponseStatus = "reverted"
)

func (EventBackfillFetchResponseStatus) IsKnown added in v0.24.0

type EventBackfillListParams

type EventBackfillListParams struct {
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor param.Field[string] `query:"cursor"`
	// The number of items to fetch. Defaults to 20.
	Limit param.Field[int64] `query:"limit"`
}

func (EventBackfillListParams) URLQuery

func (r EventBackfillListParams) URLQuery() (v url.Values)

URLQuery serializes EventBackfillListParams's query parameters as `url.Values`.

type EventBackfillListResponse

type EventBackfillListResponse struct {
	ID string `json:"id,required"`
	// If in the future, the time at which the backfill will automatically close. If in
	// the past, the time at which the backfill was closed.
	CloseTime time.Time `json:"close_time,required,nullable" format:"date-time"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The customer ID this backfill is scoped to. If null, this backfill is not scoped
	// to a single customer.
	CustomerID string `json:"customer_id,required,nullable"`
	// The time at which this backfill was reverted.
	RevertedAt time.Time `json:"reverted_at,required,nullable" format:"date-time"`
	// The status of the backfill.
	Status         EventBackfillListResponseStatus `json:"status,required"`
	TimeframeEnd   time.Time                       `json:"timeframe_end,required" format:"date-time"`
	TimeframeStart time.Time                       `json:"timeframe_start,required" format:"date-time"`
	JSON           eventBackfillListResponseJSON   `json:"-"`
}

A backfill represents an update to historical usage data, adding or replacing events in a timeframe.

func (*EventBackfillListResponse) UnmarshalJSON

func (r *EventBackfillListResponse) UnmarshalJSON(data []byte) (err error)

type EventBackfillListResponseStatus

type EventBackfillListResponseStatus string

The status of the backfill.

const (
	EventBackfillListResponseStatusPending       EventBackfillListResponseStatus = "pending"
	EventBackfillListResponseStatusReflected     EventBackfillListResponseStatus = "reflected"
	EventBackfillListResponseStatusPendingRevert EventBackfillListResponseStatus = "pending_revert"
	EventBackfillListResponseStatusReverted      EventBackfillListResponseStatus = "reverted"
)

func (EventBackfillListResponseStatus) IsKnown added in v0.24.0

type EventBackfillNewParams

type EventBackfillNewParams struct {
	// The (exclusive) end of the usage timeframe affected by this backfill.
	TimeframeEnd param.Field[time.Time] `json:"timeframe_end,required" format:"date-time"`
	// The (inclusive) start of the usage timeframe affected by this backfill.
	TimeframeStart param.Field[time.Time] `json:"timeframe_start,required" format:"date-time"`
	// The time at which no more events will be accepted for this backfill. The
	// backfill will automatically begin reflecting throughout Orb at the close time.
	// If not specified, it will default to 1 day after the creation of the backfill.
	CloseTime param.Field[time.Time] `json:"close_time" format:"date-time"`
	// The ID of the customer to which this backfill is scoped.
	CustomerID param.Field[string] `json:"customer_id"`
	// The external customer ID of the customer to which this backfill is scoped.
	ExternalCustomerID param.Field[string] `json:"external_customer_id"`
	// If true, replaces all existing events in the timeframe with the newly ingested
	// events. If false, adds the newly ingested events to the existing events.
	ReplaceExistingEvents param.Field[bool] `json:"replace_existing_events"`
}

func (EventBackfillNewParams) MarshalJSON

func (r EventBackfillNewParams) MarshalJSON() (data []byte, err error)

type EventBackfillNewResponse

type EventBackfillNewResponse struct {
	ID string `json:"id,required"`
	// If in the future, the time at which the backfill will automatically close. If in
	// the past, the time at which the backfill was closed.
	CloseTime time.Time `json:"close_time,required,nullable" format:"date-time"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The customer ID this backfill is scoped to. If null, this backfill is not scoped
	// to a single customer.
	CustomerID string `json:"customer_id,required,nullable"`
	// The time at which this backfill was reverted.
	RevertedAt time.Time `json:"reverted_at,required,nullable" format:"date-time"`
	// The status of the backfill.
	Status         EventBackfillNewResponseStatus `json:"status,required"`
	TimeframeEnd   time.Time                      `json:"timeframe_end,required" format:"date-time"`
	TimeframeStart time.Time                      `json:"timeframe_start,required" format:"date-time"`
	JSON           eventBackfillNewResponseJSON   `json:"-"`
}

A backfill represents an update to historical usage data, adding or replacing events in a timeframe.

func (*EventBackfillNewResponse) UnmarshalJSON

func (r *EventBackfillNewResponse) UnmarshalJSON(data []byte) (err error)

type EventBackfillNewResponseStatus

type EventBackfillNewResponseStatus string

The status of the backfill.

const (
	EventBackfillNewResponseStatusPending       EventBackfillNewResponseStatus = "pending"
	EventBackfillNewResponseStatusReflected     EventBackfillNewResponseStatus = "reflected"
	EventBackfillNewResponseStatusPendingRevert EventBackfillNewResponseStatus = "pending_revert"
	EventBackfillNewResponseStatusReverted      EventBackfillNewResponseStatus = "reverted"
)

func (EventBackfillNewResponseStatus) IsKnown added in v0.24.0

type EventBackfillRevertResponse

type EventBackfillRevertResponse struct {
	ID string `json:"id,required"`
	// If in the future, the time at which the backfill will automatically close. If in
	// the past, the time at which the backfill was closed.
	CloseTime time.Time `json:"close_time,required,nullable" format:"date-time"`
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The customer ID this backfill is scoped to. If null, this backfill is not scoped
	// to a single customer.
	CustomerID string `json:"customer_id,required,nullable"`
	// The time at which this backfill was reverted.
	RevertedAt time.Time `json:"reverted_at,required,nullable" format:"date-time"`
	// The status of the backfill.
	Status         EventBackfillRevertResponseStatus `json:"status,required"`
	TimeframeEnd   time.Time                         `json:"timeframe_end,required" format:"date-time"`
	TimeframeStart time.Time                         `json:"timeframe_start,required" format:"date-time"`
	JSON           eventBackfillRevertResponseJSON   `json:"-"`
}

A backfill represents an update to historical usage data, adding or replacing events in a timeframe.

func (*EventBackfillRevertResponse) UnmarshalJSON

func (r *EventBackfillRevertResponse) UnmarshalJSON(data []byte) (err error)

type EventBackfillRevertResponseStatus

type EventBackfillRevertResponseStatus string

The status of the backfill.

const (
	EventBackfillRevertResponseStatusPending       EventBackfillRevertResponseStatus = "pending"
	EventBackfillRevertResponseStatusReflected     EventBackfillRevertResponseStatus = "reflected"
	EventBackfillRevertResponseStatusPendingRevert EventBackfillRevertResponseStatus = "pending_revert"
	EventBackfillRevertResponseStatusReverted      EventBackfillRevertResponseStatus = "reverted"
)

func (EventBackfillRevertResponseStatus) IsKnown added in v0.24.0

type EventBackfillService

type EventBackfillService struct {
	Options []option.RequestOption
}

EventBackfillService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEventBackfillService method instead.

func NewEventBackfillService

func NewEventBackfillService(opts ...option.RequestOption) (r *EventBackfillService)

NewEventBackfillService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EventBackfillService) Close

func (r *EventBackfillService) Close(ctx context.Context, backfillID string, opts ...option.RequestOption) (res *EventBackfillCloseResponse, err error)

Closing a backfill makes the updated usage visible in Orb. Upon closing a backfill, Orb will asynchronously reflect the updated usage in invoice amounts and usage graphs. Once all of the updates are complete, the backfill's status will transition to `reflected`.

func (*EventBackfillService) Fetch

func (r *EventBackfillService) Fetch(ctx context.Context, backfillID string, opts ...option.RequestOption) (res *EventBackfillFetchResponse, err error)

This endpoint is used to fetch a backfill given an identifier.

func (*EventBackfillService) List

This endpoint returns a list of all backfills in a list format.

The list of backfills is ordered starting from the most recently created backfill. The response also includes [`pagination_metadata`](../reference/pagination), which lets the caller retrieve the next page of results if they exist. More information about pagination can be found in the [Pagination-metadata schema](pagination).

func (*EventBackfillService) ListAutoPaging

This endpoint returns a list of all backfills in a list format.

The list of backfills is ordered starting from the most recently created backfill. The response also includes [`pagination_metadata`](../reference/pagination), which lets the caller retrieve the next page of results if they exist. More information about pagination can be found in the [Pagination-metadata schema](pagination).

func (*EventBackfillService) New

Creating the backfill enables adding or replacing past events, even those that are older than the ingestion grace period. Performing a backfill in Orb involves 3 steps:

  1. Create the backfill, specifying its parameters.
  2. [Ingest](ingest) usage events, referencing the backfill (query parameter `backfill_id`).
  3. [Close](close-backfill) the backfill, propagating the update in past usage throughout Orb.

Changes from a backfill are not reflected until the backfill is closed, so you won’t need to worry about your customers seeing partially updated usage data. Backfills are also reversible, so you’ll be able to revert a backfill if you’ve made a mistake.

This endpoint will return a backfill object, which contains an `id`. That `id` can then be used as the `backfill_id` query parameter to the event ingestion endpoint to associate ingested events with this backfill. The effects (e.g. updated usage graphs) of this backfill will not take place until the backfill is closed.

If the `replace_existing_events` is `true`, existing events in the backfill's timeframe will be replaced with the newly ingested events associated with the backfill. If `false`, newly ingested events will be added to the existing events.

func (*EventBackfillService) Revert

func (r *EventBackfillService) Revert(ctx context.Context, backfillID string, opts ...option.RequestOption) (res *EventBackfillRevertResponse, err error)

Reverting a backfill undoes all the effects of closing the backfill. If the backfill is reflected, the status will transition to `pending_revert` while the effects of the backfill are undone. Once all effects are undone, the backfill will transition to `reverted`.

If a backfill is reverted before its closed, no usage will be updated as a result of the backfill and it will immediately transition to `reverted`.

type EventDeprecateResponse

type EventDeprecateResponse struct {
	// event_id of the deprecated event, if successfully updated
	Deprecated string                     `json:"deprecated,required"`
	JSON       eventDeprecateResponseJSON `json:"-"`
}

func (*EventDeprecateResponse) UnmarshalJSON

func (r *EventDeprecateResponse) UnmarshalJSON(data []byte) (err error)

type EventIngestParams

type EventIngestParams struct {
	Events param.Field[[]EventIngestParamsEvent] `json:"events,required"`
	// If this ingestion request is part of a backfill, this parameter ties the
	// ingested events to the backfill
	BackfillID param.Field[string] `query:"backfill_id"`
	// Flag to enable additional debug information in the endpoint response
	Debug param.Field[bool] `query:"debug"`
}

func (EventIngestParams) MarshalJSON

func (r EventIngestParams) MarshalJSON() (data []byte, err error)

func (EventIngestParams) URLQuery

func (r EventIngestParams) URLQuery() (v url.Values)

URLQuery serializes EventIngestParams's query parameters as `url.Values`.

type EventIngestParamsEvent

type EventIngestParamsEvent struct {
	// A name to meaningfully identify the action or event type.
	EventName param.Field[string] `json:"event_name,required"`
	// A unique value, generated by the client, that is used to de-duplicate events.
	// Exactly one event with a given idempotency key will be ingested, which allows
	// for safe request retries.
	IdempotencyKey param.Field[string] `json:"idempotency_key,required"`
	// A dictionary of custom properties. Values in this dictionary must be numeric,
	// boolean, or strings. Nested dictionaries are disallowed.
	Properties param.Field[interface{}] `json:"properties,required"`
	// An ISO 8601 format date with no timezone offset (i.e. UTC). This should
	// represent the time that usage was recorded, and is particularly important to
	// attribute usage to a given billing period.
	Timestamp param.Field[time.Time] `json:"timestamp,required" format:"date-time"`
	// The Orb Customer identifier
	CustomerID param.Field[string] `json:"customer_id"`
	// An alias for the Orb customer, whose mapping is specified when creating the
	// customer
	ExternalCustomerID param.Field[string] `json:"external_customer_id"`
}

func (EventIngestParamsEvent) MarshalJSON

func (r EventIngestParamsEvent) MarshalJSON() (data []byte, err error)

type EventIngestResponse

type EventIngestResponse struct {
	// Contains all failing validation events. In the case of a 200, this array will
	// always be empty. This field will always be present.
	ValidationFailed []EventIngestResponseValidationFailed `json:"validation_failed,required"`
	// Optional debug information (only present when debug=true is passed to the
	// endpoint). Contains ingested and duplicate event idempotency keys.
	Debug EventIngestResponseDebug `json:"debug,nullable"`
	JSON  eventIngestResponseJSON  `json:"-"`
}

func (*EventIngestResponse) UnmarshalJSON

func (r *EventIngestResponse) UnmarshalJSON(data []byte) (err error)

type EventIngestResponseDebug

type EventIngestResponseDebug struct {
	Duplicate []string                     `json:"duplicate,required"`
	Ingested  []string                     `json:"ingested,required"`
	JSON      eventIngestResponseDebugJSON `json:"-"`
}

Optional debug information (only present when debug=true is passed to the endpoint). Contains ingested and duplicate event idempotency keys.

func (*EventIngestResponseDebug) UnmarshalJSON

func (r *EventIngestResponseDebug) UnmarshalJSON(data []byte) (err error)

type EventIngestResponseValidationFailed

type EventIngestResponseValidationFailed struct {
	// The passed idempotency_key corresponding to the validation_errors
	IdempotencyKey string `json:"idempotency_key,required"`
	// An array of strings corresponding to validation failures for this
	// idempotency_key.
	ValidationErrors []string                                `json:"validation_errors,required"`
	JSON             eventIngestResponseValidationFailedJSON `json:"-"`
}

func (*EventIngestResponseValidationFailed) UnmarshalJSON

func (r *EventIngestResponseValidationFailed) UnmarshalJSON(data []byte) (err error)

type EventSearchParams

type EventSearchParams struct {
	// This is an explicit array of IDs to filter by. Note that an event's ID is the
	// idempotency_key that was originally used for ingestion, and this only supports
	// events that have not been amended. Values in this array will be treated case
	// sensitively.
	EventIDs param.Field[[]string] `json:"event_ids,required"`
	// The end of the timeframe, exclusive, in which to search events. If not
	// specified, the current time is used.
	TimeframeEnd param.Field[time.Time] `json:"timeframe_end" format:"date-time"`
	// The start of the timeframe, inclusive, in which to search events. If not
	// specified, the one week ago is used.
	TimeframeStart param.Field[time.Time] `json:"timeframe_start" format:"date-time"`
}

func (EventSearchParams) MarshalJSON

func (r EventSearchParams) MarshalJSON() (data []byte, err error)

type EventSearchResponse

type EventSearchResponse struct {
	Data []EventSearchResponseData `json:"data,required"`
	JSON eventSearchResponseJSON   `json:"-"`
}

func (*EventSearchResponse) UnmarshalJSON

func (r *EventSearchResponse) UnmarshalJSON(data []byte) (err error)

type EventSearchResponseData

type EventSearchResponseData struct {
	// A unique value, generated by the client, that is used to de-duplicate events.
	// Exactly one event with a given idempotency key will be ingested, which allows
	// for safe request retries.
	ID string `json:"id,required"`
	// The Orb Customer identifier
	CustomerID string `json:"customer_id,required,nullable"`
	// A name to meaningfully identify the action or event type.
	EventName string `json:"event_name,required"`
	// An alias for the Orb customer, whose mapping is specified when creating the
	// customer
	ExternalCustomerID string `json:"external_customer_id,required,nullable"`
	// A dictionary of custom properties. Values in this dictionary must be numeric,
	// boolean, or strings. Nested dictionaries are disallowed.
	Properties interface{} `json:"properties,required"`
	// An ISO 8601 format date with no timezone offset (i.e. UTC). This should
	// represent the time that usage was recorded, and is particularly important to
	// attribute usage to a given billing period.
	Timestamp time.Time                   `json:"timestamp,required" format:"date-time"`
	JSON      eventSearchResponseDataJSON `json:"-"`
}

The [Event](../guides/core-concepts.mdx#event) resource represents a usage event that has been created for a customer. Events are the core of Orb's usage-based billing model, and are used to calculate the usage charges for a given billing period.

func (*EventSearchResponseData) UnmarshalJSON

func (r *EventSearchResponseData) UnmarshalJSON(data []byte) (err error)

type EventService

type EventService struct {
	Options   []option.RequestOption
	Backfills *EventBackfillService
}

EventService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEventService method instead.

func NewEventService

func NewEventService(opts ...option.RequestOption) (r *EventService)

NewEventService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EventService) Deprecate

func (r *EventService) Deprecate(ctx context.Context, eventID string, opts ...option.RequestOption) (res *EventDeprecateResponse, err error)

This endpoint is used to deprecate a single usage event with a given `event_id`. `event_id` refers to the `idempotency_key` passed in during ingestion.

This endpoint will mark the existing event as ignored. Note that if you attempt to re-ingest an event with the same `event_id` as a deprecated event, Orb will return an error.

This is a powerful and audit-safe mechanism to retroactively deprecate a single event in cases where you need to:

  • no longer bill for an event that was improperly reported
  • no longer bill for an event based on the result of an external API call (e.g. call to a payment gateway failed and the user should not be billed)

If you want to only change specific properties of an event, but keep the event as part of the billing calculation, use the [Amend single event](amend-event) endpoint instead.

This API is always audit-safe. The process will still retain the deprecated event, though it will be ignored for billing calculations. For auditing and data fidelity purposes, Orb never overwrites or permanently deletes ingested usage data.

## Request validation

  • Orb does not accept an `idempotency_key` with the event in this endpoint, since this request is by design idempotent. On retryable errors, you should retry the request and assume the deprecation operation has not succeeded until receipt of a 2xx.
  • The event's `timestamp` must fall within the customer's current subscription's billing period, or within the grace period of the customer's current subscription's previous billing period. Orb does not allow deprecating events for billing periods that have already invoiced customers.
  • The `customer_id` or the `external_customer_id` of the original event ingestion request must identify a Customer resource within Orb, even if this event was ingested during the initial integration period. We do not allow deprecating events for customers not in the Orb system.

func (*EventService) Ingest

func (r *EventService) Ingest(ctx context.Context, params EventIngestParams, opts ...option.RequestOption) (res *EventIngestResponse, err error)

Orb's event ingestion model and API is designed around two core principles:

  1. **Data fidelity**: The accuracy of your billing model depends on a robust foundation of events. Orb's API protocol encourages usage patterns that ensure that your data is consistently complete and correct.
  2. **Fast integration**: Sending events into Orb requires no tedious setup steps or explicit field schema for your event shape, making it instant to start streaming in usage in real-time.

## Event shape

Events are the starting point for all usage calculations in the system, and are simple at their core:

```ts

{
  // customer_id and external_customer_id are used to
  // attribute usage to a given Customer. Exactly one of these
  // should be specified in a given ingestion event.

  // `customer_id` is the Orb generated identifier for the Customer,
  // which is returned from the Create customer API call.
  customer_id: string,

  // external_customer_id is an alternate identifier which is associated
  // with a Customer at creation time. This is treated as an alias for
  // customer_id, and is usually set to an identifier native to your system.
  external_customer_id: string,

  // A string name identifying the event, usually a usage
  // action. By convention, this should not contain any whitespace.
  event_name: string,

  // An ISO 8601 format date with no timezone offset.
  // This should represent the time that usage occurred
  // and is important to attribute usage to a given
  // billing period. See the notes below on determining the timestamp.
  // e.g. 2020-12-09T16:09:53Z
  timestamp: string,

  // A unique value, generated by the client, that is
  // used to de-duplicate events.
  // Exactly one event with a given
  // idempotency key will be ingested, which allows for
  // safe request retries.
  idempotency_key: string

  // Optional custom metadata to attach to the event.
  // This might include a numeric value used for aggregation,
  // or a string/boolean value used for filtering.
  // The schema of this dictionary need not be pre-declared, and
  // properties can be added at any time.
  properties: {
    [key: string]?: string | number | boolean,
  },
}

```

## Required fields

Because events streamed to Orb are meant to be as flexible as possible, there are only a few required fields in every event.

  • We recommend that `idempotency_key` are unique strings that you generated with V4 UUIDs, but only require that they uniquely identify an event (i.e. don’t collide).
  • The `timestamp` field in the event body will be used to determine which billable period a given event falls into. For example, with a monthly billing cycle starting from the first of December, Orb will calculate metrics based on events that fall into the range `12-01 00:00:00 <= timestamp < 01-01 00:00:00`.

## Logging metadata

Orb allows tagging events with metadata using a flexible properties dictionary. Since Orb does not enforce a rigid schema for this field-set, key-value pairs can be added dynamically as your events evolve.

This dictionary can be helpful for a wide variety of use cases:

  • Numeric properties on events like `compute_time_ms` can later be inputs to our flexible query engine to determine usage.
  • Logging a region or cluster with each event can help you provide customers more granular visibility into their usage.

We encourage logging this metadata with an eye towards future use cases to ensure full coverage for historical data. The datatype of the value in the properties dictionary is important for metric creation from an event source. Values that you wish to numerically aggregate should be of numeric type in the event.

## Determining event timestamp

For cases where usage is being reported in real time as it is occurring, timestamp should correspond to the time that usage occurred.

In cases where usage is reported in aggregate for a historical timeframe at a regular interval, we recommend setting the event `timestamp` to the midpoint of the interval. As an example, if you have an hourly reporter that sends data once an hour for the previous hour of usage, setting the `timestamp` to the half-hour mark will ensure that the usage is counted within the correct period.

Note that other time-related fields (e.g. time elapsed) can be added to the properties dictionary as necessary.

In cases where usage is reported in aggregate for a historical timeframe, the timestamp must be within the grace period set for your account. Events with `timestamp < current_time - grace_period` will not be accepted as a valid event, and will throw validation errors. Enforcing the grace period enables Orb to accurately map usage to the correct billing cycle and ensure that all usage is billed for in the corresponding billing period.

## Event validation

Orb’s validation ensures that you recognize errors in your events as quickly as possible, and the API provides informative error messages to help you fix problems quickly.

We validate the following:

  • Exactly one of `customer_id` and `external_customer_id` should be specified.
  • If specified, `customer_id` must identify a Customer resource within Orb. We do not support sending events for customers that have not been provisioned. Similarly, if specified, `external_customer_id` must be an identifier that is associated with an Orb Customer resource. Note: During our initial integration period, this enforcement will be temporarily turned into a warning to ensure smooth customer migration.
  • `timestamp` must conform to ISO 8601 and represent a timestamp at most 1 hour in the future. This timestamp should be sent in UTC timezone (no timezone offset).

## Idempotency and retry semantics

Orb's idempotency guarantees allow you to implement safe retry logic in the event of network or machine failures, ensuring data fidelity. Each event in the request payload is associated with an idempotency key, and Orb guarantees that a single idempotency key will be successfully ingested at most once.

  • Successful responses return a 200 HTTP status code. The response contains information about previously processed events.
  • Requests that return a `4xx` HTTP status code indicate a payload error and contain at least one event with a validation failure. An event with a validation failure can be re-sent to the ingestion endpoint (after the payload is fixed) with the original idempotency key since that key is not marked as processed.
  • Requests that return a `5xx` HTTP status code indicate a server-side failure. These requests should be retried in their entirety.

## API usage and limits

The ingestion API is designed made for real-time streaming ingestion and architected for high throughput. Even if events are later deemed unnecessary or filtered out, we encourage you to log them to Orb if they may be relevant to billing calculations in the future.

To take advantage of the real-time features of the Orb platform and avoid any chance of dropped events by producers, we recommend reporting events to Orb frequently. Optionally, events can also be briefly aggregated at the source, as this API accepts an array of event bodies.

Orb does not currently enforce a hard rate-limit for API usage or a maximum request payload size, but please give us a heads up if you’re changing either of these factors by an order of magnitude from initial setup.

## Testing in debug mode

The ingestion API supports a debug mode, which returns additional verbose output to indicate which event idempotency keys were newly ingested or duplicates from previous requests. To enable this mode, mark `debug=true` as a query parameter.

If `debug=true` is not specified, the response will only contain `validation_failed`. Orb will still honor the idempotency guarantees set [here](../guides/events-and-metrics/event-ingestion#event-volume-and-concurrency) in all cases.

We strongly recommend that you only use debug mode as part of testing your initial Orb integration. Once you're ready to switch to production, disable debug mode to take advantage of improved performance and maximal throughput.

#### Example: ingestion response with `debug=true`

```json

{
  "debug": {
    "duplicate": [],
    "ingested": ["B7E83HDMfJPAunXW", "SJs5DQJ3TnwSqEZE", "8SivfDsNKwCeAXim"]
  },
  "validation_failed": []
}

```

#### Example: ingestion response with `debug=false`

```json

{
  "validation_failed": []
}

```

func (*EventService) Search

func (r *EventService) Search(ctx context.Context, body EventSearchParams, opts ...option.RequestOption) (res *EventSearchResponse, err error)

This endpoint returns a filtered set of events for an account in a [paginated list format](../reference/pagination).

Note that this is a `POST` endpoint rather than a `GET` endpoint because it employs a JSON body for search criteria rather than query parameters, allowing for a more flexible search syntax.

Note that a search criteria _must_ be specified. Currently, Orb supports the following criteria:

  • `event_ids`: This is an explicit array of IDs to filter by. Note that an event's ID is the `idempotency_key` that was originally used for ingestion.

By default, Orb will not throw a `404` if no events matched, Orb will return an empty array for `data` instead.

func (*EventService) Update

func (r *EventService) Update(ctx context.Context, eventID string, body EventUpdateParams, opts ...option.RequestOption) (res *EventUpdateResponse, err error)

This endpoint is used to amend a single usage event with a given `event_id`. `event_id` refers to the `idempotency_key` passed in during ingestion. The event will maintain its existing `event_id` after the amendment.

This endpoint will mark the existing event as ignored, and Orb will only use the new event passed in the body of this request as the source of truth for that `event_id`. Note that a single event can be amended any number of times, so the same event can be overwritten in subsequent calls to this endpoint, or overwritten using the [Amend customer usage](amend-usage) endpoint. Only a single event with a given `event_id` will be considered the source of truth at any given time.

This is a powerful and audit-safe mechanism to retroactively update a single event in cases where you need to:

  • update an event with new metadata as you iterate on your pricing model
  • update an event based on the result of an external API call (e.g. call to a payment gateway succeeded or failed)

This amendment API is always audit-safe. The process will still retain the original event, though it will be ignored for billing calculations. For auditing and data fidelity purposes, Orb never overwrites or permanently deletes ingested usage data.

## Request validation

  • The `timestamp` of the new event must match the `timestamp` of the existing event already ingested. As with ingestion, all timestamps must be sent in ISO8601 format with UTC timezone offset.
  • The `customer_id` or `external_customer_id` of the new event must match the `customer_id` or `external_customer_id` of the existing event already ingested. Exactly one of `customer_id` and `external_customer_id` should be specified, and similar to ingestion, the ID must identify a Customer resource within Orb. Unlike ingestion, for event amendment, we strictly enforce that the Customer must be in the Orb system, even during the initial integration period. We do not allow updating the `Customer` an event is associated with.
  • Orb does not accept an `idempotency_key` with the event in this endpoint, since this request is by design idempotent. On retryable errors, you should retry the request and assume the amendment operation has not succeeded until receipt of a 2xx.
  • The event's `timestamp` must fall within the customer's current subscription's billing period, or within the grace period of the customer's current subscription's previous billing period.

type EventUpdateParams

type EventUpdateParams struct {
	// A name to meaningfully identify the action or event type.
	EventName param.Field[string] `json:"event_name,required"`
	// A dictionary of custom properties. Values in this dictionary must be numeric,
	// boolean, or strings. Nested dictionaries are disallowed.
	Properties param.Field[interface{}] `json:"properties,required"`
	// An ISO 8601 format date with no timezone offset (i.e. UTC). This should
	// represent the time that usage was recorded, and is particularly important to
	// attribute usage to a given billing period.
	Timestamp param.Field[time.Time] `json:"timestamp,required" format:"date-time"`
	// The Orb Customer identifier
	CustomerID param.Field[string] `json:"customer_id"`
	// An alias for the Orb customer, whose mapping is specified when creating the
	// customer
	ExternalCustomerID param.Field[string] `json:"external_customer_id"`
}

func (EventUpdateParams) MarshalJSON

func (r EventUpdateParams) MarshalJSON() (data []byte, err error)

type EventUpdateResponse

type EventUpdateResponse struct {
	// event_id of the amended event, if successfully ingested
	Amended string                  `json:"amended,required"`
	JSON    eventUpdateResponseJSON `json:"-"`
}

func (*EventUpdateResponse) UnmarshalJSON

func (r *EventUpdateResponse) UnmarshalJSON(data []byte) (err error)

type Invoice

type Invoice struct {
	ID string `json:"id,required"`
	// This is the final amount required to be charged to the customer and reflects the
	// application of the customer balance to the `total` of the invoice.
	AmountDue      string                `json:"amount_due,required"`
	AutoCollection InvoiceAutoCollection `json:"auto_collection,required"`
	BillingAddress InvoiceBillingAddress `json:"billing_address,required,nullable"`
	// The creation time of the resource in Orb.
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// A list of credit notes associated with the invoice
	CreditNotes []InvoiceCreditNote `json:"credit_notes,required"`
	// An ISO 4217 currency string or `credits`
	Currency                    string                              `json:"currency,required"`
	Customer                    InvoiceCustomer                     `json:"customer,required"`
	CustomerBalanceTransactions []InvoiceCustomerBalanceTransaction `json:"customer_balance_transactions,required"`
	// Tax IDs are commonly required to be displayed on customer invoices, which are
	// added to the headers of invoices.
	//
	// ### Supported Tax ID Countries and Types
	//
	// | Country              | Type         | Description                                                                                             |
	// | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
	// | Andorra              | `ad_nrt`     | Andorran NRT number                                                                                     |
	// | Australia            | `au_abn`     | Australian Business Number (AU ABN)                                                                     |
	// | Australia            | `au_arn`     | Australian Taxation Office Reference Number                                                             |
	// | Austria              | `eu_vat`     | European VAT number                                                                                     |
	// | Belgium              | `eu_vat`     | European VAT number                                                                                     |
	// | Brazil               | `br_cnpj`    | Brazilian CNPJ number                                                                                   |
	// | Brazil               | `br_cpf`     | Brazilian CPF number                                                                                    |
	// | Bulgaria             | `bg_uic`     | Bulgaria Unified Identification Code                                                                    |
	// | Bulgaria             | `eu_vat`     | European VAT number                                                                                     |
	// | Canada               | `ca_bn`      | Canadian BN                                                                                             |
	// | Canada               | `ca_gst_hst` | Canadian GST/HST number                                                                                 |
	// | Canada               | `ca_pst_bc`  | Canadian PST number (British Columbia)                                                                  |
	// | Canada               | `ca_pst_mb`  | Canadian PST number (Manitoba)                                                                          |
	// | Canada               | `ca_pst_sk`  | Canadian PST number (Saskatchewan)                                                                      |
	// | Canada               | `ca_qst`     | Canadian QST number (Québec)                                                                            |
	// | Chile                | `cl_tin`     | Chilean TIN                                                                                             |
	// | Croatia              | `eu_vat`     | European VAT number                                                                                     |
	// | Cyprus               | `eu_vat`     | European VAT number                                                                                     |
	// | Czech Republic       | `eu_vat`     | European VAT number                                                                                     |
	// | Denmark              | `eu_vat`     | European VAT number                                                                                     |
	// | Egypt                | `eg_tin`     | Egyptian Tax Identification Number                                                                      |
	// | Estonia              | `eu_vat`     | European VAT number                                                                                     |
	// | EU                   | `eu_oss_vat` | European One Stop Shop VAT number for non-Union scheme                                                  |
	// | Finland              | `eu_vat`     | European VAT number                                                                                     |
	// | France               | `eu_vat`     | European VAT number                                                                                     |
	// | Georgia              | `ge_vat`     | Georgian VAT                                                                                            |
	// | Germany              | `eu_vat`     | European VAT number                                                                                     |
	// | Greece               | `eu_vat`     | European VAT number                                                                                     |
	// | Hong Kong            | `hk_br`      | Hong Kong BR number                                                                                     |
	// | Hungary              | `eu_vat`     | European VAT number                                                                                     |
	// | Hungary              | `hu_tin`     | Hungary tax number (adószám)                                                                            |
	// | Iceland              | `is_vat`     | Icelandic VAT                                                                                           |
	// | India                | `in_gst`     | Indian GST number                                                                                       |
	// | Indonesia            | `id_npwp`    | Indonesian NPWP number                                                                                  |
	// | Ireland              | `eu_vat`     | European VAT number                                                                                     |
	// | Israel               | `il_vat`     | Israel VAT                                                                                              |
	// | Italy                | `eu_vat`     | European VAT number                                                                                     |
	// | Japan                | `jp_cn`      | Japanese Corporate Number (_Hōjin Bangō_)                                                               |
	// | Japan                | `jp_rn`      | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
	// | Japan                | `jp_trn`     | Japanese Tax Registration Number (_Tōroku Bangō_)                                                       |
	// | Kenya                | `ke_pin`     | Kenya Revenue Authority Personal Identification Number                                                  |
	// | Latvia               | `eu_vat`     | European VAT number                                                                                     |
	// | Liechtenstein        | `li_uid`     | Liechtensteinian UID number                                                                             |
	// | Lithuania            | `eu_vat`     | European VAT number                                                                                     |
	// | Luxembourg           | `eu_vat`     | European VAT number                                                                                     |
	// | Malaysia             | `my_frp`     | Malaysian FRP number                                                                                    |
	// | Malaysia             | `my_itn`     | Malaysian ITN                                                                                           |
	// | Malaysia             | `my_sst`     | Malaysian SST number                                                                                    |
	// | Malta                | `eu_vat `    | European VAT number                                                                                     |
	// | Mexico               | `mx_rfc`     | Mexican RFC number                                                                                      |
	// | Netherlands          | `eu_vat`     | European VAT number                                                                                     |
	// | New Zealand          | `nz_gst`     | New Zealand GST number                                                                                  |
	// | Norway               | `no_vat`     | Norwegian VAT number                                                                                    |
	// | Philippines          | `ph_tin `    | Philippines Tax Identification Number                                                                   |
	// | Poland               | `eu_vat`     | European VAT number                                                                                     |
	// | Portugal             | `eu_vat`     | European VAT number                                                                                     |
	// | Romania              | `eu_vat`     | European VAT number                                                                                     |
	// | Russia               | `ru_inn`     | Russian INN                                                                                             |
	// | Russia               | `ru_kpp`     | Russian KPP                                                                                             |
	// | Saudi Arabia         | `sg_gst`     | Singaporean GST                                                                                         |
	// | Singapore            | `sg_uen`     | Singaporean UEN                                                                                         |
	// | Slovakia             | `eu_vat`     | European VAT number                                                                                     |
	// | Slovenia             | `eu_vat`     | European VAT number                                                                                     |
	// | Slovenia             | `si_tin`     | Slovenia tax number (davčna številka)                                                                   |
	// | South Africa         | `za_vat`     | South African VAT number                                                                                |
	// | South Korea          | `kr_brn`     | Korean BRN                                                                                              |
	// | Spain                | `es_cif`     | Spanish NIF number (previously Spanish CIF number)                                                      |
	// | Spain                | `eu_vat`     | European VAT number                                                                                     |
	// | Sweden               | `eu_vat`     | European VAT number                                                                                     |
	// | Switzerland          | `ch_vat`     | Switzerland VAT number                                                                                  |
	// | Taiwan               | `tw_vat`     | Taiwanese VAT                                                                                           |
	// | Thailand             | `th_vat`     | Thai VAT                                                                                                |
	// | Turkey               | `tr_tin`     | Turkish Tax Identification Number                                                                       |
	// | Ukraine              | `ua_vat`     | Ukrainian VAT                                                                                           |
	// | United Arab Emirates | `ae_trn`     | United Arab Emirates TRN                                                                                |
	// | United Kingdom       | `eu_vat`     | Northern Ireland VAT number                                                                             |
	// | United Kingdom       | `gb_vat`     | United Kingdom VAT number                                                                               |
	// | United States        | `us_ein`     | United States EIN                                                                                       |
	CustomerTaxID InvoiceCustomerTaxID `json:"customer_tax_id,required,nullable"`
	Discount      shared.Discount      `json:"discount,required,nullable"`
	Discounts     []shared.Discount    `json:"discounts,required"`
	// When the invoice payment is due.
	DueDate time.Time `json:"due_date,required" format:"date-time"`
	// If the invoice has a status of `draft`, this will be the time that the invoice
	// will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is
	// true, the invoice will automatically begin issuing at this time.
	EligibleToIssueAt time.Time `json:"eligible_to_issue_at,required,nullable" format:"date-time"`
	// A URL for the invoice portal.
	HostedInvoiceURL string `json:"hosted_invoice_url,required,nullable"`
	// The scheduled date of the invoice
	InvoiceDate time.Time `json:"invoice_date,required" format:"date-time"`
	// Automatically generated invoice number to help track and reconcile invoices.
	// Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per
	// account or customer.
	InvoiceNumber string `json:"invoice_number,required"`
	// The link to download the PDF representation of the `Invoice`.
	InvoicePdf string `json:"invoice_pdf,required,nullable"`
	// If the invoice failed to issue, this will be the last time it failed to issue
	// (even if it is now in a different state.)
	IssueFailedAt time.Time `json:"issue_failed_at,required,nullable" format:"date-time"`
	// If the invoice has been issued, this will be the time it transitioned to
	// `issued` (even if it is now in a different state.)
	IssuedAt time.Time `json:"issued_at,required,nullable" format:"date-time"`
	// The breakdown of prices in this invoice.
	LineItems     []InvoiceLineItem `json:"line_items,required"`
	Maximum       InvoiceMaximum    `json:"maximum,required,nullable"`
	MaximumAmount string            `json:"maximum_amount,required,nullable"`
	// Free-form text which is available on the invoice PDF and the Orb invoice portal.
	Memo string `json:"memo,required,nullable"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata      map[string]string `json:"metadata,required"`
	Minimum       InvoiceMinimum    `json:"minimum,required,nullable"`
	MinimumAmount string            `json:"minimum_amount,required,nullable"`
	// If the invoice has a status of `paid`, this gives a timestamp when the invoice
	// was paid.
	PaidAt time.Time `json:"paid_at,required,nullable" format:"date-time"`
	// If payment was attempted on this invoice but failed, this will be the time of
	// the most recent attempt.
	PaymentFailedAt time.Time `json:"payment_failed_at,required,nullable" format:"date-time"`
	// If payment was attempted on this invoice, this will be the start time of the
	// most recent attempt. This field is especially useful for delayed-notification
	// payment mechanisms (like bank transfers), where payment can take 3 days or more.
	PaymentStartedAt time.Time `json:"payment_started_at,required,nullable" format:"date-time"`
	// If the invoice is in draft, this timestamp will reflect when the invoice is
	// scheduled to be issued.
	ScheduledIssueAt time.Time              `json:"scheduled_issue_at,required,nullable" format:"date-time"`
	ShippingAddress  InvoiceShippingAddress `json:"shipping_address,required,nullable"`
	Status           InvoiceStatus          `json:"status,required"`
	Subscription     InvoiceSubscription    `json:"subscription,required,nullable"`
	// The total before any discounts and minimums are applied.
	Subtotal string `json:"subtotal,required"`
	// If the invoice failed to sync, this will be the last time an external invoicing
	// provider sync was attempted. This field will always be `null` for invoices using
	// Orb Invoicing.
	SyncFailedAt time.Time `json:"sync_failed_at,required,nullable" format:"date-time"`
	// The total after any minimums and discounts have been applied.
	Total string `json:"total,required"`
	// If the invoice has a status of `void`, this gives a timestamp when the invoice
	// was voided.
	VoidedAt time.Time `json:"voided_at,required,nullable" format:"date-time"`
	// This is true if the invoice will be automatically issued in the future, and
	// false otherwise.
	WillAutoIssue bool        `json:"will_auto_issue,required"`
	JSON          invoiceJSON `json:"-"`
}

An [`Invoice`](../guides/concepts#invoice) is a fundamental billing entity, representing the request for payment for a single subscription. This includes a set of line items, which correspond to prices in the subscription's plan and can represent fixed recurring fees or usage-based fees. They are generated at the end of a billing period, or as the result of an action, such as a cancellation.

func (*Invoice) UnmarshalJSON

func (r *Invoice) UnmarshalJSON(data []byte) (err error)

type InvoiceAutoCollection

type InvoiceAutoCollection struct {
	// True only if auto-collection is enabled for this invoice.
	Enabled bool `json:"enabled,required,nullable"`
	// If the invoice is scheduled for auto-collection, this field will reflect when
	// the next attempt will occur. If dunning has been exhausted, or auto-collection
	// is not enabled for this invoice, this field will be `null`.
	NextAttemptAt time.Time `json:"next_attempt_at,required,nullable" format:"date-time"`
	// If Orb has ever attempted payment auto-collection for this invoice, this field
	// will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
	// this can be used to tell whether the invoice is currently in dunning (that is,
	// `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or
	// if dunning has been exhausted (`previously_attempted_at` is non-null, but
	// `next_attempt_time` is null).
	PreviouslyAttemptedAt time.Time                 `json:"previously_attempted_at,required,nullable" format:"date-time"`
	JSON                  invoiceAutoCollectionJSON `json:"-"`
}

func (*InvoiceAutoCollection) UnmarshalJSON

func (r *InvoiceAutoCollection) UnmarshalJSON(data []byte) (err error)

type InvoiceBillingAddress

type InvoiceBillingAddress struct {
	City       string                    `json:"city,required,nullable"`
	Country    string                    `json:"country,required,nullable"`
	Line1      string                    `json:"line1,required,nullable"`
	Line2      string                    `json:"line2,required,nullable"`
	PostalCode string                    `json:"postal_code,required,nullable"`
	State      string                    `json:"state,required,nullable"`
	JSON       invoiceBillingAddressJSON `json:"-"`
}

func (*InvoiceBillingAddress) UnmarshalJSON

func (r *InvoiceBillingAddress) UnmarshalJSON(data []byte) (err error)

type InvoiceCreditNote

type InvoiceCreditNote struct {
	ID               string `json:"id,required"`
	CreditNoteNumber string `json:"credit_note_number,required"`
	// An optional memo supplied on the credit note.
	Memo   string `json:"memo,required,nullable"`
	Reason string `json:"reason,required"`
	Total  string `json:"total,required"`
	Type   string `json:"type,required"`
	// If the credit note has a status of `void`, this gives a timestamp when the
	// credit note was voided.
	VoidedAt time.Time             `json:"voided_at,required,nullable" format:"date-time"`
	JSON     invoiceCreditNoteJSON `json:"-"`
}

func (*InvoiceCreditNote) UnmarshalJSON

func (r *InvoiceCreditNote) UnmarshalJSON(data []byte) (err error)

type InvoiceCustomer

type InvoiceCustomer struct {
	ID                 string              `json:"id,required"`
	ExternalCustomerID string              `json:"external_customer_id,required,nullable"`
	JSON               invoiceCustomerJSON `json:"-"`
}

func (*InvoiceCustomer) UnmarshalJSON

func (r *InvoiceCustomer) UnmarshalJSON(data []byte) (err error)

type InvoiceCustomerBalanceTransaction

type InvoiceCustomerBalanceTransaction struct {
	// A unique id for this transaction.
	ID     string                                   `json:"id,required"`
	Action InvoiceCustomerBalanceTransactionsAction `json:"action,required"`
	// The value of the amount changed in the transaction.
	Amount string `json:"amount,required"`
	// The creation time of this transaction.
	CreatedAt  time.Time                                    `json:"created_at,required" format:"date-time"`
	CreditNote InvoiceCustomerBalanceTransactionsCreditNote `json:"credit_note,required,nullable"`
	// An optional description provided for manual customer balance adjustments.
	Description string `json:"description,required,nullable"`
	// The new value of the customer's balance prior to the transaction, in the
	// customer's currency.
	EndingBalance string                                    `json:"ending_balance,required"`
	Invoice       InvoiceCustomerBalanceTransactionsInvoice `json:"invoice,required,nullable"`
	// The original value of the customer's balance prior to the transaction, in the
	// customer's currency.
	StartingBalance string                                 `json:"starting_balance,required"`
	Type            InvoiceCustomerBalanceTransactionsType `json:"type,required"`
	JSON            invoiceCustomerBalanceTransactionJSON  `json:"-"`
}

func (*InvoiceCustomerBalanceTransaction) UnmarshalJSON

func (r *InvoiceCustomerBalanceTransaction) UnmarshalJSON(data []byte) (err error)

type InvoiceCustomerBalanceTransactionsAction

type InvoiceCustomerBalanceTransactionsAction string
const (
	InvoiceCustomerBalanceTransactionsActionAppliedToInvoice     InvoiceCustomerBalanceTransactionsAction = "applied_to_invoice"
	InvoiceCustomerBalanceTransactionsActionManualAdjustment     InvoiceCustomerBalanceTransactionsAction = "manual_adjustment"
	InvoiceCustomerBalanceTransactionsActionProratedRefund       InvoiceCustomerBalanceTransactionsAction = "prorated_refund"
	InvoiceCustomerBalanceTransactionsActionRevertProratedRefund InvoiceCustomerBalanceTransactionsAction = "revert_prorated_refund"
	InvoiceCustomerBalanceTransactionsActionReturnFromVoiding    InvoiceCustomerBalanceTransactionsAction = "return_from_voiding"
	InvoiceCustomerBalanceTransactionsActionCreditNoteApplied    InvoiceCustomerBalanceTransactionsAction = "credit_note_applied"
	InvoiceCustomerBalanceTransactionsActionCreditNoteVoided     InvoiceCustomerBalanceTransactionsAction = "credit_note_voided"
	InvoiceCustomerBalanceTransactionsActionOverpaymentRefund    InvoiceCustomerBalanceTransactionsAction = "overpayment_refund"
)

func (InvoiceCustomerBalanceTransactionsAction) IsKnown added in v0.24.0

type InvoiceCustomerBalanceTransactionsCreditNote

type InvoiceCustomerBalanceTransactionsCreditNote struct {
	// The id of the Credit note
	ID   string                                           `json:"id,required"`
	JSON invoiceCustomerBalanceTransactionsCreditNoteJSON `json:"-"`
}

func (*InvoiceCustomerBalanceTransactionsCreditNote) UnmarshalJSON

func (r *InvoiceCustomerBalanceTransactionsCreditNote) UnmarshalJSON(data []byte) (err error)

type InvoiceCustomerBalanceTransactionsInvoice

type InvoiceCustomerBalanceTransactionsInvoice struct {
	// The Invoice id
	ID   string                                        `json:"id,required"`
	JSON invoiceCustomerBalanceTransactionsInvoiceJSON `json:"-"`
}

func (*InvoiceCustomerBalanceTransactionsInvoice) UnmarshalJSON

func (r *InvoiceCustomerBalanceTransactionsInvoice) UnmarshalJSON(data []byte) (err error)

type InvoiceCustomerBalanceTransactionsType

type InvoiceCustomerBalanceTransactionsType string
const (
	InvoiceCustomerBalanceTransactionsTypeIncrement InvoiceCustomerBalanceTransactionsType = "increment"
	InvoiceCustomerBalanceTransactionsTypeDecrement InvoiceCustomerBalanceTransactionsType = "decrement"
)

func (InvoiceCustomerBalanceTransactionsType) IsKnown added in v0.24.0

type InvoiceCustomerTaxID

type InvoiceCustomerTaxID struct {
	Country InvoiceCustomerTaxIDCountry `json:"country,required"`
	Type    InvoiceCustomerTaxIDType    `json:"type,required"`
	Value   string                      `json:"value,required"`
	JSON    invoiceCustomerTaxIDJSON    `json:"-"`
}

Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices.

### Supported Tax ID Countries and Types

| Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | | Belgium | `eu_vat` | European VAT number | | Brazil | `br_cnpj` | Brazilian CNPJ number | | Brazil | `br_cpf` | Brazilian CPF number | | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | | Bulgaria | `eu_vat` | European VAT number | | Canada | `ca_bn` | Canadian BN | | Canada | `ca_gst_hst` | Canadian GST/HST number | | Canada | `ca_pst_bc` | Canadian PST number (British Columbia) | | Canada | `ca_pst_mb` | Canadian PST number (Manitoba) | | Canada | `ca_pst_sk` | Canadian PST number (Saskatchewan) | | Canada | `ca_qst` | Canadian QST number (Québec) | | Chile | `cl_tin` | Chilean TIN | | Croatia | `eu_vat` | European VAT number | | Cyprus | `eu_vat` | European VAT number | | Czech Republic | `eu_vat` | European VAT number | | Denmark | `eu_vat` | European VAT number | | Egypt | `eg_tin` | Egyptian Tax Identification Number | | Estonia | `eu_vat` | European VAT number | | EU | `eu_oss_vat` | European One Stop Shop VAT number for non-Union scheme | | Finland | `eu_vat` | European VAT number | | France | `eu_vat` | European VAT number | | Georgia | `ge_vat` | Georgian VAT | | Germany | `eu_vat` | European VAT number | | Greece | `eu_vat` | European VAT number | | Hong Kong | `hk_br` | Hong Kong BR number | | Hungary | `eu_vat` | European VAT number | | Hungary | `hu_tin` | Hungary tax number (adószám) | | Iceland | `is_vat` | Icelandic VAT | | India | `in_gst` | Indian GST number | | Indonesia | `id_npwp` | Indonesian NPWP number | | Ireland | `eu_vat` | European VAT number | | Israel | `il_vat` | Israel VAT | | Italy | `eu_vat` | European VAT number | | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | | Latvia | `eu_vat` | European VAT number | | Liechtenstein | `li_uid` | Liechtensteinian UID number | | Lithuania | `eu_vat` | European VAT number | | Luxembourg | `eu_vat` | European VAT number | | Malaysia | `my_frp` | Malaysian FRP number | | Malaysia | `my_itn` | Malaysian ITN | | Malaysia | `my_sst` | Malaysian SST number | | Malta | `eu_vat ` | European VAT number | | Mexico | `mx_rfc` | Mexican RFC number | | Netherlands | `eu_vat` | European VAT number | | New Zealand | `nz_gst` | New Zealand GST number | | Norway | `no_vat` | Norwegian VAT number | | Philippines | `ph_tin ` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT number | | Portugal | `eu_vat` | European VAT number | | Romania | `eu_vat` | European VAT number | | Russia | `ru_inn` | Russian INN | | Russia | `ru_kpp` | Russian KPP | | Saudi Arabia | `sg_gst` | Singaporean GST | | Singapore | `sg_uen` | Singaporean UEN | | Slovakia | `eu_vat` | European VAT number | | Slovenia | `eu_vat` | European VAT number | | Slovenia | `si_tin` | Slovenia tax number (davčna številka) | | South Africa | `za_vat` | South African VAT number | | South Korea | `kr_brn` | Korean BRN | | Spain | `es_cif` | Spanish NIF number (previously Spanish CIF number) | | Spain | `eu_vat` | European VAT number | | Sweden | `eu_vat` | European VAT number | | Switzerland | `ch_vat` | Switzerland VAT number | | Taiwan | `tw_vat` | Taiwanese VAT | | Thailand | `th_vat` | Thai VAT | | Turkey | `tr_tin` | Turkish Tax Identification Number | | Ukraine | `ua_vat` | Ukrainian VAT | | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | | United Kingdom | `eu_vat` | Northern Ireland VAT number | | United Kingdom | `gb_vat` | United Kingdom VAT number | | United States | `us_ein` | United States EIN |

func (*InvoiceCustomerTaxID) UnmarshalJSON

func (r *InvoiceCustomerTaxID) UnmarshalJSON(data []byte) (err error)

type InvoiceCustomerTaxIDCountry added in v0.2.0

type InvoiceCustomerTaxIDCountry string
const (
	InvoiceCustomerTaxIDCountryAd InvoiceCustomerTaxIDCountry = "AD"
	InvoiceCustomerTaxIDCountryAe InvoiceCustomerTaxIDCountry = "AE"
	InvoiceCustomerTaxIDCountryAt InvoiceCustomerTaxIDCountry = "AT"
	InvoiceCustomerTaxIDCountryAu InvoiceCustomerTaxIDCountry = "AU"
	InvoiceCustomerTaxIDCountryBe InvoiceCustomerTaxIDCountry = "BE"
	InvoiceCustomerTaxIDCountryBg InvoiceCustomerTaxIDCountry = "BG"
	InvoiceCustomerTaxIDCountryBr InvoiceCustomerTaxIDCountry = "BR"
	InvoiceCustomerTaxIDCountryCa InvoiceCustomerTaxIDCountry = "CA"
	InvoiceCustomerTaxIDCountryCh InvoiceCustomerTaxIDCountry = "CH"
	InvoiceCustomerTaxIDCountryCl InvoiceCustomerTaxIDCountry = "CL"
	InvoiceCustomerTaxIDCountryCy InvoiceCustomerTaxIDCountry = "CY"
	InvoiceCustomerTaxIDCountryCz InvoiceCustomerTaxIDCountry = "CZ"
	InvoiceCustomerTaxIDCountryDe InvoiceCustomerTaxIDCountry = "DE"
	InvoiceCustomerTaxIDCountryDk InvoiceCustomerTaxIDCountry = "DK"
	InvoiceCustomerTaxIDCountryEe InvoiceCustomerTaxIDCountry = "EE"
	InvoiceCustomerTaxIDCountryEg InvoiceCustomerTaxIDCountry = "EG"
	InvoiceCustomerTaxIDCountryEs InvoiceCustomerTaxIDCountry = "ES"
	InvoiceCustomerTaxIDCountryEu InvoiceCustomerTaxIDCountry = "EU"
	InvoiceCustomerTaxIDCountryFi InvoiceCustomerTaxIDCountry = "FI"
	InvoiceCustomerTaxIDCountryFr InvoiceCustomerTaxIDCountry = "FR"
	InvoiceCustomerTaxIDCountryGB InvoiceCustomerTaxIDCountry = "GB"
	InvoiceCustomerTaxIDCountryGe InvoiceCustomerTaxIDCountry = "GE"
	InvoiceCustomerTaxIDCountryGr InvoiceCustomerTaxIDCountry = "GR"
	InvoiceCustomerTaxIDCountryHk InvoiceCustomerTaxIDCountry = "HK"
	InvoiceCustomerTaxIDCountryHr InvoiceCustomerTaxIDCountry = "HR"
	InvoiceCustomerTaxIDCountryHu InvoiceCustomerTaxIDCountry = "HU"
	InvoiceCustomerTaxIDCountryID InvoiceCustomerTaxIDCountry = "ID"
	InvoiceCustomerTaxIDCountryIe InvoiceCustomerTaxIDCountry = "IE"
	InvoiceCustomerTaxIDCountryIl InvoiceCustomerTaxIDCountry = "IL"
	InvoiceCustomerTaxIDCountryIn InvoiceCustomerTaxIDCountry = "IN"
	InvoiceCustomerTaxIDCountryIs InvoiceCustomerTaxIDCountry = "IS"
	InvoiceCustomerTaxIDCountryIt InvoiceCustomerTaxIDCountry = "IT"
	InvoiceCustomerTaxIDCountryJp InvoiceCustomerTaxIDCountry = "JP"
	InvoiceCustomerTaxIDCountryKe InvoiceCustomerTaxIDCountry = "KE"
	InvoiceCustomerTaxIDCountryKr InvoiceCustomerTaxIDCountry = "KR"
	InvoiceCustomerTaxIDCountryLi InvoiceCustomerTaxIDCountry = "LI"
	InvoiceCustomerTaxIDCountryLt InvoiceCustomerTaxIDCountry = "LT"
	InvoiceCustomerTaxIDCountryLu InvoiceCustomerTaxIDCountry = "LU"
	InvoiceCustomerTaxIDCountryLv InvoiceCustomerTaxIDCountry = "LV"
	InvoiceCustomerTaxIDCountryMt InvoiceCustomerTaxIDCountry = "MT"
	InvoiceCustomerTaxIDCountryMx InvoiceCustomerTaxIDCountry = "MX"
	InvoiceCustomerTaxIDCountryMy InvoiceCustomerTaxIDCountry = "MY"
	InvoiceCustomerTaxIDCountryNl InvoiceCustomerTaxIDCountry = "NL"
	InvoiceCustomerTaxIDCountryNo InvoiceCustomerTaxIDCountry = "NO"
	InvoiceCustomerTaxIDCountryNz InvoiceCustomerTaxIDCountry = "NZ"
	InvoiceCustomerTaxIDCountryPh InvoiceCustomerTaxIDCountry = "PH"
	InvoiceCustomerTaxIDCountryPl InvoiceCustomerTaxIDCountry = "PL"
	InvoiceCustomerTaxIDCountryPt InvoiceCustomerTaxIDCountry = "PT"
	InvoiceCustomerTaxIDCountryRo InvoiceCustomerTaxIDCountry = "RO"
	InvoiceCustomerTaxIDCountryRu InvoiceCustomerTaxIDCountry = "RU"
	InvoiceCustomerTaxIDCountrySa InvoiceCustomerTaxIDCountry = "SA"
	InvoiceCustomerTaxIDCountrySe InvoiceCustomerTaxIDCountry = "SE"
	InvoiceCustomerTaxIDCountrySg InvoiceCustomerTaxIDCountry = "SG"
	InvoiceCustomerTaxIDCountrySi InvoiceCustomerTaxIDCountry = "SI"
	InvoiceCustomerTaxIDCountrySk InvoiceCustomerTaxIDCountry = "SK"
	InvoiceCustomerTaxIDCountryTh InvoiceCustomerTaxIDCountry = "TH"
	InvoiceCustomerTaxIDCountryTr InvoiceCustomerTaxIDCountry = "TR"
	InvoiceCustomerTaxIDCountryTw InvoiceCustomerTaxIDCountry = "TW"
	InvoiceCustomerTaxIDCountryUa InvoiceCustomerTaxIDCountry = "UA"
	InvoiceCustomerTaxIDCountryUs InvoiceCustomerTaxIDCountry = "US"
	InvoiceCustomerTaxIDCountryZa InvoiceCustomerTaxIDCountry = "ZA"
)

func (InvoiceCustomerTaxIDCountry) IsKnown added in v0.24.0

func (r InvoiceCustomerTaxIDCountry) IsKnown() bool

type InvoiceCustomerTaxIDType added in v0.2.0

type InvoiceCustomerTaxIDType string
const (
	InvoiceCustomerTaxIDTypeAdNrt    InvoiceCustomerTaxIDType = "ad_nrt"
	InvoiceCustomerTaxIDTypeAeTrn    InvoiceCustomerTaxIDType = "ae_trn"
	InvoiceCustomerTaxIDTypeEuVat    InvoiceCustomerTaxIDType = "eu_vat"
	InvoiceCustomerTaxIDTypeAuAbn    InvoiceCustomerTaxIDType = "au_abn"
	InvoiceCustomerTaxIDTypeAuArn    InvoiceCustomerTaxIDType = "au_arn"
	InvoiceCustomerTaxIDTypeBgUic    InvoiceCustomerTaxIDType = "bg_uic"
	InvoiceCustomerTaxIDTypeBrCnpj   InvoiceCustomerTaxIDType = "br_cnpj"
	InvoiceCustomerTaxIDTypeBrCpf    InvoiceCustomerTaxIDType = "br_cpf"
	InvoiceCustomerTaxIDTypeCaBn     InvoiceCustomerTaxIDType = "ca_bn"
	InvoiceCustomerTaxIDTypeCaGstHst InvoiceCustomerTaxIDType = "ca_gst_hst"
	InvoiceCustomerTaxIDTypeCaPstBc  InvoiceCustomerTaxIDType = "ca_pst_bc"
	InvoiceCustomerTaxIDTypeCaPstMB  InvoiceCustomerTaxIDType = "ca_pst_mb"
	InvoiceCustomerTaxIDTypeCaPstSk  InvoiceCustomerTaxIDType = "ca_pst_sk"
	InvoiceCustomerTaxIDTypeCaQst    InvoiceCustomerTaxIDType = "ca_qst"
	InvoiceCustomerTaxIDTypeChVat    InvoiceCustomerTaxIDType = "ch_vat"
	InvoiceCustomerTaxIDTypeClTin    InvoiceCustomerTaxIDType = "cl_tin"
	InvoiceCustomerTaxIDTypeEgTin    InvoiceCustomerTaxIDType = "eg_tin"
	InvoiceCustomerTaxIDTypeEsCif    InvoiceCustomerTaxIDType = "es_cif"
	InvoiceCustomerTaxIDTypeEuOssVat InvoiceCustomerTaxIDType = "eu_oss_vat"
	InvoiceCustomerTaxIDTypeGBVat    InvoiceCustomerTaxIDType = "gb_vat"
	InvoiceCustomerTaxIDTypeGeVat    InvoiceCustomerTaxIDType = "ge_vat"
	InvoiceCustomerTaxIDTypeHkBr     InvoiceCustomerTaxIDType = "hk_br"
	InvoiceCustomerTaxIDTypeHuTin    InvoiceCustomerTaxIDType = "hu_tin"
	InvoiceCustomerTaxIDTypeIDNpwp   InvoiceCustomerTaxIDType = "id_npwp"
	InvoiceCustomerTaxIDTypeIlVat    InvoiceCustomerTaxIDType = "il_vat"
	InvoiceCustomerTaxIDTypeInGst    InvoiceCustomerTaxIDType = "in_gst"
	InvoiceCustomerTaxIDTypeIsVat    InvoiceCustomerTaxIDType = "is_vat"
	InvoiceCustomerTaxIDTypeJpCn     InvoiceCustomerTaxIDType = "jp_cn"
	InvoiceCustomerTaxIDTypeJpRn     InvoiceCustomerTaxIDType = "jp_rn"
	InvoiceCustomerTaxIDTypeJpTrn    InvoiceCustomerTaxIDType = "jp_trn"
	InvoiceCustomerTaxIDTypeKePin    InvoiceCustomerTaxIDType = "ke_pin"
	InvoiceCustomerTaxIDTypeKrBrn    InvoiceCustomerTaxIDType = "kr_brn"
	InvoiceCustomerTaxIDTypeLiUid    InvoiceCustomerTaxIDType = "li_uid"
	InvoiceCustomerTaxIDTypeMxRfc    InvoiceCustomerTaxIDType = "mx_rfc"
	InvoiceCustomerTaxIDTypeMyFrp    InvoiceCustomerTaxIDType = "my_frp"
	InvoiceCustomerTaxIDTypeMyItn    InvoiceCustomerTaxIDType = "my_itn"
	InvoiceCustomerTaxIDTypeMySst    InvoiceCustomerTaxIDType = "my_sst"
	InvoiceCustomerTaxIDTypeNoVat    InvoiceCustomerTaxIDType = "no_vat"
	InvoiceCustomerTaxIDTypeNzGst    InvoiceCustomerTaxIDType = "nz_gst"
	InvoiceCustomerTaxIDTypePhTin    InvoiceCustomerTaxIDType = "ph_tin"
	InvoiceCustomerTaxIDTypeRuInn    InvoiceCustomerTaxIDType = "ru_inn"
	InvoiceCustomerTaxIDTypeRuKpp    InvoiceCustomerTaxIDType = "ru_kpp"
	InvoiceCustomerTaxIDTypeSaVat    InvoiceCustomerTaxIDType = "sa_vat"
	InvoiceCustomerTaxIDTypeSgGst    InvoiceCustomerTaxIDType = "sg_gst"
	InvoiceCustomerTaxIDTypeSgUen    InvoiceCustomerTaxIDType = "sg_uen"
	InvoiceCustomerTaxIDTypeSiTin    InvoiceCustomerTaxIDType = "si_tin"
	InvoiceCustomerTaxIDTypeThVat    InvoiceCustomerTaxIDType = "th_vat"
	InvoiceCustomerTaxIDTypeTrTin    InvoiceCustomerTaxIDType = "tr_tin"
	InvoiceCustomerTaxIDTypeTwVat    InvoiceCustomerTaxIDType = "tw_vat"
	InvoiceCustomerTaxIDTypeUaVat    InvoiceCustomerTaxIDType = "ua_vat"
	InvoiceCustomerTaxIDTypeUsEin    InvoiceCustomerTaxIDType = "us_ein"
	InvoiceCustomerTaxIDTypeZaVat    InvoiceCustomerTaxIDType = "za_vat"
)

func (InvoiceCustomerTaxIDType) IsKnown added in v0.24.0

func (r InvoiceCustomerTaxIDType) IsKnown() bool

type InvoiceFetchUpcomingParams

type InvoiceFetchUpcomingParams struct {
	SubscriptionID param.Field[string] `query:"subscription_id"`
}

func (InvoiceFetchUpcomingParams) URLQuery

func (r InvoiceFetchUpcomingParams) URLQuery() (v url.Values)

URLQuery serializes InvoiceFetchUpcomingParams's query parameters as `url.Values`.

type InvoiceFetchUpcomingResponse

type InvoiceFetchUpcomingResponse struct {
	ID string `json:"id,required"`
	// This is the final amount required to be charged to the customer and reflects the
	// application of the customer balance to the `total` of the invoice.
	AmountDue      string                                     `json:"amount_due,required"`
	AutoCollection InvoiceFetchUpcomingResponseAutoCollection `json:"auto_collection,required"`
	BillingAddress InvoiceFetchUpcomingResponseBillingAddress `json:"billing_address,required,nullable"`
	// The creation time of the resource in Orb.
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// A list of credit notes associated with the invoice
	CreditNotes []InvoiceFetchUpcomingResponseCreditNote `json:"credit_notes,required"`
	// An ISO 4217 currency string or `credits`
	Currency                    string                                                   `json:"currency,required"`
	Customer                    InvoiceFetchUpcomingResponseCustomer                     `json:"customer,required"`
	CustomerBalanceTransactions []InvoiceFetchUpcomingResponseCustomerBalanceTransaction `json:"customer_balance_transactions,required"`
	// Tax IDs are commonly required to be displayed on customer invoices, which are
	// added to the headers of invoices.
	//
	// ### Supported Tax ID Countries and Types
	//
	// | Country              | Type         | Description                                                                                             |
	// | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
	// | Andorra              | `ad_nrt`     | Andorran NRT number                                                                                     |
	// | Australia            | `au_abn`     | Australian Business Number (AU ABN)                                                                     |
	// | Australia            | `au_arn`     | Australian Taxation Office Reference Number                                                             |
	// | Austria              | `eu_vat`     | European VAT number                                                                                     |
	// | Belgium              | `eu_vat`     | European VAT number                                                                                     |
	// | Brazil               | `br_cnpj`    | Brazilian CNPJ number                                                                                   |
	// | Brazil               | `br_cpf`     | Brazilian CPF number                                                                                    |
	// | Bulgaria             | `bg_uic`     | Bulgaria Unified Identification Code                                                                    |
	// | Bulgaria             | `eu_vat`     | European VAT number                                                                                     |
	// | Canada               | `ca_bn`      | Canadian BN                                                                                             |
	// | Canada               | `ca_gst_hst` | Canadian GST/HST number                                                                                 |
	// | Canada               | `ca_pst_bc`  | Canadian PST number (British Columbia)                                                                  |
	// | Canada               | `ca_pst_mb`  | Canadian PST number (Manitoba)                                                                          |
	// | Canada               | `ca_pst_sk`  | Canadian PST number (Saskatchewan)                                                                      |
	// | Canada               | `ca_qst`     | Canadian QST number (Québec)                                                                            |
	// | Chile                | `cl_tin`     | Chilean TIN                                                                                             |
	// | Croatia              | `eu_vat`     | European VAT number                                                                                     |
	// | Cyprus               | `eu_vat`     | European VAT number                                                                                     |
	// | Czech Republic       | `eu_vat`     | European VAT number                                                                                     |
	// | Denmark              | `eu_vat`     | European VAT number                                                                                     |
	// | Egypt                | `eg_tin`     | Egyptian Tax Identification Number                                                                      |
	// | Estonia              | `eu_vat`     | European VAT number                                                                                     |
	// | EU                   | `eu_oss_vat` | European One Stop Shop VAT number for non-Union scheme                                                  |
	// | Finland              | `eu_vat`     | European VAT number                                                                                     |
	// | France               | `eu_vat`     | European VAT number                                                                                     |
	// | Georgia              | `ge_vat`     | Georgian VAT                                                                                            |
	// | Germany              | `eu_vat`     | European VAT number                                                                                     |
	// | Greece               | `eu_vat`     | European VAT number                                                                                     |
	// | Hong Kong            | `hk_br`      | Hong Kong BR number                                                                                     |
	// | Hungary              | `eu_vat`     | European VAT number                                                                                     |
	// | Hungary              | `hu_tin`     | Hungary tax number (adószám)                                                                            |
	// | Iceland              | `is_vat`     | Icelandic VAT                                                                                           |
	// | India                | `in_gst`     | Indian GST number                                                                                       |
	// | Indonesia            | `id_npwp`    | Indonesian NPWP number                                                                                  |
	// | Ireland              | `eu_vat`     | European VAT number                                                                                     |
	// | Israel               | `il_vat`     | Israel VAT                                                                                              |
	// | Italy                | `eu_vat`     | European VAT number                                                                                     |
	// | Japan                | `jp_cn`      | Japanese Corporate Number (_Hōjin Bangō_)                                                               |
	// | Japan                | `jp_rn`      | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
	// | Japan                | `jp_trn`     | Japanese Tax Registration Number (_Tōroku Bangō_)                                                       |
	// | Kenya                | `ke_pin`     | Kenya Revenue Authority Personal Identification Number                                                  |
	// | Latvia               | `eu_vat`     | European VAT number                                                                                     |
	// | Liechtenstein        | `li_uid`     | Liechtensteinian UID number                                                                             |
	// | Lithuania            | `eu_vat`     | European VAT number                                                                                     |
	// | Luxembourg           | `eu_vat`     | European VAT number                                                                                     |
	// | Malaysia             | `my_frp`     | Malaysian FRP number                                                                                    |
	// | Malaysia             | `my_itn`     | Malaysian ITN                                                                                           |
	// | Malaysia             | `my_sst`     | Malaysian SST number                                                                                    |
	// | Malta                | `eu_vat `    | European VAT number                                                                                     |
	// | Mexico               | `mx_rfc`     | Mexican RFC number                                                                                      |
	// | Netherlands          | `eu_vat`     | European VAT number                                                                                     |
	// | New Zealand          | `nz_gst`     | New Zealand GST number                                                                                  |
	// | Norway               | `no_vat`     | Norwegian VAT number                                                                                    |
	// | Philippines          | `ph_tin `    | Philippines Tax Identification Number                                                                   |
	// | Poland               | `eu_vat`     | European VAT number                                                                                     |
	// | Portugal             | `eu_vat`     | European VAT number                                                                                     |
	// | Romania              | `eu_vat`     | European VAT number                                                                                     |
	// | Russia               | `ru_inn`     | Russian INN                                                                                             |
	// | Russia               | `ru_kpp`     | Russian KPP                                                                                             |
	// | Saudi Arabia         | `sg_gst`     | Singaporean GST                                                                                         |
	// | Singapore            | `sg_uen`     | Singaporean UEN                                                                                         |
	// | Slovakia             | `eu_vat`     | European VAT number                                                                                     |
	// | Slovenia             | `eu_vat`     | European VAT number                                                                                     |
	// | Slovenia             | `si_tin`     | Slovenia tax number (davčna številka)                                                                   |
	// | South Africa         | `za_vat`     | South African VAT number                                                                                |
	// | South Korea          | `kr_brn`     | Korean BRN                                                                                              |
	// | Spain                | `es_cif`     | Spanish NIF number (previously Spanish CIF number)                                                      |
	// | Spain                | `eu_vat`     | European VAT number                                                                                     |
	// | Sweden               | `eu_vat`     | European VAT number                                                                                     |
	// | Switzerland          | `ch_vat`     | Switzerland VAT number                                                                                  |
	// | Taiwan               | `tw_vat`     | Taiwanese VAT                                                                                           |
	// | Thailand             | `th_vat`     | Thai VAT                                                                                                |
	// | Turkey               | `tr_tin`     | Turkish Tax Identification Number                                                                       |
	// | Ukraine              | `ua_vat`     | Ukrainian VAT                                                                                           |
	// | United Arab Emirates | `ae_trn`     | United Arab Emirates TRN                                                                                |
	// | United Kingdom       | `eu_vat`     | Northern Ireland VAT number                                                                             |
	// | United Kingdom       | `gb_vat`     | United Kingdom VAT number                                                                               |
	// | United States        | `us_ein`     | United States EIN                                                                                       |
	CustomerTaxID InvoiceFetchUpcomingResponseCustomerTaxID `json:"customer_tax_id,required,nullable"`
	Discount      shared.Discount                           `json:"discount,required,nullable"`
	Discounts     []shared.Discount                         `json:"discounts,required"`
	// When the invoice payment is due.
	DueDate time.Time `json:"due_date,required" format:"date-time"`
	// If the invoice has a status of `draft`, this will be the time that the invoice
	// will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is
	// true, the invoice will automatically begin issuing at this time.
	EligibleToIssueAt time.Time `json:"eligible_to_issue_at,required,nullable" format:"date-time"`
	// A URL for the invoice portal.
	HostedInvoiceURL string `json:"hosted_invoice_url,required,nullable"`
	// Automatically generated invoice number to help track and reconcile invoices.
	// Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per
	// account or customer.
	InvoiceNumber string `json:"invoice_number,required"`
	// The link to download the PDF representation of the `Invoice`.
	InvoicePdf string `json:"invoice_pdf,required,nullable"`
	// If the invoice failed to issue, this will be the last time it failed to issue
	// (even if it is now in a different state.)
	IssueFailedAt time.Time `json:"issue_failed_at,required,nullable" format:"date-time"`
	// If the invoice has been issued, this will be the time it transitioned to
	// `issued` (even if it is now in a different state.)
	IssuedAt time.Time `json:"issued_at,required,nullable" format:"date-time"`
	// The breakdown of prices in this invoice.
	LineItems     []InvoiceFetchUpcomingResponseLineItem `json:"line_items,required"`
	Maximum       InvoiceFetchUpcomingResponseMaximum    `json:"maximum,required,nullable"`
	MaximumAmount string                                 `json:"maximum_amount,required,nullable"`
	// Free-form text which is available on the invoice PDF and the Orb invoice portal.
	Memo string `json:"memo,required,nullable"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata      map[string]string                   `json:"metadata,required"`
	Minimum       InvoiceFetchUpcomingResponseMinimum `json:"minimum,required,nullable"`
	MinimumAmount string                              `json:"minimum_amount,required,nullable"`
	// If the invoice has a status of `paid`, this gives a timestamp when the invoice
	// was paid.
	PaidAt time.Time `json:"paid_at,required,nullable" format:"date-time"`
	// If payment was attempted on this invoice but failed, this will be the time of
	// the most recent attempt.
	PaymentFailedAt time.Time `json:"payment_failed_at,required,nullable" format:"date-time"`
	// If payment was attempted on this invoice, this will be the start time of the
	// most recent attempt. This field is especially useful for delayed-notification
	// payment mechanisms (like bank transfers), where payment can take 3 days or more.
	PaymentStartedAt time.Time `json:"payment_started_at,required,nullable" format:"date-time"`
	// If the invoice is in draft, this timestamp will reflect when the invoice is
	// scheduled to be issued.
	ScheduledIssueAt time.Time                                   `json:"scheduled_issue_at,required,nullable" format:"date-time"`
	ShippingAddress  InvoiceFetchUpcomingResponseShippingAddress `json:"shipping_address,required,nullable"`
	Status           InvoiceFetchUpcomingResponseStatus          `json:"status,required"`
	Subscription     InvoiceFetchUpcomingResponseSubscription    `json:"subscription,required,nullable"`
	// The total before any discounts and minimums are applied.
	Subtotal string `json:"subtotal,required"`
	// If the invoice failed to sync, this will be the last time an external invoicing
	// provider sync was attempted. This field will always be `null` for invoices using
	// Orb Invoicing.
	SyncFailedAt time.Time `json:"sync_failed_at,required,nullable" format:"date-time"`
	// The scheduled date of the invoice
	TargetDate time.Time `json:"target_date,required" format:"date-time"`
	// The total after any minimums and discounts have been applied.
	Total string `json:"total,required"`
	// If the invoice has a status of `void`, this gives a timestamp when the invoice
	// was voided.
	VoidedAt time.Time `json:"voided_at,required,nullable" format:"date-time"`
	// This is true if the invoice will be automatically issued in the future, and
	// false otherwise.
	WillAutoIssue bool                             `json:"will_auto_issue,required"`
	JSON          invoiceFetchUpcomingResponseJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponse) UnmarshalJSON

func (r *InvoiceFetchUpcomingResponse) UnmarshalJSON(data []byte) (err error)

type InvoiceFetchUpcomingResponseAutoCollection

type InvoiceFetchUpcomingResponseAutoCollection struct {
	// True only if auto-collection is enabled for this invoice.
	Enabled bool `json:"enabled,required,nullable"`
	// If the invoice is scheduled for auto-collection, this field will reflect when
	// the next attempt will occur. If dunning has been exhausted, or auto-collection
	// is not enabled for this invoice, this field will be `null`.
	NextAttemptAt time.Time `json:"next_attempt_at,required,nullable" format:"date-time"`
	// If Orb has ever attempted payment auto-collection for this invoice, this field
	// will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
	// this can be used to tell whether the invoice is currently in dunning (that is,
	// `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or
	// if dunning has been exhausted (`previously_attempted_at` is non-null, but
	// `next_attempt_time` is null).
	PreviouslyAttemptedAt time.Time                                      `json:"previously_attempted_at,required,nullable" format:"date-time"`
	JSON                  invoiceFetchUpcomingResponseAutoCollectionJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseAutoCollection) UnmarshalJSON

func (r *InvoiceFetchUpcomingResponseAutoCollection) UnmarshalJSON(data []byte) (err error)

type InvoiceFetchUpcomingResponseBillingAddress

type InvoiceFetchUpcomingResponseBillingAddress struct {
	City       string                                         `json:"city,required,nullable"`
	Country    string                                         `json:"country,required,nullable"`
	Line1      string                                         `json:"line1,required,nullable"`
	Line2      string                                         `json:"line2,required,nullable"`
	PostalCode string                                         `json:"postal_code,required,nullable"`
	State      string                                         `json:"state,required,nullable"`
	JSON       invoiceFetchUpcomingResponseBillingAddressJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseBillingAddress) UnmarshalJSON

func (r *InvoiceFetchUpcomingResponseBillingAddress) UnmarshalJSON(data []byte) (err error)

type InvoiceFetchUpcomingResponseCreditNote

type InvoiceFetchUpcomingResponseCreditNote struct {
	ID               string `json:"id,required"`
	CreditNoteNumber string `json:"credit_note_number,required"`
	// An optional memo supplied on the credit note.
	Memo   string `json:"memo,required,nullable"`
	Reason string `json:"reason,required"`
	Total  string `json:"total,required"`
	Type   string `json:"type,required"`
	// If the credit note has a status of `void`, this gives a timestamp when the
	// credit note was voided.
	VoidedAt time.Time                                  `json:"voided_at,required,nullable" format:"date-time"`
	JSON     invoiceFetchUpcomingResponseCreditNoteJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseCreditNote) UnmarshalJSON

func (r *InvoiceFetchUpcomingResponseCreditNote) UnmarshalJSON(data []byte) (err error)

type InvoiceFetchUpcomingResponseCustomer

type InvoiceFetchUpcomingResponseCustomer struct {
	ID                 string                                   `json:"id,required"`
	ExternalCustomerID string                                   `json:"external_customer_id,required,nullable"`
	JSON               invoiceFetchUpcomingResponseCustomerJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseCustomer) UnmarshalJSON

func (r *InvoiceFetchUpcomingResponseCustomer) UnmarshalJSON(data []byte) (err error)

type InvoiceFetchUpcomingResponseCustomerBalanceTransaction

type InvoiceFetchUpcomingResponseCustomerBalanceTransaction struct {
	// A unique id for this transaction.
	ID     string                                                        `json:"id,required"`
	Action InvoiceFetchUpcomingResponseCustomerBalanceTransactionsAction `json:"action,required"`
	// The value of the amount changed in the transaction.
	Amount string `json:"amount,required"`
	// The creation time of this transaction.
	CreatedAt  time.Time                                                         `json:"created_at,required" format:"date-time"`
	CreditNote InvoiceFetchUpcomingResponseCustomerBalanceTransactionsCreditNote `json:"credit_note,required,nullable"`
	// An optional description provided for manual customer balance adjustments.
	Description string `json:"description,required,nullable"`
	// The new value of the customer's balance prior to the transaction, in the
	// customer's currency.
	EndingBalance string                                                         `json:"ending_balance,required"`
	Invoice       InvoiceFetchUpcomingResponseCustomerBalanceTransactionsInvoice `json:"invoice,required,nullable"`
	// The original value of the customer's balance prior to the transaction, in the
	// customer's currency.
	StartingBalance string                                                      `json:"starting_balance,required"`
	Type            InvoiceFetchUpcomingResponseCustomerBalanceTransactionsType `json:"type,required"`
	JSON            invoiceFetchUpcomingResponseCustomerBalanceTransactionJSON  `json:"-"`
}

func (*InvoiceFetchUpcomingResponseCustomerBalanceTransaction) UnmarshalJSON

func (r *InvoiceFetchUpcomingResponseCustomerBalanceTransaction) UnmarshalJSON(data []byte) (err error)

type InvoiceFetchUpcomingResponseCustomerBalanceTransactionsAction

type InvoiceFetchUpcomingResponseCustomerBalanceTransactionsAction string
const (
	InvoiceFetchUpcomingResponseCustomerBalanceTransactionsActionAppliedToInvoice     InvoiceFetchUpcomingResponseCustomerBalanceTransactionsAction = "applied_to_invoice"
	InvoiceFetchUpcomingResponseCustomerBalanceTransactionsActionManualAdjustment     InvoiceFetchUpcomingResponseCustomerBalanceTransactionsAction = "manual_adjustment"
	InvoiceFetchUpcomingResponseCustomerBalanceTransactionsActionProratedRefund       InvoiceFetchUpcomingResponseCustomerBalanceTransactionsAction = "prorated_refund"
	InvoiceFetchUpcomingResponseCustomerBalanceTransactionsActionRevertProratedRefund InvoiceFetchUpcomingResponseCustomerBalanceTransactionsAction = "revert_prorated_refund"
	InvoiceFetchUpcomingResponseCustomerBalanceTransactionsActionReturnFromVoiding    InvoiceFetchUpcomingResponseCustomerBalanceTransactionsAction = "return_from_voiding"
	InvoiceFetchUpcomingResponseCustomerBalanceTransactionsActionCreditNoteApplied    InvoiceFetchUpcomingResponseCustomerBalanceTransactionsAction = "credit_note_applied"
	InvoiceFetchUpcomingResponseCustomerBalanceTransactionsActionCreditNoteVoided     InvoiceFetchUpcomingResponseCustomerBalanceTransactionsAction = "credit_note_voided"
	InvoiceFetchUpcomingResponseCustomerBalanceTransactionsActionOverpaymentRefund    InvoiceFetchUpcomingResponseCustomerBalanceTransactionsAction = "overpayment_refund"
)

func (InvoiceFetchUpcomingResponseCustomerBalanceTransactionsAction) IsKnown added in v0.24.0

type InvoiceFetchUpcomingResponseCustomerBalanceTransactionsCreditNote

type InvoiceFetchUpcomingResponseCustomerBalanceTransactionsCreditNote struct {
	// The id of the Credit note
	ID   string                                                                `json:"id,required"`
	JSON invoiceFetchUpcomingResponseCustomerBalanceTransactionsCreditNoteJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseCustomerBalanceTransactionsCreditNote) UnmarshalJSON

type InvoiceFetchUpcomingResponseCustomerBalanceTransactionsInvoice

type InvoiceFetchUpcomingResponseCustomerBalanceTransactionsInvoice struct {
	// The Invoice id
	ID   string                                                             `json:"id,required"`
	JSON invoiceFetchUpcomingResponseCustomerBalanceTransactionsInvoiceJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseCustomerBalanceTransactionsInvoice) UnmarshalJSON

type InvoiceFetchUpcomingResponseCustomerBalanceTransactionsType

type InvoiceFetchUpcomingResponseCustomerBalanceTransactionsType string
const (
	InvoiceFetchUpcomingResponseCustomerBalanceTransactionsTypeIncrement InvoiceFetchUpcomingResponseCustomerBalanceTransactionsType = "increment"
	InvoiceFetchUpcomingResponseCustomerBalanceTransactionsTypeDecrement InvoiceFetchUpcomingResponseCustomerBalanceTransactionsType = "decrement"
)

func (InvoiceFetchUpcomingResponseCustomerBalanceTransactionsType) IsKnown added in v0.24.0

type InvoiceFetchUpcomingResponseCustomerTaxID

type InvoiceFetchUpcomingResponseCustomerTaxID struct {
	Country InvoiceFetchUpcomingResponseCustomerTaxIDCountry `json:"country,required"`
	Type    InvoiceFetchUpcomingResponseCustomerTaxIDType    `json:"type,required"`
	Value   string                                           `json:"value,required"`
	JSON    invoiceFetchUpcomingResponseCustomerTaxIDJSON    `json:"-"`
}

Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices.

### Supported Tax ID Countries and Types

| Country | Type | Description | | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- | | Andorra | `ad_nrt` | Andorran NRT number | | Australia | `au_abn` | Australian Business Number (AU ABN) | | Australia | `au_arn` | Australian Taxation Office Reference Number | | Austria | `eu_vat` | European VAT number | | Belgium | `eu_vat` | European VAT number | | Brazil | `br_cnpj` | Brazilian CNPJ number | | Brazil | `br_cpf` | Brazilian CPF number | | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code | | Bulgaria | `eu_vat` | European VAT number | | Canada | `ca_bn` | Canadian BN | | Canada | `ca_gst_hst` | Canadian GST/HST number | | Canada | `ca_pst_bc` | Canadian PST number (British Columbia) | | Canada | `ca_pst_mb` | Canadian PST number (Manitoba) | | Canada | `ca_pst_sk` | Canadian PST number (Saskatchewan) | | Canada | `ca_qst` | Canadian QST number (Québec) | | Chile | `cl_tin` | Chilean TIN | | Croatia | `eu_vat` | European VAT number | | Cyprus | `eu_vat` | European VAT number | | Czech Republic | `eu_vat` | European VAT number | | Denmark | `eu_vat` | European VAT number | | Egypt | `eg_tin` | Egyptian Tax Identification Number | | Estonia | `eu_vat` | European VAT number | | EU | `eu_oss_vat` | European One Stop Shop VAT number for non-Union scheme | | Finland | `eu_vat` | European VAT number | | France | `eu_vat` | European VAT number | | Georgia | `ge_vat` | Georgian VAT | | Germany | `eu_vat` | European VAT number | | Greece | `eu_vat` | European VAT number | | Hong Kong | `hk_br` | Hong Kong BR number | | Hungary | `eu_vat` | European VAT number | | Hungary | `hu_tin` | Hungary tax number (adószám) | | Iceland | `is_vat` | Icelandic VAT | | India | `in_gst` | Indian GST number | | Indonesia | `id_npwp` | Indonesian NPWP number | | Ireland | `eu_vat` | European VAT number | | Israel | `il_vat` | Israel VAT | | Italy | `eu_vat` | European VAT number | | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) | | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) | | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) | | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number | | Latvia | `eu_vat` | European VAT number | | Liechtenstein | `li_uid` | Liechtensteinian UID number | | Lithuania | `eu_vat` | European VAT number | | Luxembourg | `eu_vat` | European VAT number | | Malaysia | `my_frp` | Malaysian FRP number | | Malaysia | `my_itn` | Malaysian ITN | | Malaysia | `my_sst` | Malaysian SST number | | Malta | `eu_vat ` | European VAT number | | Mexico | `mx_rfc` | Mexican RFC number | | Netherlands | `eu_vat` | European VAT number | | New Zealand | `nz_gst` | New Zealand GST number | | Norway | `no_vat` | Norwegian VAT number | | Philippines | `ph_tin ` | Philippines Tax Identification Number | | Poland | `eu_vat` | European VAT number | | Portugal | `eu_vat` | European VAT number | | Romania | `eu_vat` | European VAT number | | Russia | `ru_inn` | Russian INN | | Russia | `ru_kpp` | Russian KPP | | Saudi Arabia | `sg_gst` | Singaporean GST | | Singapore | `sg_uen` | Singaporean UEN | | Slovakia | `eu_vat` | European VAT number | | Slovenia | `eu_vat` | European VAT number | | Slovenia | `si_tin` | Slovenia tax number (davčna številka) | | South Africa | `za_vat` | South African VAT number | | South Korea | `kr_brn` | Korean BRN | | Spain | `es_cif` | Spanish NIF number (previously Spanish CIF number) | | Spain | `eu_vat` | European VAT number | | Sweden | `eu_vat` | European VAT number | | Switzerland | `ch_vat` | Switzerland VAT number | | Taiwan | `tw_vat` | Taiwanese VAT | | Thailand | `th_vat` | Thai VAT | | Turkey | `tr_tin` | Turkish Tax Identification Number | | Ukraine | `ua_vat` | Ukrainian VAT | | United Arab Emirates | `ae_trn` | United Arab Emirates TRN | | United Kingdom | `eu_vat` | Northern Ireland VAT number | | United Kingdom | `gb_vat` | United Kingdom VAT number | | United States | `us_ein` | United States EIN |

func (*InvoiceFetchUpcomingResponseCustomerTaxID) UnmarshalJSON

func (r *InvoiceFetchUpcomingResponseCustomerTaxID) UnmarshalJSON(data []byte) (err error)

type InvoiceFetchUpcomingResponseCustomerTaxIDCountry added in v0.2.0

type InvoiceFetchUpcomingResponseCustomerTaxIDCountry string
const (
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryAd InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "AD"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryAe InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "AE"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryAt InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "AT"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryAu InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "AU"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryBe InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "BE"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryBg InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "BG"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryBr InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "BR"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryCa InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "CA"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryCh InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "CH"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryCl InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "CL"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryCy InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "CY"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryCz InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "CZ"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryDe InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "DE"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryDk InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "DK"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryEe InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "EE"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryEg InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "EG"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryEs InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "ES"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryEu InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "EU"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryFi InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "FI"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryFr InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "FR"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryGB InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "GB"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryGe InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "GE"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryGr InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "GR"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryHk InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "HK"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryHr InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "HR"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryHu InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "HU"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryID InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "ID"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryIe InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "IE"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryIl InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "IL"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryIn InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "IN"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryIs InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "IS"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryIt InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "IT"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryJp InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "JP"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryKe InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "KE"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryKr InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "KR"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryLi InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "LI"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryLt InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "LT"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryLu InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "LU"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryLv InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "LV"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryMt InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "MT"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryMx InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "MX"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryMy InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "MY"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryNl InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "NL"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryNo InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "NO"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryNz InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "NZ"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryPh InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "PH"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryPl InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "PL"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryPt InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "PT"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryRo InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "RO"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryRu InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "RU"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountrySa InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "SA"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountrySe InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "SE"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountrySg InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "SG"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountrySi InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "SI"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountrySk InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "SK"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryTh InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "TH"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryTr InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "TR"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryTw InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "TW"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryUa InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "UA"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryUs InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "US"
	InvoiceFetchUpcomingResponseCustomerTaxIDCountryZa InvoiceFetchUpcomingResponseCustomerTaxIDCountry = "ZA"
)

func (InvoiceFetchUpcomingResponseCustomerTaxIDCountry) IsKnown added in v0.24.0

type InvoiceFetchUpcomingResponseCustomerTaxIDType added in v0.2.0

type InvoiceFetchUpcomingResponseCustomerTaxIDType string
const (
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeAdNrt    InvoiceFetchUpcomingResponseCustomerTaxIDType = "ad_nrt"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeAeTrn    InvoiceFetchUpcomingResponseCustomerTaxIDType = "ae_trn"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeEuVat    InvoiceFetchUpcomingResponseCustomerTaxIDType = "eu_vat"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeAuAbn    InvoiceFetchUpcomingResponseCustomerTaxIDType = "au_abn"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeAuArn    InvoiceFetchUpcomingResponseCustomerTaxIDType = "au_arn"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeBgUic    InvoiceFetchUpcomingResponseCustomerTaxIDType = "bg_uic"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeBrCnpj   InvoiceFetchUpcomingResponseCustomerTaxIDType = "br_cnpj"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeBrCpf    InvoiceFetchUpcomingResponseCustomerTaxIDType = "br_cpf"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeCaBn     InvoiceFetchUpcomingResponseCustomerTaxIDType = "ca_bn"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeCaGstHst InvoiceFetchUpcomingResponseCustomerTaxIDType = "ca_gst_hst"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeCaPstBc  InvoiceFetchUpcomingResponseCustomerTaxIDType = "ca_pst_bc"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeCaPstMB  InvoiceFetchUpcomingResponseCustomerTaxIDType = "ca_pst_mb"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeCaPstSk  InvoiceFetchUpcomingResponseCustomerTaxIDType = "ca_pst_sk"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeCaQst    InvoiceFetchUpcomingResponseCustomerTaxIDType = "ca_qst"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeChVat    InvoiceFetchUpcomingResponseCustomerTaxIDType = "ch_vat"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeClTin    InvoiceFetchUpcomingResponseCustomerTaxIDType = "cl_tin"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeEgTin    InvoiceFetchUpcomingResponseCustomerTaxIDType = "eg_tin"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeEsCif    InvoiceFetchUpcomingResponseCustomerTaxIDType = "es_cif"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeEuOssVat InvoiceFetchUpcomingResponseCustomerTaxIDType = "eu_oss_vat"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeGBVat    InvoiceFetchUpcomingResponseCustomerTaxIDType = "gb_vat"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeGeVat    InvoiceFetchUpcomingResponseCustomerTaxIDType = "ge_vat"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeHkBr     InvoiceFetchUpcomingResponseCustomerTaxIDType = "hk_br"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeHuTin    InvoiceFetchUpcomingResponseCustomerTaxIDType = "hu_tin"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeIDNpwp   InvoiceFetchUpcomingResponseCustomerTaxIDType = "id_npwp"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeIlVat    InvoiceFetchUpcomingResponseCustomerTaxIDType = "il_vat"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeInGst    InvoiceFetchUpcomingResponseCustomerTaxIDType = "in_gst"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeIsVat    InvoiceFetchUpcomingResponseCustomerTaxIDType = "is_vat"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeJpCn     InvoiceFetchUpcomingResponseCustomerTaxIDType = "jp_cn"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeJpRn     InvoiceFetchUpcomingResponseCustomerTaxIDType = "jp_rn"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeJpTrn    InvoiceFetchUpcomingResponseCustomerTaxIDType = "jp_trn"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeKePin    InvoiceFetchUpcomingResponseCustomerTaxIDType = "ke_pin"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeKrBrn    InvoiceFetchUpcomingResponseCustomerTaxIDType = "kr_brn"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeLiUid    InvoiceFetchUpcomingResponseCustomerTaxIDType = "li_uid"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeMxRfc    InvoiceFetchUpcomingResponseCustomerTaxIDType = "mx_rfc"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeMyFrp    InvoiceFetchUpcomingResponseCustomerTaxIDType = "my_frp"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeMyItn    InvoiceFetchUpcomingResponseCustomerTaxIDType = "my_itn"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeMySst    InvoiceFetchUpcomingResponseCustomerTaxIDType = "my_sst"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeNoVat    InvoiceFetchUpcomingResponseCustomerTaxIDType = "no_vat"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeNzGst    InvoiceFetchUpcomingResponseCustomerTaxIDType = "nz_gst"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypePhTin    InvoiceFetchUpcomingResponseCustomerTaxIDType = "ph_tin"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeRuInn    InvoiceFetchUpcomingResponseCustomerTaxIDType = "ru_inn"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeRuKpp    InvoiceFetchUpcomingResponseCustomerTaxIDType = "ru_kpp"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeSaVat    InvoiceFetchUpcomingResponseCustomerTaxIDType = "sa_vat"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeSgGst    InvoiceFetchUpcomingResponseCustomerTaxIDType = "sg_gst"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeSgUen    InvoiceFetchUpcomingResponseCustomerTaxIDType = "sg_uen"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeSiTin    InvoiceFetchUpcomingResponseCustomerTaxIDType = "si_tin"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeThVat    InvoiceFetchUpcomingResponseCustomerTaxIDType = "th_vat"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeTrTin    InvoiceFetchUpcomingResponseCustomerTaxIDType = "tr_tin"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeTwVat    InvoiceFetchUpcomingResponseCustomerTaxIDType = "tw_vat"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeUaVat    InvoiceFetchUpcomingResponseCustomerTaxIDType = "ua_vat"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeUsEin    InvoiceFetchUpcomingResponseCustomerTaxIDType = "us_ein"
	InvoiceFetchUpcomingResponseCustomerTaxIDTypeZaVat    InvoiceFetchUpcomingResponseCustomerTaxIDType = "za_vat"
)

func (InvoiceFetchUpcomingResponseCustomerTaxIDType) IsKnown added in v0.24.0

type InvoiceFetchUpcomingResponseLineItem

type InvoiceFetchUpcomingResponseLineItem struct {
	// A unique ID for this line item.
	ID string `json:"id,required"`
	// The final amount after any discounts or minimums.
	Amount   string          `json:"amount,required"`
	Discount shared.Discount `json:"discount,required,nullable"`
	// The end date of the range of time applied for this line item's price.
	EndDate time.Time `json:"end_date,required" format:"date-time"`
	// [DEPRECATED] For configured prices that are split by a grouping key, this will
	// be populated with the key and a value. The `amount` and `subtotal` will be the
	// values for this particular grouping.
	Grouping      string                                       `json:"grouping,required,nullable"`
	Maximum       InvoiceFetchUpcomingResponseLineItemsMaximum `json:"maximum,required,nullable"`
	MaximumAmount string                                       `json:"maximum_amount,required,nullable"`
	Minimum       InvoiceFetchUpcomingResponseLineItemsMinimum `json:"minimum,required,nullable"`
	MinimumAmount string                                       `json:"minimum_amount,required,nullable"`
	// The name of the price associated with this line item.
	Name string `json:"name,required"`
	// The Price resource represents a price that can be billed on a subscription,
	// resulting in a charge on an invoice in the form of an invoice line item. Prices
	// take a quantity and determine an amount to bill.
	//
	// Orb supports a few different pricing models out of the box. Each of these models
	// is serialized differently in a given Price object. The model_type field
	// determines the key for the configuration object that is present.
	//
	// ## Unit pricing
	//
	// With unit pricing, each unit costs a fixed amount.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "unit",
	//	    "unit_config": {
	//	        "unit_amount": "0.50"
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Tiered pricing
	//
	// In tiered pricing, the cost of a given unit depends on the tier range that it
	// falls into, where each tier range is defined by an upper and lower bound. For
	// example, the first ten units may cost $0.50 each and all units thereafter may
	// cost $0.10 each.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "tiered",
	//	    "tiered_config": {
	//	        "tiers": [
	//	            {
	//	                "first_unit": 1,
	//	                "last_unit": 10,
	//	                "unit_amount": "0.50"
	//	            },
	//	            {
	//	                "first_unit": 11,
	//	                "last_unit": null,
	//	                "unit_amount": "0.10"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//
	// “`
	//
	// ## Bulk pricing
	//
	// Bulk pricing applies when the number of units determine the cost of all units.
	// For example, if you've bought less than 10 units, they may each be $0.50 for a
	// total of $5.00. Once you've bought more than 10 units, all units may now be
	// priced at $0.40 (i.e. 101 units total would be $40.40).
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "bulk",
	//	    "bulk_config": {
	//	        "tiers": [
	//	            {
	//	                "maximum_units": 10,
	//	                "unit_amount": "0.50"
	//	            },
	//	            {
	//	                "maximum_units": 1000,
	//	                "unit_amount": "0.40"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Package pricing
	//
	// Package pricing defines the size or granularity of a unit for billing purposes.
	// For example, if the package size is set to 5, then 4 units will be billed as 5
	// and 6 units will be billed at 10.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "package",
	//	    "package_config": {
	//	        "package_amount": "0.80",
	//	        "package_size": 10
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## BPS pricing
	//
	// BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
	// percent (the number of basis points to charge), as well as a cap per event to
	// assess. For example, this would allow you to assess a fee of 0.25% on every
	// payment you process, with a maximum charge of $25 per payment.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "bps",
	//	    "bps_config": {
	//	       "bps": 125,
	//	       "per_unit_maximum": "11.00"
	//	    }
	//	    ...
	//	 }
	//
	// “`
	//
	// ## Bulk BPS pricing
	//
	// Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
	// total quantity across all events. Similar to bulk pricing, the BPS parameters of
	// a given event depends on the tier range that the billing period falls into. Each
	// tier range is defined by an upper bound. For example, after $1.5M of payment
	// volume is reached, each individual payment may have a lower cap or a smaller
	// take-rate.
	//
	// “`json
	//
	//	    ...
	//	    "model_type": "bulk_bps",
	//	    "bulk_bps_config": {
	//	        "tiers": [
	//	           {
	//	                "maximum_amount": "1000000.00",
	//	                "bps": 125,
	//	                "per_unit_maximum": "19.00"
	//	           },
	//	          {
	//	                "maximum_amount": null,
	//	                "bps": 115,
	//	                "per_unit_maximum": "4.00"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Tiered BPS pricing
	//
	// Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
	// event's applicable parameter is a function of its marginal addition to the
	// period total. Similar to tiered pricing, the BPS parameters of a given event
	// depends on the tier range that it falls into, where each tier range is defined
	// by an upper and lower bound. For example, the first few payments may have a 0.8
	// BPS take-rate and all payments after a specific volume may incur a take-rate of
	// 0.5 BPS each.
	//
	// “`json
	//
	//	    ...
	//	    "model_type": "tiered_bps",
	//	    "tiered_bps_config": {
	//	        "tiers": [
	//	           {
	//	                "minimum_amount": "0",
	//	                "maximum_amount": "1000000.00",
	//	                "bps": 125,
	//	                "per_unit_maximum": "19.00"
	//	           },
	//	          {
	//	                "minimum_amount": "1000000.00",
	//	                "maximum_amount": null,
	//	                "bps": 115,
	//	                "per_unit_maximum": "4.00"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Matrix pricing
	//
	// Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
	// `dimensions` defines the two event property values evaluated in this pricing
	// model. In a one-dimensional matrix, the second value is `null`. Every
	// configuration has a list of `matrix_values` which give the unit prices for
	// specified property values. In a one-dimensional matrix, the matrix values will
	// have `dimension_values` where the second value of the pair is null. If an event
	// does not match any of the dimension values in the matrix, it will resort to the
	// `default_unit_amount`.
	//
	// “`json
	//
	//	{
	//	    "model_type": "matrix"
	//	    "matrix_config": {
	//	        "default_unit_amount": "3.00",
	//	        "dimensions": [
	//	            "cluster_name",
	//	            "region"
	//	        ],
	//	        "matrix_values": [
	//	            {
	//	                "dimension_values": [
	//	                    "alpha",
	//	                    "west"
	//	                ],
	//	                "unit_amount": "2.00"
	//	            },
	//	            ...
	//	        ]
	//	    }
	//	}
	//
	// “`
	//
	// ## Fixed fees
	//
	// Fixed fees are prices that are applied independent of usage quantities, and
	// follow unit pricing. They also have an additional parameter
	// `fixed_price_quantity`. If the Price represents a fixed cost, this represents
	// the quantity of units applied.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "id": "price_id",
	//	    "model_type": "unit",
	//	    "unit_config": {
	//	       "unit_amount": "2.00"
	//	    },
	//	    "fixed_price_quantity": 3.0
	//	    ...
	//	}
	//
	// “`
	Price    Price   `json:"price,required,nullable"`
	Quantity float64 `json:"quantity,required"`
	// The start date of the range of time applied for this line item's price.
	StartDate time.Time `json:"start_date,required" format:"date-time"`
	// For complex pricing structures, the line item can be broken down further in
	// `sub_line_items`.
	SubLineItems []InvoiceFetchUpcomingResponseLineItemsSubLineItem `json:"sub_line_items,required"`
	// The line amount before any line item-specific discounts or minimums.
	Subtotal string `json:"subtotal,required"`
	// An array of tax rates and their incurred tax amounts. Empty if no tax
	// integration is configured.
	TaxAmounts []InvoiceFetchUpcomingResponseLineItemsTaxAmount `json:"tax_amounts,required"`
	JSON       invoiceFetchUpcomingResponseLineItemJSON         `json:"-"`
}

func (*InvoiceFetchUpcomingResponseLineItem) UnmarshalJSON

func (r *InvoiceFetchUpcomingResponseLineItem) UnmarshalJSON(data []byte) (err error)

type InvoiceFetchUpcomingResponseLineItemsMaximum

type InvoiceFetchUpcomingResponseLineItemsMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                                           `json:"maximum_amount,required"`
	JSON          invoiceFetchUpcomingResponseLineItemsMaximumJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseLineItemsMaximum) UnmarshalJSON

func (r *InvoiceFetchUpcomingResponseLineItemsMaximum) UnmarshalJSON(data []byte) (err error)

type InvoiceFetchUpcomingResponseLineItemsMinimum

type InvoiceFetchUpcomingResponseLineItemsMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                                           `json:"minimum_amount,required"`
	JSON          invoiceFetchUpcomingResponseLineItemsMinimumJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseLineItemsMinimum) UnmarshalJSON

func (r *InvoiceFetchUpcomingResponseLineItemsMinimum) UnmarshalJSON(data []byte) (err error)

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItem

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItem struct {
	// The total amount for this sub line item.
	Amount       string                                                                         `json:"amount,required"`
	Grouping     InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemGrouping     `json:"grouping,required,nullable"`
	MatrixConfig InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemMatrixConfig `json:"matrix_config,required"`
	Name         string                                                                         `json:"name,required"`
	Quantity     float64                                                                        `json:"quantity,required"`
	Type         InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemType         `json:"type,required"`
	JSON         invoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemJSON         `json:"-"`
}

func (*InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItem) UnmarshalJSON

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemGrouping

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemGrouping struct {
	Key string `json:"key,required"`
	// No value indicates the default group
	Value string                                                                         `json:"value,required,nullable"`
	JSON  invoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemGroupingJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemGrouping) UnmarshalJSON

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemMatrixConfig

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemMatrixConfig struct {
	// The ordered dimension values for this line item.
	DimensionValues []string                                                                           `json:"dimension_values,required"`
	JSON            invoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemMatrixConfigJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemMatrixConfig) UnmarshalJSON

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemType

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemType string
const (
	InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemTypeMatrix InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemType = "matrix"
)

func (InvoiceFetchUpcomingResponseLineItemsSubLineItemsMatrixSubLineItemType) IsKnown added in v0.24.0

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsOtherSubLineItem

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsOtherSubLineItem struct {
	// The total amount for this sub line item.
	Amount   string                                                                    `json:"amount,required"`
	Grouping InvoiceFetchUpcomingResponseLineItemsSubLineItemsOtherSubLineItemGrouping `json:"grouping,required,nullable"`
	Name     string                                                                    `json:"name,required"`
	Quantity float64                                                                   `json:"quantity,required"`
	Type     InvoiceFetchUpcomingResponseLineItemsSubLineItemsOtherSubLineItemType     `json:"type,required"`
	JSON     invoiceFetchUpcomingResponseLineItemsSubLineItemsOtherSubLineItemJSON     `json:"-"`
}

func (*InvoiceFetchUpcomingResponseLineItemsSubLineItemsOtherSubLineItem) UnmarshalJSON

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsOtherSubLineItemGrouping

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsOtherSubLineItemGrouping struct {
	Key string `json:"key,required"`
	// No value indicates the default group
	Value string                                                                        `json:"value,required,nullable"`
	JSON  invoiceFetchUpcomingResponseLineItemsSubLineItemsOtherSubLineItemGroupingJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseLineItemsSubLineItemsOtherSubLineItemGrouping) UnmarshalJSON

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsOtherSubLineItemType

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsOtherSubLineItemType string
const (
	InvoiceFetchUpcomingResponseLineItemsSubLineItemsOtherSubLineItemTypeNull InvoiceFetchUpcomingResponseLineItemsSubLineItemsOtherSubLineItemType = "'null'"
)

func (InvoiceFetchUpcomingResponseLineItemsSubLineItemsOtherSubLineItemType) IsKnown added in v0.24.0

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItem

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItem struct {
	// The total amount for this sub line item.
	Amount     string                                                                     `json:"amount,required"`
	Grouping   InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemGrouping   `json:"grouping,required,nullable"`
	Name       string                                                                     `json:"name,required"`
	Quantity   float64                                                                    `json:"quantity,required"`
	TierConfig InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemTierConfig `json:"tier_config,required"`
	Type       InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemType       `json:"type,required"`
	JSON       invoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemJSON       `json:"-"`
}

func (*InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItem) UnmarshalJSON

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemGrouping

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemGrouping struct {
	Key string `json:"key,required"`
	// No value indicates the default group
	Value string                                                                       `json:"value,required,nullable"`
	JSON  invoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemGroupingJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemGrouping) UnmarshalJSON

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemTierConfig

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemTierConfig struct {
	FirstUnit  float64                                                                        `json:"first_unit,required"`
	LastUnit   float64                                                                        `json:"last_unit,required,nullable"`
	UnitAmount string                                                                         `json:"unit_amount,required"`
	JSON       invoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemTierConfigJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemTierConfig) UnmarshalJSON

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemType

type InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemType string
const (
	InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemTypeTier InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemType = "tier"
)

func (InvoiceFetchUpcomingResponseLineItemsSubLineItemsTierSubLineItemType) IsKnown added in v0.24.0

type InvoiceFetchUpcomingResponseLineItemsTaxAmount

type InvoiceFetchUpcomingResponseLineItemsTaxAmount struct {
	// The amount of additional tax incurred by this tax rate.
	Amount string `json:"amount,required"`
	// The human-readable description of the applied tax rate.
	TaxRateDescription string `json:"tax_rate_description,required"`
	// The tax rate percentage, out of 100.
	TaxRatePercentage string                                             `json:"tax_rate_percentage,required,nullable"`
	JSON              invoiceFetchUpcomingResponseLineItemsTaxAmountJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseLineItemsTaxAmount) UnmarshalJSON

func (r *InvoiceFetchUpcomingResponseLineItemsTaxAmount) UnmarshalJSON(data []byte) (err error)

type InvoiceFetchUpcomingResponseMaximum

type InvoiceFetchUpcomingResponseMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                                  `json:"maximum_amount,required"`
	JSON          invoiceFetchUpcomingResponseMaximumJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseMaximum) UnmarshalJSON

func (r *InvoiceFetchUpcomingResponseMaximum) UnmarshalJSON(data []byte) (err error)

type InvoiceFetchUpcomingResponseMinimum

type InvoiceFetchUpcomingResponseMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                                  `json:"minimum_amount,required"`
	JSON          invoiceFetchUpcomingResponseMinimumJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseMinimum) UnmarshalJSON

func (r *InvoiceFetchUpcomingResponseMinimum) UnmarshalJSON(data []byte) (err error)

type InvoiceFetchUpcomingResponseShippingAddress

type InvoiceFetchUpcomingResponseShippingAddress struct {
	City       string                                          `json:"city,required,nullable"`
	Country    string                                          `json:"country,required,nullable"`
	Line1      string                                          `json:"line1,required,nullable"`
	Line2      string                                          `json:"line2,required,nullable"`
	PostalCode string                                          `json:"postal_code,required,nullable"`
	State      string                                          `json:"state,required,nullable"`
	JSON       invoiceFetchUpcomingResponseShippingAddressJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseShippingAddress) UnmarshalJSON

func (r *InvoiceFetchUpcomingResponseShippingAddress) UnmarshalJSON(data []byte) (err error)

type InvoiceFetchUpcomingResponseStatus

type InvoiceFetchUpcomingResponseStatus string
const (
	InvoiceFetchUpcomingResponseStatusIssued InvoiceFetchUpcomingResponseStatus = "issued"
	InvoiceFetchUpcomingResponseStatusPaid   InvoiceFetchUpcomingResponseStatus = "paid"
	InvoiceFetchUpcomingResponseStatusSynced InvoiceFetchUpcomingResponseStatus = "synced"
	InvoiceFetchUpcomingResponseStatusVoid   InvoiceFetchUpcomingResponseStatus = "void"
	InvoiceFetchUpcomingResponseStatusDraft  InvoiceFetchUpcomingResponseStatus = "draft"
)

func (InvoiceFetchUpcomingResponseStatus) IsKnown added in v0.24.0

type InvoiceFetchUpcomingResponseSubscription

type InvoiceFetchUpcomingResponseSubscription struct {
	ID   string                                       `json:"id,required"`
	JSON invoiceFetchUpcomingResponseSubscriptionJSON `json:"-"`
}

func (*InvoiceFetchUpcomingResponseSubscription) UnmarshalJSON

func (r *InvoiceFetchUpcomingResponseSubscription) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItem

type InvoiceLineItem struct {
	// A unique ID for this line item.
	ID string `json:"id,required"`
	// The final amount after any discounts or minimums.
	Amount   string          `json:"amount,required"`
	Discount shared.Discount `json:"discount,required,nullable"`
	// The end date of the range of time applied for this line item's price.
	EndDate time.Time `json:"end_date,required" format:"date-time"`
	// [DEPRECATED] For configured prices that are split by a grouping key, this will
	// be populated with the key and a value. The `amount` and `subtotal` will be the
	// values for this particular grouping.
	Grouping      string                  `json:"grouping,required,nullable"`
	Maximum       InvoiceLineItemsMaximum `json:"maximum,required,nullable"`
	MaximumAmount string                  `json:"maximum_amount,required,nullable"`
	Minimum       InvoiceLineItemsMinimum `json:"minimum,required,nullable"`
	MinimumAmount string                  `json:"minimum_amount,required,nullable"`
	// The name of the price associated with this line item.
	Name string `json:"name,required"`
	// The Price resource represents a price that can be billed on a subscription,
	// resulting in a charge on an invoice in the form of an invoice line item. Prices
	// take a quantity and determine an amount to bill.
	//
	// Orb supports a few different pricing models out of the box. Each of these models
	// is serialized differently in a given Price object. The model_type field
	// determines the key for the configuration object that is present.
	//
	// ## Unit pricing
	//
	// With unit pricing, each unit costs a fixed amount.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "unit",
	//	    "unit_config": {
	//	        "unit_amount": "0.50"
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Tiered pricing
	//
	// In tiered pricing, the cost of a given unit depends on the tier range that it
	// falls into, where each tier range is defined by an upper and lower bound. For
	// example, the first ten units may cost $0.50 each and all units thereafter may
	// cost $0.10 each.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "tiered",
	//	    "tiered_config": {
	//	        "tiers": [
	//	            {
	//	                "first_unit": 1,
	//	                "last_unit": 10,
	//	                "unit_amount": "0.50"
	//	            },
	//	            {
	//	                "first_unit": 11,
	//	                "last_unit": null,
	//	                "unit_amount": "0.10"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//
	// “`
	//
	// ## Bulk pricing
	//
	// Bulk pricing applies when the number of units determine the cost of all units.
	// For example, if you've bought less than 10 units, they may each be $0.50 for a
	// total of $5.00. Once you've bought more than 10 units, all units may now be
	// priced at $0.40 (i.e. 101 units total would be $40.40).
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "bulk",
	//	    "bulk_config": {
	//	        "tiers": [
	//	            {
	//	                "maximum_units": 10,
	//	                "unit_amount": "0.50"
	//	            },
	//	            {
	//	                "maximum_units": 1000,
	//	                "unit_amount": "0.40"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Package pricing
	//
	// Package pricing defines the size or granularity of a unit for billing purposes.
	// For example, if the package size is set to 5, then 4 units will be billed as 5
	// and 6 units will be billed at 10.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "package",
	//	    "package_config": {
	//	        "package_amount": "0.80",
	//	        "package_size": 10
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## BPS pricing
	//
	// BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
	// percent (the number of basis points to charge), as well as a cap per event to
	// assess. For example, this would allow you to assess a fee of 0.25% on every
	// payment you process, with a maximum charge of $25 per payment.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "bps",
	//	    "bps_config": {
	//	       "bps": 125,
	//	       "per_unit_maximum": "11.00"
	//	    }
	//	    ...
	//	 }
	//
	// “`
	//
	// ## Bulk BPS pricing
	//
	// Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
	// total quantity across all events. Similar to bulk pricing, the BPS parameters of
	// a given event depends on the tier range that the billing period falls into. Each
	// tier range is defined by an upper bound. For example, after $1.5M of payment
	// volume is reached, each individual payment may have a lower cap or a smaller
	// take-rate.
	//
	// “`json
	//
	//	    ...
	//	    "model_type": "bulk_bps",
	//	    "bulk_bps_config": {
	//	        "tiers": [
	//	           {
	//	                "maximum_amount": "1000000.00",
	//	                "bps": 125,
	//	                "per_unit_maximum": "19.00"
	//	           },
	//	          {
	//	                "maximum_amount": null,
	//	                "bps": 115,
	//	                "per_unit_maximum": "4.00"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Tiered BPS pricing
	//
	// Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
	// event's applicable parameter is a function of its marginal addition to the
	// period total. Similar to tiered pricing, the BPS parameters of a given event
	// depends on the tier range that it falls into, where each tier range is defined
	// by an upper and lower bound. For example, the first few payments may have a 0.8
	// BPS take-rate and all payments after a specific volume may incur a take-rate of
	// 0.5 BPS each.
	//
	// “`json
	//
	//	    ...
	//	    "model_type": "tiered_bps",
	//	    "tiered_bps_config": {
	//	        "tiers": [
	//	           {
	//	                "minimum_amount": "0",
	//	                "maximum_amount": "1000000.00",
	//	                "bps": 125,
	//	                "per_unit_maximum": "19.00"
	//	           },
	//	          {
	//	                "minimum_amount": "1000000.00",
	//	                "maximum_amount": null,
	//	                "bps": 115,
	//	                "per_unit_maximum": "4.00"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Matrix pricing
	//
	// Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
	// `dimensions` defines the two event property values evaluated in this pricing
	// model. In a one-dimensional matrix, the second value is `null`. Every
	// configuration has a list of `matrix_values` which give the unit prices for
	// specified property values. In a one-dimensional matrix, the matrix values will
	// have `dimension_values` where the second value of the pair is null. If an event
	// does not match any of the dimension values in the matrix, it will resort to the
	// `default_unit_amount`.
	//
	// “`json
	//
	//	{
	//	    "model_type": "matrix"
	//	    "matrix_config": {
	//	        "default_unit_amount": "3.00",
	//	        "dimensions": [
	//	            "cluster_name",
	//	            "region"
	//	        ],
	//	        "matrix_values": [
	//	            {
	//	                "dimension_values": [
	//	                    "alpha",
	//	                    "west"
	//	                ],
	//	                "unit_amount": "2.00"
	//	            },
	//	            ...
	//	        ]
	//	    }
	//	}
	//
	// “`
	//
	// ## Fixed fees
	//
	// Fixed fees are prices that are applied independent of usage quantities, and
	// follow unit pricing. They also have an additional parameter
	// `fixed_price_quantity`. If the Price represents a fixed cost, this represents
	// the quantity of units applied.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "id": "price_id",
	//	    "model_type": "unit",
	//	    "unit_config": {
	//	       "unit_amount": "2.00"
	//	    },
	//	    "fixed_price_quantity": 3.0
	//	    ...
	//	}
	//
	// “`
	Price    Price   `json:"price,required,nullable"`
	Quantity float64 `json:"quantity,required"`
	// The start date of the range of time applied for this line item's price.
	StartDate time.Time `json:"start_date,required" format:"date-time"`
	// For complex pricing structures, the line item can be broken down further in
	// `sub_line_items`.
	SubLineItems []InvoiceLineItemsSubLineItem `json:"sub_line_items,required"`
	// The line amount before any line item-specific discounts or minimums.
	Subtotal string `json:"subtotal,required"`
	// An array of tax rates and their incurred tax amounts. Empty if no tax
	// integration is configured.
	TaxAmounts []InvoiceLineItemsTaxAmount `json:"tax_amounts,required"`
	JSON       invoiceLineItemJSON         `json:"-"`
}

func (*InvoiceLineItem) UnmarshalJSON

func (r *InvoiceLineItem) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItemNewParams

type InvoiceLineItemNewParams struct {
	// The total amount in the invoice's currency to add to the line item.
	Amount param.Field[string] `json:"amount,required"`
	// A date string to specify the line item's end date in the customer's timezone.
	EndDate param.Field[time.Time] `json:"end_date,required" format:"date"`
	// The id of the Invoice to add this line item.
	InvoiceID param.Field[string] `json:"invoice_id,required"`
	// The item name associated with this line item. If an item with the same name
	// exists in Orb, that item will be associated with the line item.
	Name param.Field[string] `json:"name,required"`
	// The number of units on the line item
	Quantity param.Field[float64] `json:"quantity,required"`
	// A date string to specify the line item's start date in the customer's timezone.
	StartDate param.Field[time.Time] `json:"start_date,required" format:"date"`
}

func (InvoiceLineItemNewParams) MarshalJSON

func (r InvoiceLineItemNewParams) MarshalJSON() (data []byte, err error)

type InvoiceLineItemNewResponse

type InvoiceLineItemNewResponse struct {
	// A unique ID for this line item.
	ID string `json:"id,required"`
	// The final amount after any discounts or minimums.
	Amount   string          `json:"amount,required"`
	Discount shared.Discount `json:"discount,required,nullable"`
	// The end date of the range of time applied for this line item's price.
	EndDate time.Time `json:"end_date,required" format:"date-time"`
	// [DEPRECATED] For configured prices that are split by a grouping key, this will
	// be populated with the key and a value. The `amount` and `subtotal` will be the
	// values for this particular grouping.
	Grouping      string                            `json:"grouping,required,nullable"`
	Maximum       InvoiceLineItemNewResponseMaximum `json:"maximum,required,nullable"`
	MaximumAmount string                            `json:"maximum_amount,required,nullable"`
	Minimum       InvoiceLineItemNewResponseMinimum `json:"minimum,required,nullable"`
	MinimumAmount string                            `json:"minimum_amount,required,nullable"`
	// The name of the price associated with this line item.
	Name string `json:"name,required"`
	// The Price resource represents a price that can be billed on a subscription,
	// resulting in a charge on an invoice in the form of an invoice line item. Prices
	// take a quantity and determine an amount to bill.
	//
	// Orb supports a few different pricing models out of the box. Each of these models
	// is serialized differently in a given Price object. The model_type field
	// determines the key for the configuration object that is present.
	//
	// ## Unit pricing
	//
	// With unit pricing, each unit costs a fixed amount.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "unit",
	//	    "unit_config": {
	//	        "unit_amount": "0.50"
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Tiered pricing
	//
	// In tiered pricing, the cost of a given unit depends on the tier range that it
	// falls into, where each tier range is defined by an upper and lower bound. For
	// example, the first ten units may cost $0.50 each and all units thereafter may
	// cost $0.10 each.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "tiered",
	//	    "tiered_config": {
	//	        "tiers": [
	//	            {
	//	                "first_unit": 1,
	//	                "last_unit": 10,
	//	                "unit_amount": "0.50"
	//	            },
	//	            {
	//	                "first_unit": 11,
	//	                "last_unit": null,
	//	                "unit_amount": "0.10"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//
	// “`
	//
	// ## Bulk pricing
	//
	// Bulk pricing applies when the number of units determine the cost of all units.
	// For example, if you've bought less than 10 units, they may each be $0.50 for a
	// total of $5.00. Once you've bought more than 10 units, all units may now be
	// priced at $0.40 (i.e. 101 units total would be $40.40).
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "bulk",
	//	    "bulk_config": {
	//	        "tiers": [
	//	            {
	//	                "maximum_units": 10,
	//	                "unit_amount": "0.50"
	//	            },
	//	            {
	//	                "maximum_units": 1000,
	//	                "unit_amount": "0.40"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Package pricing
	//
	// Package pricing defines the size or granularity of a unit for billing purposes.
	// For example, if the package size is set to 5, then 4 units will be billed as 5
	// and 6 units will be billed at 10.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "package",
	//	    "package_config": {
	//	        "package_amount": "0.80",
	//	        "package_size": 10
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## BPS pricing
	//
	// BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
	// percent (the number of basis points to charge), as well as a cap per event to
	// assess. For example, this would allow you to assess a fee of 0.25% on every
	// payment you process, with a maximum charge of $25 per payment.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "bps",
	//	    "bps_config": {
	//	       "bps": 125,
	//	       "per_unit_maximum": "11.00"
	//	    }
	//	    ...
	//	 }
	//
	// “`
	//
	// ## Bulk BPS pricing
	//
	// Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
	// total quantity across all events. Similar to bulk pricing, the BPS parameters of
	// a given event depends on the tier range that the billing period falls into. Each
	// tier range is defined by an upper bound. For example, after $1.5M of payment
	// volume is reached, each individual payment may have a lower cap or a smaller
	// take-rate.
	//
	// “`json
	//
	//	    ...
	//	    "model_type": "bulk_bps",
	//	    "bulk_bps_config": {
	//	        "tiers": [
	//	           {
	//	                "maximum_amount": "1000000.00",
	//	                "bps": 125,
	//	                "per_unit_maximum": "19.00"
	//	           },
	//	          {
	//	                "maximum_amount": null,
	//	                "bps": 115,
	//	                "per_unit_maximum": "4.00"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Tiered BPS pricing
	//
	// Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
	// event's applicable parameter is a function of its marginal addition to the
	// period total. Similar to tiered pricing, the BPS parameters of a given event
	// depends on the tier range that it falls into, where each tier range is defined
	// by an upper and lower bound. For example, the first few payments may have a 0.8
	// BPS take-rate and all payments after a specific volume may incur a take-rate of
	// 0.5 BPS each.
	//
	// “`json
	//
	//	    ...
	//	    "model_type": "tiered_bps",
	//	    "tiered_bps_config": {
	//	        "tiers": [
	//	           {
	//	                "minimum_amount": "0",
	//	                "maximum_amount": "1000000.00",
	//	                "bps": 125,
	//	                "per_unit_maximum": "19.00"
	//	           },
	//	          {
	//	                "minimum_amount": "1000000.00",
	//	                "maximum_amount": null,
	//	                "bps": 115,
	//	                "per_unit_maximum": "4.00"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Matrix pricing
	//
	// Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
	// `dimensions` defines the two event property values evaluated in this pricing
	// model. In a one-dimensional matrix, the second value is `null`. Every
	// configuration has a list of `matrix_values` which give the unit prices for
	// specified property values. In a one-dimensional matrix, the matrix values will
	// have `dimension_values` where the second value of the pair is null. If an event
	// does not match any of the dimension values in the matrix, it will resort to the
	// `default_unit_amount`.
	//
	// “`json
	//
	//	{
	//	    "model_type": "matrix"
	//	    "matrix_config": {
	//	        "default_unit_amount": "3.00",
	//	        "dimensions": [
	//	            "cluster_name",
	//	            "region"
	//	        ],
	//	        "matrix_values": [
	//	            {
	//	                "dimension_values": [
	//	                    "alpha",
	//	                    "west"
	//	                ],
	//	                "unit_amount": "2.00"
	//	            },
	//	            ...
	//	        ]
	//	    }
	//	}
	//
	// “`
	//
	// ## Fixed fees
	//
	// Fixed fees are prices that are applied independent of usage quantities, and
	// follow unit pricing. They also have an additional parameter
	// `fixed_price_quantity`. If the Price represents a fixed cost, this represents
	// the quantity of units applied.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "id": "price_id",
	//	    "model_type": "unit",
	//	    "unit_config": {
	//	       "unit_amount": "2.00"
	//	    },
	//	    "fixed_price_quantity": 3.0
	//	    ...
	//	}
	//
	// “`
	Price    Price   `json:"price,required,nullable"`
	Quantity float64 `json:"quantity,required"`
	// The start date of the range of time applied for this line item's price.
	StartDate time.Time `json:"start_date,required" format:"date-time"`
	// For complex pricing structures, the line item can be broken down further in
	// `sub_line_items`.
	SubLineItems []InvoiceLineItemNewResponseSubLineItem `json:"sub_line_items,required"`
	// The line amount before any line item-specific discounts or minimums.
	Subtotal string `json:"subtotal,required"`
	// An array of tax rates and their incurred tax amounts. Empty if no tax
	// integration is configured.
	TaxAmounts []InvoiceLineItemNewResponseTaxAmount `json:"tax_amounts,required"`
	JSON       invoiceLineItemNewResponseJSON        `json:"-"`
}

func (*InvoiceLineItemNewResponse) UnmarshalJSON

func (r *InvoiceLineItemNewResponse) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItemNewResponseMaximum

type InvoiceLineItemNewResponseMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                                `json:"maximum_amount,required"`
	JSON          invoiceLineItemNewResponseMaximumJSON `json:"-"`
}

func (*InvoiceLineItemNewResponseMaximum) UnmarshalJSON

func (r *InvoiceLineItemNewResponseMaximum) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItemNewResponseMinimum

type InvoiceLineItemNewResponseMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                                `json:"minimum_amount,required"`
	JSON          invoiceLineItemNewResponseMinimumJSON `json:"-"`
}

func (*InvoiceLineItemNewResponseMinimum) UnmarshalJSON

func (r *InvoiceLineItemNewResponseMinimum) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItemNewResponseSubLineItem

type InvoiceLineItemNewResponseSubLineItem interface {
	// contains filtered or unexported methods
}

Union satisfied by InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItem, InvoiceLineItemNewResponseSubLineItemsTierSubLineItem or InvoiceLineItemNewResponseSubLineItemsOtherSubLineItem.

type InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItem

type InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItem struct {
	// The total amount for this sub line item.
	Amount       string                                                              `json:"amount,required"`
	Grouping     InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItemGrouping     `json:"grouping,required,nullable"`
	MatrixConfig InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItemMatrixConfig `json:"matrix_config,required"`
	Name         string                                                              `json:"name,required"`
	Quantity     float64                                                             `json:"quantity,required"`
	Type         InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItemType         `json:"type,required"`
	JSON         invoiceLineItemNewResponseSubLineItemsMatrixSubLineItemJSON         `json:"-"`
}

func (*InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItem) UnmarshalJSON

type InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItemGrouping

type InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItemGrouping struct {
	Key string `json:"key,required"`
	// No value indicates the default group
	Value string                                                              `json:"value,required,nullable"`
	JSON  invoiceLineItemNewResponseSubLineItemsMatrixSubLineItemGroupingJSON `json:"-"`
}

func (*InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItemGrouping) UnmarshalJSON

type InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItemMatrixConfig

type InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItemMatrixConfig struct {
	// The ordered dimension values for this line item.
	DimensionValues []string                                                                `json:"dimension_values,required"`
	JSON            invoiceLineItemNewResponseSubLineItemsMatrixSubLineItemMatrixConfigJSON `json:"-"`
}

func (*InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItemMatrixConfig) UnmarshalJSON

type InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItemType

type InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItemType string
const (
	InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItemTypeMatrix InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItemType = "matrix"
)

func (InvoiceLineItemNewResponseSubLineItemsMatrixSubLineItemType) IsKnown added in v0.24.0

type InvoiceLineItemNewResponseSubLineItemsOtherSubLineItem

type InvoiceLineItemNewResponseSubLineItemsOtherSubLineItem struct {
	// The total amount for this sub line item.
	Amount   string                                                         `json:"amount,required"`
	Grouping InvoiceLineItemNewResponseSubLineItemsOtherSubLineItemGrouping `json:"grouping,required,nullable"`
	Name     string                                                         `json:"name,required"`
	Quantity float64                                                        `json:"quantity,required"`
	Type     InvoiceLineItemNewResponseSubLineItemsOtherSubLineItemType     `json:"type,required"`
	JSON     invoiceLineItemNewResponseSubLineItemsOtherSubLineItemJSON     `json:"-"`
}

func (*InvoiceLineItemNewResponseSubLineItemsOtherSubLineItem) UnmarshalJSON

func (r *InvoiceLineItemNewResponseSubLineItemsOtherSubLineItem) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItemNewResponseSubLineItemsOtherSubLineItemGrouping

type InvoiceLineItemNewResponseSubLineItemsOtherSubLineItemGrouping struct {
	Key string `json:"key,required"`
	// No value indicates the default group
	Value string                                                             `json:"value,required,nullable"`
	JSON  invoiceLineItemNewResponseSubLineItemsOtherSubLineItemGroupingJSON `json:"-"`
}

func (*InvoiceLineItemNewResponseSubLineItemsOtherSubLineItemGrouping) UnmarshalJSON

type InvoiceLineItemNewResponseSubLineItemsOtherSubLineItemType

type InvoiceLineItemNewResponseSubLineItemsOtherSubLineItemType string
const (
	InvoiceLineItemNewResponseSubLineItemsOtherSubLineItemTypeNull InvoiceLineItemNewResponseSubLineItemsOtherSubLineItemType = "'null'"
)

func (InvoiceLineItemNewResponseSubLineItemsOtherSubLineItemType) IsKnown added in v0.24.0

type InvoiceLineItemNewResponseSubLineItemsTierSubLineItem

type InvoiceLineItemNewResponseSubLineItemsTierSubLineItem struct {
	// The total amount for this sub line item.
	Amount     string                                                          `json:"amount,required"`
	Grouping   InvoiceLineItemNewResponseSubLineItemsTierSubLineItemGrouping   `json:"grouping,required,nullable"`
	Name       string                                                          `json:"name,required"`
	Quantity   float64                                                         `json:"quantity,required"`
	TierConfig InvoiceLineItemNewResponseSubLineItemsTierSubLineItemTierConfig `json:"tier_config,required"`
	Type       InvoiceLineItemNewResponseSubLineItemsTierSubLineItemType       `json:"type,required"`
	JSON       invoiceLineItemNewResponseSubLineItemsTierSubLineItemJSON       `json:"-"`
}

func (*InvoiceLineItemNewResponseSubLineItemsTierSubLineItem) UnmarshalJSON

func (r *InvoiceLineItemNewResponseSubLineItemsTierSubLineItem) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItemNewResponseSubLineItemsTierSubLineItemGrouping

type InvoiceLineItemNewResponseSubLineItemsTierSubLineItemGrouping struct {
	Key string `json:"key,required"`
	// No value indicates the default group
	Value string                                                            `json:"value,required,nullable"`
	JSON  invoiceLineItemNewResponseSubLineItemsTierSubLineItemGroupingJSON `json:"-"`
}

func (*InvoiceLineItemNewResponseSubLineItemsTierSubLineItemGrouping) UnmarshalJSON

type InvoiceLineItemNewResponseSubLineItemsTierSubLineItemTierConfig

type InvoiceLineItemNewResponseSubLineItemsTierSubLineItemTierConfig struct {
	FirstUnit  float64                                                             `json:"first_unit,required"`
	LastUnit   float64                                                             `json:"last_unit,required,nullable"`
	UnitAmount string                                                              `json:"unit_amount,required"`
	JSON       invoiceLineItemNewResponseSubLineItemsTierSubLineItemTierConfigJSON `json:"-"`
}

func (*InvoiceLineItemNewResponseSubLineItemsTierSubLineItemTierConfig) UnmarshalJSON

type InvoiceLineItemNewResponseSubLineItemsTierSubLineItemType

type InvoiceLineItemNewResponseSubLineItemsTierSubLineItemType string
const (
	InvoiceLineItemNewResponseSubLineItemsTierSubLineItemTypeTier InvoiceLineItemNewResponseSubLineItemsTierSubLineItemType = "tier"
)

func (InvoiceLineItemNewResponseSubLineItemsTierSubLineItemType) IsKnown added in v0.24.0

type InvoiceLineItemNewResponseTaxAmount

type InvoiceLineItemNewResponseTaxAmount struct {
	// The amount of additional tax incurred by this tax rate.
	Amount string `json:"amount,required"`
	// The human-readable description of the applied tax rate.
	TaxRateDescription string `json:"tax_rate_description,required"`
	// The tax rate percentage, out of 100.
	TaxRatePercentage string                                  `json:"tax_rate_percentage,required,nullable"`
	JSON              invoiceLineItemNewResponseTaxAmountJSON `json:"-"`
}

func (*InvoiceLineItemNewResponseTaxAmount) UnmarshalJSON

func (r *InvoiceLineItemNewResponseTaxAmount) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItemService

type InvoiceLineItemService struct {
	Options []option.RequestOption
}

InvoiceLineItemService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewInvoiceLineItemService method instead.

func NewInvoiceLineItemService

func NewInvoiceLineItemService(opts ...option.RequestOption) (r *InvoiceLineItemService)

NewInvoiceLineItemService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*InvoiceLineItemService) New

This creates a one-off fixed fee invoice line item on an Invoice. This can only be done for invoices that are in a `draft` status.

type InvoiceLineItemsMaximum

type InvoiceLineItemsMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                      `json:"maximum_amount,required"`
	JSON          invoiceLineItemsMaximumJSON `json:"-"`
}

func (*InvoiceLineItemsMaximum) UnmarshalJSON

func (r *InvoiceLineItemsMaximum) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItemsMinimum

type InvoiceLineItemsMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                      `json:"minimum_amount,required"`
	JSON          invoiceLineItemsMinimumJSON `json:"-"`
}

func (*InvoiceLineItemsMinimum) UnmarshalJSON

func (r *InvoiceLineItemsMinimum) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItemsSubLineItem

type InvoiceLineItemsSubLineItem interface {
	// contains filtered or unexported methods
}

Union satisfied by InvoiceLineItemsSubLineItemsMatrixSubLineItem, InvoiceLineItemsSubLineItemsTierSubLineItem or InvoiceLineItemsSubLineItemsOtherSubLineItem.

type InvoiceLineItemsSubLineItemsMatrixSubLineItem

type InvoiceLineItemsSubLineItemsMatrixSubLineItem struct {
	// The total amount for this sub line item.
	Amount       string                                                    `json:"amount,required"`
	Grouping     InvoiceLineItemsSubLineItemsMatrixSubLineItemGrouping     `json:"grouping,required,nullable"`
	MatrixConfig InvoiceLineItemsSubLineItemsMatrixSubLineItemMatrixConfig `json:"matrix_config,required"`
	Name         string                                                    `json:"name,required"`
	Quantity     float64                                                   `json:"quantity,required"`
	Type         InvoiceLineItemsSubLineItemsMatrixSubLineItemType         `json:"type,required"`
	JSON         invoiceLineItemsSubLineItemsMatrixSubLineItemJSON         `json:"-"`
}

func (*InvoiceLineItemsSubLineItemsMatrixSubLineItem) UnmarshalJSON

func (r *InvoiceLineItemsSubLineItemsMatrixSubLineItem) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItemsSubLineItemsMatrixSubLineItemGrouping

type InvoiceLineItemsSubLineItemsMatrixSubLineItemGrouping struct {
	Key string `json:"key,required"`
	// No value indicates the default group
	Value string                                                    `json:"value,required,nullable"`
	JSON  invoiceLineItemsSubLineItemsMatrixSubLineItemGroupingJSON `json:"-"`
}

func (*InvoiceLineItemsSubLineItemsMatrixSubLineItemGrouping) UnmarshalJSON

func (r *InvoiceLineItemsSubLineItemsMatrixSubLineItemGrouping) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItemsSubLineItemsMatrixSubLineItemMatrixConfig

type InvoiceLineItemsSubLineItemsMatrixSubLineItemMatrixConfig struct {
	// The ordered dimension values for this line item.
	DimensionValues []string                                                      `json:"dimension_values,required"`
	JSON            invoiceLineItemsSubLineItemsMatrixSubLineItemMatrixConfigJSON `json:"-"`
}

func (*InvoiceLineItemsSubLineItemsMatrixSubLineItemMatrixConfig) UnmarshalJSON

type InvoiceLineItemsSubLineItemsMatrixSubLineItemType

type InvoiceLineItemsSubLineItemsMatrixSubLineItemType string
const (
	InvoiceLineItemsSubLineItemsMatrixSubLineItemTypeMatrix InvoiceLineItemsSubLineItemsMatrixSubLineItemType = "matrix"
)

func (InvoiceLineItemsSubLineItemsMatrixSubLineItemType) IsKnown added in v0.24.0

type InvoiceLineItemsSubLineItemsOtherSubLineItem

type InvoiceLineItemsSubLineItemsOtherSubLineItem struct {
	// The total amount for this sub line item.
	Amount   string                                               `json:"amount,required"`
	Grouping InvoiceLineItemsSubLineItemsOtherSubLineItemGrouping `json:"grouping,required,nullable"`
	Name     string                                               `json:"name,required"`
	Quantity float64                                              `json:"quantity,required"`
	Type     InvoiceLineItemsSubLineItemsOtherSubLineItemType     `json:"type,required"`
	JSON     invoiceLineItemsSubLineItemsOtherSubLineItemJSON     `json:"-"`
}

func (*InvoiceLineItemsSubLineItemsOtherSubLineItem) UnmarshalJSON

func (r *InvoiceLineItemsSubLineItemsOtherSubLineItem) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItemsSubLineItemsOtherSubLineItemGrouping

type InvoiceLineItemsSubLineItemsOtherSubLineItemGrouping struct {
	Key string `json:"key,required"`
	// No value indicates the default group
	Value string                                                   `json:"value,required,nullable"`
	JSON  invoiceLineItemsSubLineItemsOtherSubLineItemGroupingJSON `json:"-"`
}

func (*InvoiceLineItemsSubLineItemsOtherSubLineItemGrouping) UnmarshalJSON

func (r *InvoiceLineItemsSubLineItemsOtherSubLineItemGrouping) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItemsSubLineItemsOtherSubLineItemType

type InvoiceLineItemsSubLineItemsOtherSubLineItemType string
const (
	InvoiceLineItemsSubLineItemsOtherSubLineItemTypeNull InvoiceLineItemsSubLineItemsOtherSubLineItemType = "'null'"
)

func (InvoiceLineItemsSubLineItemsOtherSubLineItemType) IsKnown added in v0.24.0

type InvoiceLineItemsSubLineItemsTierSubLineItem

type InvoiceLineItemsSubLineItemsTierSubLineItem struct {
	// The total amount for this sub line item.
	Amount     string                                                `json:"amount,required"`
	Grouping   InvoiceLineItemsSubLineItemsTierSubLineItemGrouping   `json:"grouping,required,nullable"`
	Name       string                                                `json:"name,required"`
	Quantity   float64                                               `json:"quantity,required"`
	TierConfig InvoiceLineItemsSubLineItemsTierSubLineItemTierConfig `json:"tier_config,required"`
	Type       InvoiceLineItemsSubLineItemsTierSubLineItemType       `json:"type,required"`
	JSON       invoiceLineItemsSubLineItemsTierSubLineItemJSON       `json:"-"`
}

func (*InvoiceLineItemsSubLineItemsTierSubLineItem) UnmarshalJSON

func (r *InvoiceLineItemsSubLineItemsTierSubLineItem) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItemsSubLineItemsTierSubLineItemGrouping

type InvoiceLineItemsSubLineItemsTierSubLineItemGrouping struct {
	Key string `json:"key,required"`
	// No value indicates the default group
	Value string                                                  `json:"value,required,nullable"`
	JSON  invoiceLineItemsSubLineItemsTierSubLineItemGroupingJSON `json:"-"`
}

func (*InvoiceLineItemsSubLineItemsTierSubLineItemGrouping) UnmarshalJSON

func (r *InvoiceLineItemsSubLineItemsTierSubLineItemGrouping) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItemsSubLineItemsTierSubLineItemTierConfig

type InvoiceLineItemsSubLineItemsTierSubLineItemTierConfig struct {
	FirstUnit  float64                                                   `json:"first_unit,required"`
	LastUnit   float64                                                   `json:"last_unit,required,nullable"`
	UnitAmount string                                                    `json:"unit_amount,required"`
	JSON       invoiceLineItemsSubLineItemsTierSubLineItemTierConfigJSON `json:"-"`
}

func (*InvoiceLineItemsSubLineItemsTierSubLineItemTierConfig) UnmarshalJSON

func (r *InvoiceLineItemsSubLineItemsTierSubLineItemTierConfig) UnmarshalJSON(data []byte) (err error)

type InvoiceLineItemsSubLineItemsTierSubLineItemType

type InvoiceLineItemsSubLineItemsTierSubLineItemType string
const (
	InvoiceLineItemsSubLineItemsTierSubLineItemTypeTier InvoiceLineItemsSubLineItemsTierSubLineItemType = "tier"
)

func (InvoiceLineItemsSubLineItemsTierSubLineItemType) IsKnown added in v0.24.0

type InvoiceLineItemsTaxAmount

type InvoiceLineItemsTaxAmount struct {
	// The amount of additional tax incurred by this tax rate.
	Amount string `json:"amount,required"`
	// The human-readable description of the applied tax rate.
	TaxRateDescription string `json:"tax_rate_description,required"`
	// The tax rate percentage, out of 100.
	TaxRatePercentage string                        `json:"tax_rate_percentage,required,nullable"`
	JSON              invoiceLineItemsTaxAmountJSON `json:"-"`
}

func (*InvoiceLineItemsTaxAmount) UnmarshalJSON

func (r *InvoiceLineItemsTaxAmount) UnmarshalJSON(data []byte) (err error)

type InvoiceListParams

type InvoiceListParams struct {
	Amount   param.Field[string] `query:"amount"`
	AmountGt param.Field[string] `query:"amount[gt]"`
	AmountLt param.Field[string] `query:"amount[lt]"`
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor             param.Field[string]                    `query:"cursor"`
	CustomerID         param.Field[string]                    `query:"customer_id"`
	DateType           param.Field[InvoiceListParamsDateType] `query:"date_type"`
	DueDate            param.Field[time.Time]                 `query:"due_date" format:"date"`
	DueDateWindow      param.Field[string]                    `query:"due_date_window"`
	DueDateGt          param.Field[time.Time]                 `query:"due_date[gt]" format:"date"`
	DueDateLt          param.Field[time.Time]                 `query:"due_date[lt]" format:"date"`
	ExternalCustomerID param.Field[string]                    `query:"external_customer_id"`
	InvoiceDateGt      param.Field[time.Time]                 `query:"invoice_date[gt]" format:"date-time"`
	InvoiceDateGte     param.Field[time.Time]                 `query:"invoice_date[gte]" format:"date-time"`
	InvoiceDateLt      param.Field[time.Time]                 `query:"invoice_date[lt]" format:"date-time"`
	InvoiceDateLte     param.Field[time.Time]                 `query:"invoice_date[lte]" format:"date-time"`
	IsRecurring        param.Field[bool]                      `query:"is_recurring"`
	// The number of items to fetch. Defaults to 20.
	Limit          param.Field[int64]                     `query:"limit"`
	Status         param.Field[[]InvoiceListParamsStatus] `query:"status"`
	SubscriptionID param.Field[string]                    `query:"subscription_id"`
}

func (InvoiceListParams) URLQuery

func (r InvoiceListParams) URLQuery() (v url.Values)

URLQuery serializes InvoiceListParams's query parameters as `url.Values`.

type InvoiceListParamsDateType

type InvoiceListParamsDateType string
const (
	InvoiceListParamsDateTypeDueDate     InvoiceListParamsDateType = "due_date"
	InvoiceListParamsDateTypeInvoiceDate InvoiceListParamsDateType = "invoice_date"
)

func (InvoiceListParamsDateType) IsKnown added in v0.24.0

func (r InvoiceListParamsDateType) IsKnown() bool

type InvoiceListParamsStatus

type InvoiceListParamsStatus string
const (
	InvoiceListParamsStatusDraft  InvoiceListParamsStatus = "draft"
	InvoiceListParamsStatusIssued InvoiceListParamsStatus = "issued"
	InvoiceListParamsStatusPaid   InvoiceListParamsStatus = "paid"
	InvoiceListParamsStatusSynced InvoiceListParamsStatus = "synced"
	InvoiceListParamsStatusVoid   InvoiceListParamsStatus = "void"
)

func (InvoiceListParamsStatus) IsKnown added in v0.24.0

func (r InvoiceListParamsStatus) IsKnown() bool

type InvoiceMarkPaidParams

type InvoiceMarkPaidParams struct {
	// A date string to specify the date of the payment.
	PaymentReceivedDate param.Field[time.Time] `json:"payment_received_date,required" format:"date"`
	// An optional external ID to associate with the payment.
	ExternalID param.Field[string] `json:"external_id"`
	// An optional note to associate with the payment.
	Notes param.Field[string] `json:"notes"`
}

func (InvoiceMarkPaidParams) MarshalJSON

func (r InvoiceMarkPaidParams) MarshalJSON() (data []byte, err error)

type InvoiceMaximum

type InvoiceMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string             `json:"maximum_amount,required"`
	JSON          invoiceMaximumJSON `json:"-"`
}

func (*InvoiceMaximum) UnmarshalJSON

func (r *InvoiceMaximum) UnmarshalJSON(data []byte) (err error)

type InvoiceMinimum

type InvoiceMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string             `json:"minimum_amount,required"`
	JSON          invoiceMinimumJSON `json:"-"`
}

func (*InvoiceMinimum) UnmarshalJSON

func (r *InvoiceMinimum) UnmarshalJSON(data []byte) (err error)

type InvoiceNewParams

type InvoiceNewParams struct {
	// An ISO 4217 currency string. Must be the same as the customer's currency if it
	// is set.
	Currency param.Field[string] `json:"currency,required"`
	// Optional invoice date to set. Must be in the past, if not set, `invoice_date` is
	// set to the current time in the customer's timezone.
	InvoiceDate param.Field[time.Time]                  `json:"invoice_date,required" format:"date-time"`
	LineItems   param.Field[[]InvoiceNewParamsLineItem] `json:"line_items,required"`
	// Determines the difference between the invoice issue date for subscription
	// invoices as the date that they are due. A value of '0' here represents that the
	// invoice is due on issue, whereas a value of 30 represents that the customer has
	// 30 days to pay the invoice.
	NetTerms param.Field[int64] `json:"net_terms,required"`
	// The id of the `Customer` to create this invoice for. One of `customer_id` and
	// `external_customer_id` are required.
	CustomerID param.Field[string] `json:"customer_id"`
	// The `external_customer_id` of the `Customer` to create this invoice for. One of
	// `customer_id` and `external_customer_id` are required.
	ExternalCustomerID param.Field[string] `json:"external_customer_id"`
	// An optional memo to attach to the invoice.
	Memo param.Field[string] `json:"memo"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// When true, this invoice will automatically be issued upon creation. When false,
	// the resulting invoice will require manual review to issue. Defaulted to false.
	WillAutoIssue param.Field[bool] `json:"will_auto_issue"`
}

func (InvoiceNewParams) MarshalJSON

func (r InvoiceNewParams) MarshalJSON() (data []byte, err error)

type InvoiceNewParamsLineItem

type InvoiceNewParamsLineItem struct {
	// A date string to specify the line item's end date in the customer's timezone.
	EndDate   param.Field[time.Time]                          `json:"end_date,required" format:"date"`
	ItemID    param.Field[string]                             `json:"item_id,required"`
	ModelType param.Field[InvoiceNewParamsLineItemsModelType] `json:"model_type,required"`
	// The name of the line item.
	Name param.Field[string] `json:"name,required"`
	// The number of units on the line item
	Quantity param.Field[float64] `json:"quantity,required"`
	// A date string to specify the line item's start date in the customer's timezone.
	StartDate  param.Field[time.Time]                           `json:"start_date,required" format:"date"`
	UnitConfig param.Field[InvoiceNewParamsLineItemsUnitConfig] `json:"unit_config,required"`
}

func (InvoiceNewParamsLineItem) MarshalJSON

func (r InvoiceNewParamsLineItem) MarshalJSON() (data []byte, err error)

type InvoiceNewParamsLineItemsModelType

type InvoiceNewParamsLineItemsModelType string
const (
	InvoiceNewParamsLineItemsModelTypeUnit InvoiceNewParamsLineItemsModelType = "unit"
)

func (InvoiceNewParamsLineItemsModelType) IsKnown added in v0.24.0

type InvoiceNewParamsLineItemsUnitConfig

type InvoiceNewParamsLineItemsUnitConfig struct {
	// Rate per unit of usage
	UnitAmount param.Field[string] `json:"unit_amount,required"`
}

func (InvoiceNewParamsLineItemsUnitConfig) MarshalJSON

func (r InvoiceNewParamsLineItemsUnitConfig) MarshalJSON() (data []byte, err error)

type InvoiceService

type InvoiceService struct {
	Options []option.RequestOption
}

InvoiceService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewInvoiceService method instead.

func NewInvoiceService

func NewInvoiceService(opts ...option.RequestOption) (r *InvoiceService)

NewInvoiceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*InvoiceService) Fetch

func (r *InvoiceService) Fetch(ctx context.Context, invoiceID string, opts ...option.RequestOption) (res *Invoice, err error)

This endpoint is used to fetch an [`Invoice`](../guides/concepts#invoice) given an identifier.

func (*InvoiceService) FetchUpcoming

This endpoint can be used to fetch the upcoming [invoice](../guides/concepts#invoice) for the current billing period given a subscription.

func (*InvoiceService) Issue

func (r *InvoiceService) Issue(ctx context.Context, invoiceID string, opts ...option.RequestOption) (res *Invoice, err error)

This endpoint allows an eligible invoice to be issued manually. This is only possible with invoices where status is `draft`, `will_auto_issue` is true, and an `eligible_to_issue_at` is a time in the past. Issuing an invoice could possibly trigger side effects, some of which could be customer-visible (e.g. sending emails, auto-collecting payment, syncing the invoice to external providers, etc).

func (*InvoiceService) List

func (r *InvoiceService) List(ctx context.Context, query InvoiceListParams, opts ...option.RequestOption) (res *shared.Page[Invoice], err error)

This endpoint returns a list of all [`Invoice`](../guides/concepts#invoice)s for an account in a list format.

The list of invoices is ordered starting from the most recently issued invoice date. The response also includes [`pagination_metadata`](../reference/pagination), which lets the caller retrieve the next page of results if they exist.

By default, this only returns invoices that are `issued`, `paid`, or `synced`.

func (*InvoiceService) ListAutoPaging

This endpoint returns a list of all [`Invoice`](../guides/concepts#invoice)s for an account in a list format.

The list of invoices is ordered starting from the most recently issued invoice date. The response also includes [`pagination_metadata`](../reference/pagination), which lets the caller retrieve the next page of results if they exist.

By default, this only returns invoices that are `issued`, `paid`, or `synced`.

func (*InvoiceService) MarkPaid

func (r *InvoiceService) MarkPaid(ctx context.Context, invoiceID string, body InvoiceMarkPaidParams, opts ...option.RequestOption) (res *Invoice, err error)

This endpoint allows an invoice's status to be set the `paid` status. This can only be done to invoices that are in the `issued` status.

func (*InvoiceService) New

func (r *InvoiceService) New(ctx context.Context, body InvoiceNewParams, opts ...option.RequestOption) (res *Invoice, err error)

This endpoint is used to create a one-off invoice for a customer.

func (*InvoiceService) Void

func (r *InvoiceService) Void(ctx context.Context, invoiceID string, opts ...option.RequestOption) (res *Invoice, err error)

This endpoint allows an invoice's status to be set the `void` status. This can only be done to invoices that are in the `issued` status.

If the associated invoice has used the customer balance to change the amount due, the customer balance operation will be reverted. For example, if the invoice used $10 of customer balance, that amount will be added back to the customer balance upon voiding.

type InvoiceShippingAddress

type InvoiceShippingAddress struct {
	City       string                     `json:"city,required,nullable"`
	Country    string                     `json:"country,required,nullable"`
	Line1      string                     `json:"line1,required,nullable"`
	Line2      string                     `json:"line2,required,nullable"`
	PostalCode string                     `json:"postal_code,required,nullable"`
	State      string                     `json:"state,required,nullable"`
	JSON       invoiceShippingAddressJSON `json:"-"`
}

func (*InvoiceShippingAddress) UnmarshalJSON

func (r *InvoiceShippingAddress) UnmarshalJSON(data []byte) (err error)

type InvoiceStatus

type InvoiceStatus string
const (
	InvoiceStatusIssued InvoiceStatus = "issued"
	InvoiceStatusPaid   InvoiceStatus = "paid"
	InvoiceStatusSynced InvoiceStatus = "synced"
	InvoiceStatusVoid   InvoiceStatus = "void"
	InvoiceStatusDraft  InvoiceStatus = "draft"
)

func (InvoiceStatus) IsKnown added in v0.24.0

func (r InvoiceStatus) IsKnown() bool

type InvoiceSubscription

type InvoiceSubscription struct {
	ID   string                  `json:"id,required"`
	JSON invoiceSubscriptionJSON `json:"-"`
}

func (*InvoiceSubscription) UnmarshalJSON

func (r *InvoiceSubscription) UnmarshalJSON(data []byte) (err error)

type Item added in v0.3.0

type Item struct {
	ID                  string                   `json:"id,required"`
	CreatedAt           time.Time                `json:"created_at,required" format:"date-time"`
	ExternalConnections []ItemExternalConnection `json:"external_connections,required"`
	Name                string                   `json:"name,required"`
	JSON                itemJSON                 `json:"-"`
}

The Item resource represents a sellable product or good. Items are associated with all line items, billable metrics, and prices and are used for defining external sync behavior for invoices and tax calculation purposes.

func (*Item) UnmarshalJSON added in v0.3.0

func (r *Item) UnmarshalJSON(data []byte) (err error)

type ItemExternalConnection added in v0.3.0

type ItemExternalConnection struct {
	ExternalConnectionName ItemExternalConnectionsExternalConnectionName `json:"external_connection_name,required"`
	ExternalEntityID       string                                        `json:"external_entity_id,required"`
	JSON                   itemExternalConnectionJSON                    `json:"-"`
}

func (*ItemExternalConnection) UnmarshalJSON added in v0.3.0

func (r *ItemExternalConnection) UnmarshalJSON(data []byte) (err error)

type ItemExternalConnectionsExternalConnectionName added in v0.3.0

type ItemExternalConnectionsExternalConnectionName string
const (
	ItemExternalConnectionsExternalConnectionNameStripe     ItemExternalConnectionsExternalConnectionName = "stripe"
	ItemExternalConnectionsExternalConnectionNameQuickbooks ItemExternalConnectionsExternalConnectionName = "quickbooks"
	ItemExternalConnectionsExternalConnectionNameBillCom    ItemExternalConnectionsExternalConnectionName = "bill.com"
	ItemExternalConnectionsExternalConnectionNameNetsuite   ItemExternalConnectionsExternalConnectionName = "netsuite"
	ItemExternalConnectionsExternalConnectionNameTaxjar     ItemExternalConnectionsExternalConnectionName = "taxjar"
	ItemExternalConnectionsExternalConnectionNameAvalara    ItemExternalConnectionsExternalConnectionName = "avalara"
	ItemExternalConnectionsExternalConnectionNameAnrok      ItemExternalConnectionsExternalConnectionName = "anrok"
)

func (ItemExternalConnectionsExternalConnectionName) IsKnown added in v0.24.0

type ItemListParams

type ItemListParams struct {
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor param.Field[string] `query:"cursor"`
	// The number of items to fetch. Defaults to 20.
	Limit param.Field[int64] `query:"limit"`
}

func (ItemListParams) URLQuery

func (r ItemListParams) URLQuery() (v url.Values)

URLQuery serializes ItemListParams's query parameters as `url.Values`.

type ItemNewParams added in v0.3.0

type ItemNewParams struct {
	// The name of the item.
	Name param.Field[string] `json:"name,required"`
}

func (ItemNewParams) MarshalJSON added in v0.3.0

func (r ItemNewParams) MarshalJSON() (data []byte, err error)

type ItemService

type ItemService struct {
	Options []option.RequestOption
}

ItemService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewItemService method instead.

func NewItemService

func NewItemService(opts ...option.RequestOption) (r *ItemService)

NewItemService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ItemService) Fetch

func (r *ItemService) Fetch(ctx context.Context, itemID string, opts ...option.RequestOption) (res *Item, err error)

This endpoint returns an item identified by its item_id.

func (*ItemService) List

func (r *ItemService) List(ctx context.Context, query ItemListParams, opts ...option.RequestOption) (res *shared.Page[Item], err error)

This endpoint returns a list of all Items, ordered in descending order by creation time.

func (*ItemService) ListAutoPaging

func (r *ItemService) ListAutoPaging(ctx context.Context, query ItemListParams, opts ...option.RequestOption) *shared.PageAutoPager[Item]

This endpoint returns a list of all Items, ordered in descending order by creation time.

func (*ItemService) New added in v0.3.0

func (r *ItemService) New(ctx context.Context, body ItemNewParams, opts ...option.RequestOption) (res *Item, err error)

This endpoint is used to create an Item(../guides/concepts#item).

type MetricFetchResponse

type MetricFetchResponse struct {
	ID          string `json:"id,required"`
	Description string `json:"description,required,nullable"`
	// The Item resource represents a sellable product or good. Items are associated
	// with all line items, billable metrics, and prices and are used for defining
	// external sync behavior for invoices and tax calculation purposes.
	Item Item `json:"item,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata map[string]string         `json:"metadata,required"`
	Name     string                    `json:"name,required"`
	Status   MetricFetchResponseStatus `json:"status,required"`
	JSON     metricFetchResponseJSON   `json:"-"`
}

The Metric resource represents a calculation of a quantity based on events. Metrics are defined by the query that transforms raw usage events into meaningful values for your customers.

func (*MetricFetchResponse) UnmarshalJSON

func (r *MetricFetchResponse) UnmarshalJSON(data []byte) (err error)

type MetricFetchResponseStatus

type MetricFetchResponseStatus string
const (
	MetricFetchResponseStatusActive   MetricFetchResponseStatus = "active"
	MetricFetchResponseStatusDraft    MetricFetchResponseStatus = "draft"
	MetricFetchResponseStatusArchived MetricFetchResponseStatus = "archived"
)

func (MetricFetchResponseStatus) IsKnown added in v0.24.0

func (r MetricFetchResponseStatus) IsKnown() bool

type MetricListParams

type MetricListParams struct {
	CreatedAtGt  param.Field[time.Time] `query:"created_at[gt]" format:"date-time"`
	CreatedAtGte param.Field[time.Time] `query:"created_at[gte]" format:"date-time"`
	CreatedAtLt  param.Field[time.Time] `query:"created_at[lt]" format:"date-time"`
	CreatedAtLte param.Field[time.Time] `query:"created_at[lte]" format:"date-time"`
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor param.Field[string] `query:"cursor"`
	// The number of items to fetch. Defaults to 20.
	Limit param.Field[int64] `query:"limit"`
}

func (MetricListParams) URLQuery

func (r MetricListParams) URLQuery() (v url.Values)

URLQuery serializes MetricListParams's query parameters as `url.Values`.

type MetricListResponse

type MetricListResponse struct {
	ID          string `json:"id,required"`
	Description string `json:"description,required,nullable"`
	// The Item resource represents a sellable product or good. Items are associated
	// with all line items, billable metrics, and prices and are used for defining
	// external sync behavior for invoices and tax calculation purposes.
	Item Item `json:"item,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata map[string]string        `json:"metadata,required"`
	Name     string                   `json:"name,required"`
	Status   MetricListResponseStatus `json:"status,required"`
	JSON     metricListResponseJSON   `json:"-"`
}

The Metric resource represents a calculation of a quantity based on events. Metrics are defined by the query that transforms raw usage events into meaningful values for your customers.

func (*MetricListResponse) UnmarshalJSON

func (r *MetricListResponse) UnmarshalJSON(data []byte) (err error)

type MetricListResponseStatus

type MetricListResponseStatus string
const (
	MetricListResponseStatusActive   MetricListResponseStatus = "active"
	MetricListResponseStatusDraft    MetricListResponseStatus = "draft"
	MetricListResponseStatusArchived MetricListResponseStatus = "archived"
)

func (MetricListResponseStatus) IsKnown added in v0.24.0

func (r MetricListResponseStatus) IsKnown() bool

type MetricNewParams

type MetricNewParams struct {
	// A description of the metric.
	Description param.Field[string] `json:"description,required"`
	// The id of the item
	ItemID param.Field[string] `json:"item_id,required"`
	// The name of the metric.
	Name param.Field[string] `json:"name,required"`
	// A sql string defining the metric.
	Sql param.Field[string] `json:"sql,required"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (MetricNewParams) MarshalJSON

func (r MetricNewParams) MarshalJSON() (data []byte, err error)

type MetricNewResponse

type MetricNewResponse struct {
	ID          string `json:"id,required"`
	Description string `json:"description,required,nullable"`
	// The Item resource represents a sellable product or good. Items are associated
	// with all line items, billable metrics, and prices and are used for defining
	// external sync behavior for invoices and tax calculation purposes.
	Item Item `json:"item,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata map[string]string       `json:"metadata,required"`
	Name     string                  `json:"name,required"`
	Status   MetricNewResponseStatus `json:"status,required"`
	JSON     metricNewResponseJSON   `json:"-"`
}

The Metric resource represents a calculation of a quantity based on events. Metrics are defined by the query that transforms raw usage events into meaningful values for your customers.

func (*MetricNewResponse) UnmarshalJSON

func (r *MetricNewResponse) UnmarshalJSON(data []byte) (err error)

type MetricNewResponseStatus

type MetricNewResponseStatus string
const (
	MetricNewResponseStatusActive   MetricNewResponseStatus = "active"
	MetricNewResponseStatusDraft    MetricNewResponseStatus = "draft"
	MetricNewResponseStatusArchived MetricNewResponseStatus = "archived"
)

func (MetricNewResponseStatus) IsKnown added in v0.24.0

func (r MetricNewResponseStatus) IsKnown() bool

type MetricService

type MetricService struct {
	Options []option.RequestOption
}

MetricService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMetricService method instead.

func NewMetricService

func NewMetricService(opts ...option.RequestOption) (r *MetricService)

NewMetricService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*MetricService) Fetch

func (r *MetricService) Fetch(ctx context.Context, metricID string, opts ...option.RequestOption) (res *MetricFetchResponse, err error)

This endpoint is used to list [metrics](../guides/concepts##metric). It returns information about the metrics including its name, description, and item.

func (*MetricService) List

This endpoint is used to fetch [metric](../guides/concepts#metric) details given a metric identifier. It returns information about the metrics including its name, description, and item.

func (*MetricService) ListAutoPaging

This endpoint is used to fetch [metric](../guides/concepts#metric) details given a metric identifier. It returns information about the metrics including its name, description, and item.

func (*MetricService) New

This endpoint is used to create a [metric](../guides/concepts##metric) using a SQL string. See [SQL support](../guides/extensibility/advanced-metrics#sql-support) for a description of constructing SQL queries with examples.

type Plan

type Plan struct {
	ID       string       `json:"id,required"`
	BasePlan PlanBasePlan `json:"base_plan,required,nullable"`
	// The parent plan id if the given plan was created by overriding one or more of
	// the parent's prices
	BasePlanID string    `json:"base_plan_id,required,nullable"`
	CreatedAt  time.Time `json:"created_at,required" format:"date-time"`
	// An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's
	// prices.
	Currency string `json:"currency,required"`
	// The default memo text on the invoices corresponding to subscriptions on this
	// plan. Note that each subscription may configure its own memo.
	DefaultInvoiceMemo string          `json:"default_invoice_memo,required,nullable"`
	Description        string          `json:"description,required"`
	Discount           shared.Discount `json:"discount,required,nullable"`
	// An optional user-defined ID for this plan resource, used throughout the system
	// as an alias for this Plan. Use this field to identify a plan by an existing
	// identifier in your system.
	ExternalPlanID string `json:"external_plan_id,required,nullable"`
	// An ISO 4217 currency string for which this plan is billed in. Matches `currency`
	// unless `currency` is a custom pricing unit.
	InvoicingCurrency string      `json:"invoicing_currency,required"`
	Maximum           PlanMaximum `json:"maximum,required,nullable"`
	MaximumAmount     string      `json:"maximum_amount,required,nullable"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata      map[string]string `json:"metadata,required"`
	Minimum       PlanMinimum       `json:"minimum,required,nullable"`
	MinimumAmount string            `json:"minimum_amount,required,nullable"`
	Name          string            `json:"name,required"`
	// Determines the difference between the invoice issue date and the due date. A
	// value of "0" here signifies that invoices are due on issue, whereas a value of
	// "30" means that the customer has a month to pay the invoice before its overdue.
	// Note that individual subscriptions or invoices may set a different net terms
	// configuration.
	NetTerms   int64           `json:"net_terms,required,nullable"`
	PlanPhases []PlanPlanPhase `json:"plan_phases,required,nullable"`
	// Prices for this plan. If the plan has phases, this includes prices across all
	// phases of the plan.
	Prices      []Price         `json:"prices,required"`
	Product     PlanProduct     `json:"product,required"`
	Status      PlanStatus      `json:"status,required"`
	TrialConfig PlanTrialConfig `json:"trial_config,required"`
	Version     int64           `json:"version,required"`
	JSON        planJSON        `json:"-"`
}

The Plan(../guides/core-concepts.mdx#plan-and-price) resource represents a plan that can be subscribed to by a customer. Plans define the billing behavior of the subscription. You can see more about how to configure prices in the [Price resource](/reference/price).

func (*Plan) UnmarshalJSON

func (r *Plan) UnmarshalJSON(data []byte) (err error)

type PlanBasePlan

type PlanBasePlan struct {
	ID string `json:"id,required,nullable"`
	// An optional user-defined ID for this plan resource, used throughout the system
	// as an alias for this Plan. Use this field to identify a plan by an existing
	// identifier in your system.
	ExternalPlanID string           `json:"external_plan_id,required,nullable"`
	Name           string           `json:"name,required,nullable"`
	JSON           planBasePlanJSON `json:"-"`
}

func (*PlanBasePlan) UnmarshalJSON

func (r *PlanBasePlan) UnmarshalJSON(data []byte) (err error)

type PlanExternalPlanIDService

type PlanExternalPlanIDService struct {
	Options []option.RequestOption
}

PlanExternalPlanIDService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPlanExternalPlanIDService method instead.

func NewPlanExternalPlanIDService

func NewPlanExternalPlanIDService(opts ...option.RequestOption) (r *PlanExternalPlanIDService)

NewPlanExternalPlanIDService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PlanExternalPlanIDService) Fetch

func (r *PlanExternalPlanIDService) Fetch(ctx context.Context, externalPlanID string, opts ...option.RequestOption) (res *Plan, err error)

This endpoint is used to fetch [plan](../guides/concepts##plan-and-price) details given an external_plan_id identifier. It returns information about the prices included in the plan and their configuration, as well as the product that the plan is attached to.

## Serialized prices

Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a given Price(../guides/concepts#plan-and-price) object. The `model_type` field determines the key for the configuration object that is present. A detailed explanation of price types can be found in the [Price schema](../guides/concepts#plan-and-price). "

func (*PlanExternalPlanIDService) Update

func (r *PlanExternalPlanIDService) Update(ctx context.Context, otherExternalPlanID string, body PlanExternalPlanIDUpdateParams, opts ...option.RequestOption) (res *Plan, err error)

This endpoint is used to fetch [plan](../guides/concepts##plan-and-price) details given an external_plan_id identifier. It returns information about the prices included in the plan and their configuration, as well as the product that the plan is attached to.

## Serialized prices

Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a given Price(../guides/concepts#plan-and-price) object. The `model_type` field determines the key for the configuration object that is present. A detailed explanation of price types can be found in the [Price schema](../guides/concepts#plan-and-price).

type PlanExternalPlanIDUpdateParams

type PlanExternalPlanIDUpdateParams struct {
	// An optional user-defined ID for this plan resource, used throughout the system
	// as an alias for this Plan. Use this field to identify a plan by an existing
	// identifier in your system.
	ExternalPlanID param.Field[string] `json:"external_plan_id"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (PlanExternalPlanIDUpdateParams) MarshalJSON

func (r PlanExternalPlanIDUpdateParams) MarshalJSON() (data []byte, err error)

type PlanListParams

type PlanListParams struct {
	CreatedAtGt  param.Field[time.Time] `query:"created_at[gt]" format:"date-time"`
	CreatedAtGte param.Field[time.Time] `query:"created_at[gte]" format:"date-time"`
	CreatedAtLt  param.Field[time.Time] `query:"created_at[lt]" format:"date-time"`
	CreatedAtLte param.Field[time.Time] `query:"created_at[lte]" format:"date-time"`
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor param.Field[string] `query:"cursor"`
	// The number of items to fetch. Defaults to 20.
	Limit param.Field[int64] `query:"limit"`
	// The plan status to filter to ('active', 'archived', or 'draft').
	Status param.Field[PlanListParamsStatus] `query:"status"`
}

func (PlanListParams) URLQuery

func (r PlanListParams) URLQuery() (v url.Values)

URLQuery serializes PlanListParams's query parameters as `url.Values`.

type PlanListParamsStatus

type PlanListParamsStatus string

The plan status to filter to ('active', 'archived', or 'draft').

const (
	PlanListParamsStatusActive   PlanListParamsStatus = "active"
	PlanListParamsStatusArchived PlanListParamsStatus = "archived"
	PlanListParamsStatusDraft    PlanListParamsStatus = "draft"
)

func (PlanListParamsStatus) IsKnown added in v0.24.0

func (r PlanListParamsStatus) IsKnown() bool

type PlanMaximum

type PlanMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string          `json:"maximum_amount,required"`
	JSON          planMaximumJSON `json:"-"`
}

func (*PlanMaximum) UnmarshalJSON

func (r *PlanMaximum) UnmarshalJSON(data []byte) (err error)

type PlanMinimum

type PlanMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string          `json:"minimum_amount,required"`
	JSON          planMinimumJSON `json:"-"`
}

func (*PlanMinimum) UnmarshalJSON

func (r *PlanMinimum) UnmarshalJSON(data []byte) (err error)

type PlanNewParams

type PlanNewParams struct {
	// An ISO 4217 currency string for invoices generated by subscriptions on this
	// plan.
	Currency param.Field[string] `json:"currency,required"`
	Name     param.Field[string] `json:"name,required"`
	// Prices for this plan. If the plan has phases, this includes prices across all
	// phases of the plan.
	Prices param.Field[[]PlanNewParamsPrice] `json:"prices,required"`
	// Free-form text which is available on the invoice PDF and the Orb invoice portal.
	DefaultInvoiceMemo param.Field[string] `json:"default_invoice_memo"`
	ExternalPlanID     param.Field[string] `json:"external_plan_id"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
	// The net terms determines the difference between the invoice date and the issue
	// date for the invoice. If you intend the invoice to be due on issue, set this
	// to 0.
	NetTerms param.Field[int64] `json:"net_terms"`
}

func (PlanNewParams) MarshalJSON

func (r PlanNewParams) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanBpsPrice added in v0.2.0

type PlanNewParamsPricesNewPlanBpsPrice struct {
	BpsConfig param.Field[PlanNewParamsPricesNewPlanBpsPriceBpsConfig] `json:"bps_config,required"`
	// The cadence to bill for this price on.
	Cadence param.Field[PlanNewParamsPricesNewPlanBpsPriceCadence] `json:"cadence,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                      `json:"item_id,required"`
	ModelType param.Field[PlanNewParamsPricesNewPlanBpsPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name param.Field[string] `json:"name,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PlanNewParamsPricesNewPlanBpsPrice) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanBpsPrice) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanBpsPriceBpsConfig added in v0.2.0

type PlanNewParamsPricesNewPlanBpsPriceBpsConfig struct {
	// Basis point take rate per event
	Bps param.Field[float64] `json:"bps,required"`
	// Optional currency amount maximum to cap spend per event
	PerUnitMaximum param.Field[string] `json:"per_unit_maximum"`
}

func (PlanNewParamsPricesNewPlanBpsPriceBpsConfig) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanBpsPriceBpsConfig) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanBpsPriceCadence added in v0.2.0

type PlanNewParamsPricesNewPlanBpsPriceCadence string

The cadence to bill for this price on.

const (
	PlanNewParamsPricesNewPlanBpsPriceCadenceAnnual    PlanNewParamsPricesNewPlanBpsPriceCadence = "annual"
	PlanNewParamsPricesNewPlanBpsPriceCadenceMonthly   PlanNewParamsPricesNewPlanBpsPriceCadence = "monthly"
	PlanNewParamsPricesNewPlanBpsPriceCadenceQuarterly PlanNewParamsPricesNewPlanBpsPriceCadence = "quarterly"
	PlanNewParamsPricesNewPlanBpsPriceCadenceOneTime   PlanNewParamsPricesNewPlanBpsPriceCadence = "one_time"
)

func (PlanNewParamsPricesNewPlanBpsPriceCadence) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanBpsPriceModelType added in v0.2.0

type PlanNewParamsPricesNewPlanBpsPriceModelType string
const (
	PlanNewParamsPricesNewPlanBpsPriceModelTypeBps PlanNewParamsPricesNewPlanBpsPriceModelType = "bps"
)

func (PlanNewParamsPricesNewPlanBpsPriceModelType) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanBulkBpsPrice added in v0.2.0

type PlanNewParamsPricesNewPlanBulkBpsPrice struct {
	BulkBpsConfig param.Field[PlanNewParamsPricesNewPlanBulkBpsPriceBulkBpsConfig] `json:"bulk_bps_config,required"`
	// The cadence to bill for this price on.
	Cadence param.Field[PlanNewParamsPricesNewPlanBulkBpsPriceCadence] `json:"cadence,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                          `json:"item_id,required"`
	ModelType param.Field[PlanNewParamsPricesNewPlanBulkBpsPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name param.Field[string] `json:"name,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PlanNewParamsPricesNewPlanBulkBpsPrice) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanBulkBpsPrice) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanBulkBpsPriceBulkBpsConfig added in v0.2.0

type PlanNewParamsPricesNewPlanBulkBpsPriceBulkBpsConfig struct {
	// Tiers for a bulk BPS pricing model where all usage is aggregated to a single
	// tier based on total volume
	Tiers param.Field[[]PlanNewParamsPricesNewPlanBulkBpsPriceBulkBpsConfigTier] `json:"tiers,required"`
}

func (PlanNewParamsPricesNewPlanBulkBpsPriceBulkBpsConfig) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanBulkBpsPriceBulkBpsConfig) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanBulkBpsPriceBulkBpsConfigTier added in v0.2.0

type PlanNewParamsPricesNewPlanBulkBpsPriceBulkBpsConfigTier struct {
	// Basis points to rate on
	Bps param.Field[float64] `json:"bps,required"`
	// Upper bound for tier
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The maximum amount to charge for any one event
	PerUnitMaximum param.Field[string] `json:"per_unit_maximum"`
}

func (PlanNewParamsPricesNewPlanBulkBpsPriceBulkBpsConfigTier) MarshalJSON added in v0.2.0

type PlanNewParamsPricesNewPlanBulkBpsPriceCadence added in v0.2.0

type PlanNewParamsPricesNewPlanBulkBpsPriceCadence string

The cadence to bill for this price on.

const (
	PlanNewParamsPricesNewPlanBulkBpsPriceCadenceAnnual    PlanNewParamsPricesNewPlanBulkBpsPriceCadence = "annual"
	PlanNewParamsPricesNewPlanBulkBpsPriceCadenceMonthly   PlanNewParamsPricesNewPlanBulkBpsPriceCadence = "monthly"
	PlanNewParamsPricesNewPlanBulkBpsPriceCadenceQuarterly PlanNewParamsPricesNewPlanBulkBpsPriceCadence = "quarterly"
	PlanNewParamsPricesNewPlanBulkBpsPriceCadenceOneTime   PlanNewParamsPricesNewPlanBulkBpsPriceCadence = "one_time"
)

func (PlanNewParamsPricesNewPlanBulkBpsPriceCadence) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanBulkBpsPriceModelType added in v0.2.0

type PlanNewParamsPricesNewPlanBulkBpsPriceModelType string
const (
	PlanNewParamsPricesNewPlanBulkBpsPriceModelTypeBulkBps PlanNewParamsPricesNewPlanBulkBpsPriceModelType = "bulk_bps"
)

func (PlanNewParamsPricesNewPlanBulkBpsPriceModelType) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanBulkPrice added in v0.2.0

type PlanNewParamsPricesNewPlanBulkPrice struct {
	BulkConfig param.Field[PlanNewParamsPricesNewPlanBulkPriceBulkConfig] `json:"bulk_config,required"`
	// The cadence to bill for this price on.
	Cadence param.Field[PlanNewParamsPricesNewPlanBulkPriceCadence] `json:"cadence,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                       `json:"item_id,required"`
	ModelType param.Field[PlanNewParamsPricesNewPlanBulkPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name param.Field[string] `json:"name,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PlanNewParamsPricesNewPlanBulkPrice) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanBulkPrice) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanBulkPriceBulkConfig added in v0.2.0

type PlanNewParamsPricesNewPlanBulkPriceBulkConfig struct {
	// Bulk tiers for rating based on total usage volume
	Tiers param.Field[[]PlanNewParamsPricesNewPlanBulkPriceBulkConfigTier] `json:"tiers,required"`
}

func (PlanNewParamsPricesNewPlanBulkPriceBulkConfig) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanBulkPriceBulkConfig) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanBulkPriceBulkConfigTier added in v0.2.0

type PlanNewParamsPricesNewPlanBulkPriceBulkConfigTier struct {
	// Amount per unit
	UnitAmount param.Field[string] `json:"unit_amount,required"`
	// Upper bound for this tier
	MaximumUnits param.Field[float64] `json:"maximum_units"`
}

func (PlanNewParamsPricesNewPlanBulkPriceBulkConfigTier) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanBulkPriceBulkConfigTier) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanBulkPriceCadence added in v0.2.0

type PlanNewParamsPricesNewPlanBulkPriceCadence string

The cadence to bill for this price on.

const (
	PlanNewParamsPricesNewPlanBulkPriceCadenceAnnual    PlanNewParamsPricesNewPlanBulkPriceCadence = "annual"
	PlanNewParamsPricesNewPlanBulkPriceCadenceMonthly   PlanNewParamsPricesNewPlanBulkPriceCadence = "monthly"
	PlanNewParamsPricesNewPlanBulkPriceCadenceQuarterly PlanNewParamsPricesNewPlanBulkPriceCadence = "quarterly"
	PlanNewParamsPricesNewPlanBulkPriceCadenceOneTime   PlanNewParamsPricesNewPlanBulkPriceCadence = "one_time"
)

func (PlanNewParamsPricesNewPlanBulkPriceCadence) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanBulkPriceModelType added in v0.2.0

type PlanNewParamsPricesNewPlanBulkPriceModelType string
const (
	PlanNewParamsPricesNewPlanBulkPriceModelTypeBulk PlanNewParamsPricesNewPlanBulkPriceModelType = "bulk"
)

func (PlanNewParamsPricesNewPlanBulkPriceModelType) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanMatrixPrice added in v0.2.0

type PlanNewParamsPricesNewPlanMatrixPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PlanNewParamsPricesNewPlanMatrixPriceCadence] `json:"cadence,required"`
	// The id of the item the plan will be associated with.
	ItemID       param.Field[string]                                            `json:"item_id,required"`
	MatrixConfig param.Field[PlanNewParamsPricesNewPlanMatrixPriceMatrixConfig] `json:"matrix_config,required"`
	ModelType    param.Field[PlanNewParamsPricesNewPlanMatrixPriceModelType]    `json:"model_type,required"`
	// The name of the price.
	Name param.Field[string] `json:"name,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PlanNewParamsPricesNewPlanMatrixPrice) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanMatrixPrice) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanMatrixPriceCadence added in v0.2.0

type PlanNewParamsPricesNewPlanMatrixPriceCadence string

The cadence to bill for this price on.

const (
	PlanNewParamsPricesNewPlanMatrixPriceCadenceAnnual    PlanNewParamsPricesNewPlanMatrixPriceCadence = "annual"
	PlanNewParamsPricesNewPlanMatrixPriceCadenceMonthly   PlanNewParamsPricesNewPlanMatrixPriceCadence = "monthly"
	PlanNewParamsPricesNewPlanMatrixPriceCadenceQuarterly PlanNewParamsPricesNewPlanMatrixPriceCadence = "quarterly"
	PlanNewParamsPricesNewPlanMatrixPriceCadenceOneTime   PlanNewParamsPricesNewPlanMatrixPriceCadence = "one_time"
)

func (PlanNewParamsPricesNewPlanMatrixPriceCadence) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanMatrixPriceMatrixConfig added in v0.2.0

type PlanNewParamsPricesNewPlanMatrixPriceMatrixConfig struct {
	// Default per unit rate for any usage not bucketed into a specified matrix_value
	DefaultUnitAmount param.Field[string] `json:"default_unit_amount,required"`
	// One or two event property values to evaluate matrix groups by
	Dimensions param.Field[[]string] `json:"dimensions,required"`
	// Matrix values for specified matrix grouping keys
	MatrixValues param.Field[[]PlanNewParamsPricesNewPlanMatrixPriceMatrixConfigMatrixValue] `json:"matrix_values,required"`
}

func (PlanNewParamsPricesNewPlanMatrixPriceMatrixConfig) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanMatrixPriceMatrixConfig) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanMatrixPriceMatrixConfigMatrixValue added in v0.2.0

type PlanNewParamsPricesNewPlanMatrixPriceMatrixConfigMatrixValue struct {
	// One or two matrix keys to filter usage to this Matrix value by. For example,
	// ["region", "tier"] could be used to filter cloud usage by a cloud region and an
	// instance tier.
	DimensionValues param.Field[[]string] `json:"dimension_values,required"`
	// Unit price for the specified dimension_values
	UnitAmount param.Field[string] `json:"unit_amount,required"`
}

func (PlanNewParamsPricesNewPlanMatrixPriceMatrixConfigMatrixValue) MarshalJSON added in v0.2.0

type PlanNewParamsPricesNewPlanMatrixPriceModelType added in v0.2.0

type PlanNewParamsPricesNewPlanMatrixPriceModelType string
const (
	PlanNewParamsPricesNewPlanMatrixPriceModelTypeMatrix PlanNewParamsPricesNewPlanMatrixPriceModelType = "matrix"
)

func (PlanNewParamsPricesNewPlanMatrixPriceModelType) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanPackagePrice added in v0.2.0

type PlanNewParamsPricesNewPlanPackagePrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PlanNewParamsPricesNewPlanPackagePriceCadence] `json:"cadence,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                          `json:"item_id,required"`
	ModelType param.Field[PlanNewParamsPricesNewPlanPackagePriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name          param.Field[string]                                              `json:"name,required"`
	PackageConfig param.Field[PlanNewParamsPricesNewPlanPackagePricePackageConfig] `json:"package_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PlanNewParamsPricesNewPlanPackagePrice) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanPackagePrice) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanPackagePriceCadence added in v0.2.0

type PlanNewParamsPricesNewPlanPackagePriceCadence string

The cadence to bill for this price on.

const (
	PlanNewParamsPricesNewPlanPackagePriceCadenceAnnual    PlanNewParamsPricesNewPlanPackagePriceCadence = "annual"
	PlanNewParamsPricesNewPlanPackagePriceCadenceMonthly   PlanNewParamsPricesNewPlanPackagePriceCadence = "monthly"
	PlanNewParamsPricesNewPlanPackagePriceCadenceQuarterly PlanNewParamsPricesNewPlanPackagePriceCadence = "quarterly"
	PlanNewParamsPricesNewPlanPackagePriceCadenceOneTime   PlanNewParamsPricesNewPlanPackagePriceCadence = "one_time"
)

func (PlanNewParamsPricesNewPlanPackagePriceCadence) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanPackagePriceModelType added in v0.2.0

type PlanNewParamsPricesNewPlanPackagePriceModelType string
const (
	PlanNewParamsPricesNewPlanPackagePriceModelTypePackage PlanNewParamsPricesNewPlanPackagePriceModelType = "package"
)

func (PlanNewParamsPricesNewPlanPackagePriceModelType) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanPackagePricePackageConfig added in v0.2.0

type PlanNewParamsPricesNewPlanPackagePricePackageConfig struct {
	// A currency amount to rate usage by
	PackageAmount param.Field[string] `json:"package_amount,required"`
	// An integer amount to represent package size. For example, 1000 here would divide
	// usage by 1000 before multiplying by package_amount in rating
	PackageSize param.Field[int64] `json:"package_size"`
}

func (PlanNewParamsPricesNewPlanPackagePricePackageConfig) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanPackagePricePackageConfig) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanPackageWithAllocationPrice added in v0.2.0

type PlanNewParamsPricesNewPlanPackageWithAllocationPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PlanNewParamsPricesNewPlanPackageWithAllocationPriceCadence] `json:"cadence,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                        `json:"item_id,required"`
	ModelType param.Field[PlanNewParamsPricesNewPlanPackageWithAllocationPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                        param.Field[string]                 `json:"name,required"`
	PackageWithAllocationConfig param.Field[map[string]interface{}] `json:"package_with_allocation_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PlanNewParamsPricesNewPlanPackageWithAllocationPrice) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanPackageWithAllocationPrice) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanPackageWithAllocationPriceCadence added in v0.2.0

type PlanNewParamsPricesNewPlanPackageWithAllocationPriceCadence string

The cadence to bill for this price on.

const (
	PlanNewParamsPricesNewPlanPackageWithAllocationPriceCadenceAnnual    PlanNewParamsPricesNewPlanPackageWithAllocationPriceCadence = "annual"
	PlanNewParamsPricesNewPlanPackageWithAllocationPriceCadenceMonthly   PlanNewParamsPricesNewPlanPackageWithAllocationPriceCadence = "monthly"
	PlanNewParamsPricesNewPlanPackageWithAllocationPriceCadenceQuarterly PlanNewParamsPricesNewPlanPackageWithAllocationPriceCadence = "quarterly"
	PlanNewParamsPricesNewPlanPackageWithAllocationPriceCadenceOneTime   PlanNewParamsPricesNewPlanPackageWithAllocationPriceCadence = "one_time"
)

func (PlanNewParamsPricesNewPlanPackageWithAllocationPriceCadence) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanPackageWithAllocationPriceModelType added in v0.2.0

type PlanNewParamsPricesNewPlanPackageWithAllocationPriceModelType string
const (
	PlanNewParamsPricesNewPlanPackageWithAllocationPriceModelTypePackageWithAllocation PlanNewParamsPricesNewPlanPackageWithAllocationPriceModelType = "package_with_allocation"
)

func (PlanNewParamsPricesNewPlanPackageWithAllocationPriceModelType) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanThresholdTotalAmountPrice added in v0.2.0

type PlanNewParamsPricesNewPlanThresholdTotalAmountPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PlanNewParamsPricesNewPlanThresholdTotalAmountPriceCadence] `json:"cadence,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                       `json:"item_id,required"`
	ModelType param.Field[PlanNewParamsPricesNewPlanThresholdTotalAmountPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                       param.Field[string]                 `json:"name,required"`
	ThresholdTotalAmountConfig param.Field[map[string]interface{}] `json:"threshold_total_amount_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PlanNewParamsPricesNewPlanThresholdTotalAmountPrice) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanThresholdTotalAmountPrice) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanThresholdTotalAmountPriceCadence added in v0.2.0

type PlanNewParamsPricesNewPlanThresholdTotalAmountPriceCadence string

The cadence to bill for this price on.

const (
	PlanNewParamsPricesNewPlanThresholdTotalAmountPriceCadenceAnnual    PlanNewParamsPricesNewPlanThresholdTotalAmountPriceCadence = "annual"
	PlanNewParamsPricesNewPlanThresholdTotalAmountPriceCadenceMonthly   PlanNewParamsPricesNewPlanThresholdTotalAmountPriceCadence = "monthly"
	PlanNewParamsPricesNewPlanThresholdTotalAmountPriceCadenceQuarterly PlanNewParamsPricesNewPlanThresholdTotalAmountPriceCadence = "quarterly"
	PlanNewParamsPricesNewPlanThresholdTotalAmountPriceCadenceOneTime   PlanNewParamsPricesNewPlanThresholdTotalAmountPriceCadence = "one_time"
)

func (PlanNewParamsPricesNewPlanThresholdTotalAmountPriceCadence) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanThresholdTotalAmountPriceModelType added in v0.2.0

type PlanNewParamsPricesNewPlanThresholdTotalAmountPriceModelType string
const (
	PlanNewParamsPricesNewPlanThresholdTotalAmountPriceModelTypeThresholdTotalAmount PlanNewParamsPricesNewPlanThresholdTotalAmountPriceModelType = "threshold_total_amount"
)

func (PlanNewParamsPricesNewPlanThresholdTotalAmountPriceModelType) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanTieredBpsPrice added in v0.2.0

type PlanNewParamsPricesNewPlanTieredBpsPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PlanNewParamsPricesNewPlanTieredBpsPriceCadence] `json:"cadence,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                            `json:"item_id,required"`
	ModelType param.Field[PlanNewParamsPricesNewPlanTieredBpsPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name            param.Field[string]                                                  `json:"name,required"`
	TieredBpsConfig param.Field[PlanNewParamsPricesNewPlanTieredBpsPriceTieredBpsConfig] `json:"tiered_bps_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PlanNewParamsPricesNewPlanTieredBpsPrice) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanTieredBpsPrice) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanTieredBpsPriceCadence added in v0.2.0

type PlanNewParamsPricesNewPlanTieredBpsPriceCadence string

The cadence to bill for this price on.

const (
	PlanNewParamsPricesNewPlanTieredBpsPriceCadenceAnnual    PlanNewParamsPricesNewPlanTieredBpsPriceCadence = "annual"
	PlanNewParamsPricesNewPlanTieredBpsPriceCadenceMonthly   PlanNewParamsPricesNewPlanTieredBpsPriceCadence = "monthly"
	PlanNewParamsPricesNewPlanTieredBpsPriceCadenceQuarterly PlanNewParamsPricesNewPlanTieredBpsPriceCadence = "quarterly"
	PlanNewParamsPricesNewPlanTieredBpsPriceCadenceOneTime   PlanNewParamsPricesNewPlanTieredBpsPriceCadence = "one_time"
)

func (PlanNewParamsPricesNewPlanTieredBpsPriceCadence) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanTieredBpsPriceModelType added in v0.2.0

type PlanNewParamsPricesNewPlanTieredBpsPriceModelType string
const (
	PlanNewParamsPricesNewPlanTieredBpsPriceModelTypeTieredBps PlanNewParamsPricesNewPlanTieredBpsPriceModelType = "tiered_bps"
)

func (PlanNewParamsPricesNewPlanTieredBpsPriceModelType) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanTieredBpsPriceTieredBpsConfig added in v0.2.0

type PlanNewParamsPricesNewPlanTieredBpsPriceTieredBpsConfig struct {
	// Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
	// tiers
	Tiers param.Field[[]PlanNewParamsPricesNewPlanTieredBpsPriceTieredBpsConfigTier] `json:"tiers,required"`
}

func (PlanNewParamsPricesNewPlanTieredBpsPriceTieredBpsConfig) MarshalJSON added in v0.2.0

type PlanNewParamsPricesNewPlanTieredBpsPriceTieredBpsConfigTier added in v0.2.0

type PlanNewParamsPricesNewPlanTieredBpsPriceTieredBpsConfigTier struct {
	// Per-event basis point rate
	Bps param.Field[float64] `json:"bps,required"`
	// Inclusive tier starting value
	MinimumAmount param.Field[string] `json:"minimum_amount,required"`
	// Exclusive tier ending value
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// Per unit maximum to charge
	PerUnitMaximum param.Field[string] `json:"per_unit_maximum"`
}

func (PlanNewParamsPricesNewPlanTieredBpsPriceTieredBpsConfigTier) MarshalJSON added in v0.2.0

type PlanNewParamsPricesNewPlanTieredPackagePrice added in v0.2.0

type PlanNewParamsPricesNewPlanTieredPackagePrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PlanNewParamsPricesNewPlanTieredPackagePriceCadence] `json:"cadence,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                `json:"item_id,required"`
	ModelType param.Field[PlanNewParamsPricesNewPlanTieredPackagePriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                param.Field[string]                 `json:"name,required"`
	TieredPackageConfig param.Field[map[string]interface{}] `json:"tiered_package_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PlanNewParamsPricesNewPlanTieredPackagePrice) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanTieredPackagePrice) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanTieredPackagePriceCadence added in v0.2.0

type PlanNewParamsPricesNewPlanTieredPackagePriceCadence string

The cadence to bill for this price on.

const (
	PlanNewParamsPricesNewPlanTieredPackagePriceCadenceAnnual    PlanNewParamsPricesNewPlanTieredPackagePriceCadence = "annual"
	PlanNewParamsPricesNewPlanTieredPackagePriceCadenceMonthly   PlanNewParamsPricesNewPlanTieredPackagePriceCadence = "monthly"
	PlanNewParamsPricesNewPlanTieredPackagePriceCadenceQuarterly PlanNewParamsPricesNewPlanTieredPackagePriceCadence = "quarterly"
	PlanNewParamsPricesNewPlanTieredPackagePriceCadenceOneTime   PlanNewParamsPricesNewPlanTieredPackagePriceCadence = "one_time"
)

func (PlanNewParamsPricesNewPlanTieredPackagePriceCadence) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanTieredPackagePriceModelType added in v0.2.0

type PlanNewParamsPricesNewPlanTieredPackagePriceModelType string
const (
	PlanNewParamsPricesNewPlanTieredPackagePriceModelTypeTieredPackage PlanNewParamsPricesNewPlanTieredPackagePriceModelType = "tiered_package"
)

func (PlanNewParamsPricesNewPlanTieredPackagePriceModelType) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanTieredPrice added in v0.2.0

type PlanNewParamsPricesNewPlanTieredPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PlanNewParamsPricesNewPlanTieredPriceCadence] `json:"cadence,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                         `json:"item_id,required"`
	ModelType param.Field[PlanNewParamsPricesNewPlanTieredPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name         param.Field[string]                                            `json:"name,required"`
	TieredConfig param.Field[PlanNewParamsPricesNewPlanTieredPriceTieredConfig] `json:"tiered_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PlanNewParamsPricesNewPlanTieredPrice) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanTieredPrice) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanTieredPriceCadence added in v0.2.0

type PlanNewParamsPricesNewPlanTieredPriceCadence string

The cadence to bill for this price on.

const (
	PlanNewParamsPricesNewPlanTieredPriceCadenceAnnual    PlanNewParamsPricesNewPlanTieredPriceCadence = "annual"
	PlanNewParamsPricesNewPlanTieredPriceCadenceMonthly   PlanNewParamsPricesNewPlanTieredPriceCadence = "monthly"
	PlanNewParamsPricesNewPlanTieredPriceCadenceQuarterly PlanNewParamsPricesNewPlanTieredPriceCadence = "quarterly"
	PlanNewParamsPricesNewPlanTieredPriceCadenceOneTime   PlanNewParamsPricesNewPlanTieredPriceCadence = "one_time"
)

func (PlanNewParamsPricesNewPlanTieredPriceCadence) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanTieredPriceModelType added in v0.2.0

type PlanNewParamsPricesNewPlanTieredPriceModelType string
const (
	PlanNewParamsPricesNewPlanTieredPriceModelTypeTiered PlanNewParamsPricesNewPlanTieredPriceModelType = "tiered"
)

func (PlanNewParamsPricesNewPlanTieredPriceModelType) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanTieredPriceTieredConfig added in v0.2.0

type PlanNewParamsPricesNewPlanTieredPriceTieredConfig struct {
	// Tiers for rating based on total usage quantities into the specified tier
	Tiers param.Field[[]PlanNewParamsPricesNewPlanTieredPriceTieredConfigTier] `json:"tiers,required"`
}

func (PlanNewParamsPricesNewPlanTieredPriceTieredConfig) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanTieredPriceTieredConfig) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanTieredPriceTieredConfigTier added in v0.2.0

type PlanNewParamsPricesNewPlanTieredPriceTieredConfigTier struct {
	// Inclusive tier starting value
	FirstUnit param.Field[float64] `json:"first_unit,required"`
	// Amount per unit
	UnitAmount param.Field[string] `json:"unit_amount,required"`
	// Exclusive tier ending value. If null, this is treated as the last tier
	LastUnit param.Field[float64] `json:"last_unit"`
}

func (PlanNewParamsPricesNewPlanTieredPriceTieredConfigTier) MarshalJSON added in v0.2.0

type PlanNewParamsPricesNewPlanTieredWithMinimumPrice added in v0.2.0

type PlanNewParamsPricesNewPlanTieredWithMinimumPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PlanNewParamsPricesNewPlanTieredWithMinimumPriceCadence] `json:"cadence,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                    `json:"item_id,required"`
	ModelType param.Field[PlanNewParamsPricesNewPlanTieredWithMinimumPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                    param.Field[string]                 `json:"name,required"`
	TieredWithMinimumConfig param.Field[map[string]interface{}] `json:"tiered_with_minimum_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PlanNewParamsPricesNewPlanTieredWithMinimumPrice) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanTieredWithMinimumPrice) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanTieredWithMinimumPriceCadence added in v0.2.0

type PlanNewParamsPricesNewPlanTieredWithMinimumPriceCadence string

The cadence to bill for this price on.

const (
	PlanNewParamsPricesNewPlanTieredWithMinimumPriceCadenceAnnual    PlanNewParamsPricesNewPlanTieredWithMinimumPriceCadence = "annual"
	PlanNewParamsPricesNewPlanTieredWithMinimumPriceCadenceMonthly   PlanNewParamsPricesNewPlanTieredWithMinimumPriceCadence = "monthly"
	PlanNewParamsPricesNewPlanTieredWithMinimumPriceCadenceQuarterly PlanNewParamsPricesNewPlanTieredWithMinimumPriceCadence = "quarterly"
	PlanNewParamsPricesNewPlanTieredWithMinimumPriceCadenceOneTime   PlanNewParamsPricesNewPlanTieredWithMinimumPriceCadence = "one_time"
)

func (PlanNewParamsPricesNewPlanTieredWithMinimumPriceCadence) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanTieredWithMinimumPriceModelType added in v0.2.0

type PlanNewParamsPricesNewPlanTieredWithMinimumPriceModelType string
const (
	PlanNewParamsPricesNewPlanTieredWithMinimumPriceModelTypeTieredWithMinimum PlanNewParamsPricesNewPlanTieredWithMinimumPriceModelType = "tiered_with_minimum"
)

func (PlanNewParamsPricesNewPlanTieredWithMinimumPriceModelType) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanUnitPrice added in v0.2.0

type PlanNewParamsPricesNewPlanUnitPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PlanNewParamsPricesNewPlanUnitPriceCadence] `json:"cadence,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                       `json:"item_id,required"`
	ModelType param.Field[PlanNewParamsPricesNewPlanUnitPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name       param.Field[string]                                        `json:"name,required"`
	UnitConfig param.Field[PlanNewParamsPricesNewPlanUnitPriceUnitConfig] `json:"unit_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PlanNewParamsPricesNewPlanUnitPrice) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanUnitPrice) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanUnitPriceCadence added in v0.2.0

type PlanNewParamsPricesNewPlanUnitPriceCadence string

The cadence to bill for this price on.

const (
	PlanNewParamsPricesNewPlanUnitPriceCadenceAnnual    PlanNewParamsPricesNewPlanUnitPriceCadence = "annual"
	PlanNewParamsPricesNewPlanUnitPriceCadenceMonthly   PlanNewParamsPricesNewPlanUnitPriceCadence = "monthly"
	PlanNewParamsPricesNewPlanUnitPriceCadenceQuarterly PlanNewParamsPricesNewPlanUnitPriceCadence = "quarterly"
	PlanNewParamsPricesNewPlanUnitPriceCadenceOneTime   PlanNewParamsPricesNewPlanUnitPriceCadence = "one_time"
)

func (PlanNewParamsPricesNewPlanUnitPriceCadence) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanUnitPriceModelType added in v0.2.0

type PlanNewParamsPricesNewPlanUnitPriceModelType string
const (
	PlanNewParamsPricesNewPlanUnitPriceModelTypeUnit PlanNewParamsPricesNewPlanUnitPriceModelType = "unit"
)

func (PlanNewParamsPricesNewPlanUnitPriceModelType) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanUnitPriceUnitConfig added in v0.2.0

type PlanNewParamsPricesNewPlanUnitPriceUnitConfig struct {
	// Rate per unit of usage
	UnitAmount param.Field[string] `json:"unit_amount,required"`
}

func (PlanNewParamsPricesNewPlanUnitPriceUnitConfig) MarshalJSON added in v0.2.0

func (r PlanNewParamsPricesNewPlanUnitPriceUnitConfig) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanUnitWithPercentPrice added in v0.20.0

type PlanNewParamsPricesNewPlanUnitWithPercentPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PlanNewParamsPricesNewPlanUnitWithPercentPriceCadence] `json:"cadence,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                  `json:"item_id,required"`
	ModelType param.Field[PlanNewParamsPricesNewPlanUnitWithPercentPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                  param.Field[string]                 `json:"name,required"`
	UnitWithPercentConfig param.Field[map[string]interface{}] `json:"unit_with_percent_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PlanNewParamsPricesNewPlanUnitWithPercentPrice) MarshalJSON added in v0.20.0

func (r PlanNewParamsPricesNewPlanUnitWithPercentPrice) MarshalJSON() (data []byte, err error)

type PlanNewParamsPricesNewPlanUnitWithPercentPriceCadence added in v0.20.0

type PlanNewParamsPricesNewPlanUnitWithPercentPriceCadence string

The cadence to bill for this price on.

const (
	PlanNewParamsPricesNewPlanUnitWithPercentPriceCadenceAnnual    PlanNewParamsPricesNewPlanUnitWithPercentPriceCadence = "annual"
	PlanNewParamsPricesNewPlanUnitWithPercentPriceCadenceMonthly   PlanNewParamsPricesNewPlanUnitWithPercentPriceCadence = "monthly"
	PlanNewParamsPricesNewPlanUnitWithPercentPriceCadenceQuarterly PlanNewParamsPricesNewPlanUnitWithPercentPriceCadence = "quarterly"
	PlanNewParamsPricesNewPlanUnitWithPercentPriceCadenceOneTime   PlanNewParamsPricesNewPlanUnitWithPercentPriceCadence = "one_time"
)

func (PlanNewParamsPricesNewPlanUnitWithPercentPriceCadence) IsKnown added in v0.24.0

type PlanNewParamsPricesNewPlanUnitWithPercentPriceModelType added in v0.20.0

type PlanNewParamsPricesNewPlanUnitWithPercentPriceModelType string
const (
	PlanNewParamsPricesNewPlanUnitWithPercentPriceModelTypeUnitWithPercent PlanNewParamsPricesNewPlanUnitWithPercentPriceModelType = "unit_with_percent"
)

func (PlanNewParamsPricesNewPlanUnitWithPercentPriceModelType) IsKnown added in v0.24.0

type PlanPlanPhase

type PlanPlanPhase struct {
	ID          string          `json:"id,required"`
	Description string          `json:"description,required,nullable"`
	Discount    shared.Discount `json:"discount,required,nullable"`
	// How many terms of length `duration_unit` this phase is active for. If null, this
	// phase is evergreen and active indefinitely
	Duration      int64                      `json:"duration,required,nullable"`
	DurationUnit  PlanPlanPhasesDurationUnit `json:"duration_unit,required,nullable"`
	Maximum       PlanPlanPhasesMaximum      `json:"maximum,required,nullable"`
	MaximumAmount string                     `json:"maximum_amount,required,nullable"`
	Minimum       PlanPlanPhasesMinimum      `json:"minimum,required,nullable"`
	MinimumAmount string                     `json:"minimum_amount,required,nullable"`
	Name          string                     `json:"name,required"`
	// Determines the ordering of the phase in a plan's lifecycle. 1 = first phase.
	Order int64             `json:"order,required"`
	JSON  planPlanPhaseJSON `json:"-"`
}

func (*PlanPlanPhase) UnmarshalJSON

func (r *PlanPlanPhase) UnmarshalJSON(data []byte) (err error)

type PlanPlanPhasesDurationUnit

type PlanPlanPhasesDurationUnit string
const (
	PlanPlanPhasesDurationUnitDaily     PlanPlanPhasesDurationUnit = "daily"
	PlanPlanPhasesDurationUnitMonthly   PlanPlanPhasesDurationUnit = "monthly"
	PlanPlanPhasesDurationUnitQuarterly PlanPlanPhasesDurationUnit = "quarterly"
	PlanPlanPhasesDurationUnitAnnual    PlanPlanPhasesDurationUnit = "annual"
)

func (PlanPlanPhasesDurationUnit) IsKnown added in v0.24.0

func (r PlanPlanPhasesDurationUnit) IsKnown() bool

type PlanPlanPhasesMaximum

type PlanPlanPhasesMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                    `json:"maximum_amount,required"`
	JSON          planPlanPhasesMaximumJSON `json:"-"`
}

func (*PlanPlanPhasesMaximum) UnmarshalJSON

func (r *PlanPlanPhasesMaximum) UnmarshalJSON(data []byte) (err error)

type PlanPlanPhasesMinimum

type PlanPlanPhasesMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                    `json:"minimum_amount,required"`
	JSON          planPlanPhasesMinimumJSON `json:"-"`
}

func (*PlanPlanPhasesMinimum) UnmarshalJSON

func (r *PlanPlanPhasesMinimum) UnmarshalJSON(data []byte) (err error)

type PlanProduct

type PlanProduct struct {
	ID        string          `json:"id,required"`
	CreatedAt time.Time       `json:"created_at,required" format:"date-time"`
	Name      string          `json:"name,required"`
	JSON      planProductJSON `json:"-"`
}

func (*PlanProduct) UnmarshalJSON

func (r *PlanProduct) UnmarshalJSON(data []byte) (err error)

type PlanService

type PlanService struct {
	Options        []option.RequestOption
	ExternalPlanID *PlanExternalPlanIDService
}

PlanService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPlanService method instead.

func NewPlanService

func NewPlanService(opts ...option.RequestOption) (r *PlanService)

NewPlanService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PlanService) Fetch

func (r *PlanService) Fetch(ctx context.Context, planID string, opts ...option.RequestOption) (res *Plan, err error)

This endpoint is used to fetch [plan](../guides/concepts##plan-and-price) details given a plan identifier. It returns information about the prices included in the plan and their configuration, as well as the product that the plan is attached to.

## Serialized prices

Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a given Price(../guides/concepts#plan-and-price) object. The `model_type` field determines the key for the configuration object that is present. A detailed explanation of price types can be found in the [Price schema](../guides/concepts#plan-and-price).

## Phases

Orb supports plan phases, also known as contract ramps. For plans with phases, the serialized prices refer to all prices across all phases.

func (*PlanService) List

func (r *PlanService) List(ctx context.Context, query PlanListParams, opts ...option.RequestOption) (res *shared.Page[Plan], err error)

This endpoint returns a list of all [plans](../guides/concepts##plan-and-price) for an account in a list format. The list of plans is ordered starting from the most recently created plan. The response also includes [`pagination_metadata`](../reference/pagination), which lets the caller retrieve the next page of results if they exist.

func (*PlanService) ListAutoPaging

func (r *PlanService) ListAutoPaging(ctx context.Context, query PlanListParams, opts ...option.RequestOption) *shared.PageAutoPager[Plan]

This endpoint returns a list of all [plans](../guides/concepts##plan-and-price) for an account in a list format. The list of plans is ordered starting from the most recently created plan. The response also includes [`pagination_metadata`](../reference/pagination), which lets the caller retrieve the next page of results if they exist.

func (*PlanService) New

func (r *PlanService) New(ctx context.Context, body PlanNewParams, opts ...option.RequestOption) (res *Plan, err error)

This endpoint allows creation of plans including their prices.

func (*PlanService) Update

func (r *PlanService) Update(ctx context.Context, planID string, body PlanUpdateParams, opts ...option.RequestOption) (res *Plan, err error)

This endpoint can be used to update the `external_plan_id`, and `metadata` of an existing plan.

Other fields on a customer are currently immutable.

type PlanStatus

type PlanStatus string
const (
	PlanStatusActive   PlanStatus = "active"
	PlanStatusArchived PlanStatus = "archived"
	PlanStatusDraft    PlanStatus = "draft"
)

func (PlanStatus) IsKnown added in v0.24.0

func (r PlanStatus) IsKnown() bool

type PlanTrialConfig

type PlanTrialConfig struct {
	TrialPeriod     int64                          `json:"trial_period,required,nullable"`
	TrialPeriodUnit PlanTrialConfigTrialPeriodUnit `json:"trial_period_unit,required"`
	JSON            planTrialConfigJSON            `json:"-"`
}

func (*PlanTrialConfig) UnmarshalJSON

func (r *PlanTrialConfig) UnmarshalJSON(data []byte) (err error)

type PlanTrialConfigTrialPeriodUnit

type PlanTrialConfigTrialPeriodUnit string
const (
	PlanTrialConfigTrialPeriodUnitDays PlanTrialConfigTrialPeriodUnit = "days"
)

func (PlanTrialConfigTrialPeriodUnit) IsKnown added in v0.24.0

type PlanUpdateParams

type PlanUpdateParams struct {
	// An optional user-defined ID for this plan resource, used throughout the system
	// as an alias for this Plan. Use this field to identify a plan by an existing
	// identifier in your system.
	ExternalPlanID param.Field[string] `json:"external_plan_id"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata param.Field[map[string]string] `json:"metadata"`
}

func (PlanUpdateParams) MarshalJSON

func (r PlanUpdateParams) MarshalJSON() (data []byte, err error)

type Price

type Price interface {
	// contains filtered or unexported methods
}

The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in the form of an invoice line item. Prices take a quantity and determine an amount to bill.

Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a given Price object. The model_type field determines the key for the configuration object that is present.

## Unit pricing

With unit pricing, each unit costs a fixed amount.

```json

{
    ...
    "model_type": "unit",
    "unit_config": {
        "unit_amount": "0.50"
    }
    ...
}

```

## Tiered pricing

In tiered pricing, the cost of a given unit depends on the tier range that it falls into, where each tier range is defined by an upper and lower bound. For example, the first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.

```json

{
    ...
    "model_type": "tiered",
    "tiered_config": {
        "tiers": [
            {
                "first_unit": 1,
                "last_unit": 10,
                "unit_amount": "0.50"
            },
            {
                "first_unit": 11,
                "last_unit": null,
                "unit_amount": "0.10"
            }
        ]
    }
    ...

```

## Bulk pricing

Bulk pricing applies when the number of units determine the cost of all units. For example, if you've bought less than 10 units, they may each be $0.50 for a total of $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e. 101 units total would be $40.40).

```json

{
    ...
    "model_type": "bulk",
    "bulk_config": {
        "tiers": [
            {
                "maximum_units": 10,
                "unit_amount": "0.50"
            },
            {
                "maximum_units": 1000,
                "unit_amount": "0.40"
            }
        ]
    }
    ...
}

```

## Package pricing

Package pricing defines the size or granularity of a unit for billing purposes. For example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units will be billed at 10.

```json

{
    ...
    "model_type": "package",
    "package_config": {
        "package_amount": "0.80",
        "package_size": 10
    }
    ...
}

```

## BPS pricing

BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent (the number of basis points to charge), as well as a cap per event to assess. For example, this would allow you to assess a fee of 0.25% on every payment you process, with a maximum charge of $25 per payment.

```json

{
    ...
    "model_type": "bps",
    "bps_config": {
       "bps": 125,
       "per_unit_maximum": "11.00"
    }
    ...
 }

```

## Bulk BPS pricing

Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total quantity across all events. Similar to bulk pricing, the BPS parameters of a given event depends on the tier range that the billing period falls into. Each tier range is defined by an upper bound. For example, after $1.5M of payment volume is reached, each individual payment may have a lower cap or a smaller take-rate.

```json

    ...
    "model_type": "bulk_bps",
    "bulk_bps_config": {
        "tiers": [
           {
                "maximum_amount": "1000000.00",
                "bps": 125,
                "per_unit_maximum": "19.00"
           },
          {
                "maximum_amount": null,
                "bps": 115,
                "per_unit_maximum": "4.00"
            }
        ]
    }
    ...
}

```

## Tiered BPS pricing

Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's applicable parameter is a function of its marginal addition to the period total. Similar to tiered pricing, the BPS parameters of a given event depends on the tier range that it falls into, where each tier range is defined by an upper and lower bound. For example, the first few payments may have a 0.8 BPS take-rate and all payments after a specific volume may incur a take-rate of 0.5 BPS each.

```json

    ...
    "model_type": "tiered_bps",
    "tiered_bps_config": {
        "tiers": [
           {
                "minimum_amount": "0",
                "maximum_amount": "1000000.00",
                "bps": 125,
                "per_unit_maximum": "19.00"
           },
          {
                "minimum_amount": "1000000.00",
                "maximum_amount": null,
                "bps": 115,
                "per_unit_maximum": "4.00"
            }
        ]
    }
    ...
}

```

## Matrix pricing

Matrix pricing defines a set of unit prices in a one or two-dimensional matrix. `dimensions` defines the two event property values evaluated in this pricing model. In a one-dimensional matrix, the second value is `null`. Every configuration has a list of `matrix_values` which give the unit prices for specified property values. In a one-dimensional matrix, the matrix values will have `dimension_values` where the second value of the pair is null. If an event does not match any of the dimension values in the matrix, it will resort to the `default_unit_amount`.

```json

{
    "model_type": "matrix"
    "matrix_config": {
        "default_unit_amount": "3.00",
        "dimensions": [
            "cluster_name",
            "region"
        ],
        "matrix_values": [
            {
                "dimension_values": [
                    "alpha",
                    "west"
                ],
                "unit_amount": "2.00"
            },
            ...
        ]
    }
}

```

## Fixed fees

Fixed fees are prices that are applied independent of usage quantities, and follow unit pricing. They also have an additional parameter `fixed_price_quantity`. If the Price represents a fixed cost, this represents the quantity of units applied.

```json

{
    ...
    "id": "price_id",
    "model_type": "unit",
    "unit_config": {
       "unit_amount": "2.00"
    },
    "fixed_price_quantity": 3.0
    ...
}

```

Union satisfied by PriceUnitPrice, PricePackagePrice, PriceMatrixPrice, PriceTieredPrice, PriceTieredBpsPrice, PriceBpsPrice, PriceBulkBpsPrice, PriceBulkPrice, PriceThresholdTotalAmountPrice, PriceTieredPackagePrice, PriceTieredWithMinimumPrice, PricePackageWithAllocationPrice, PriceUnitWithPercentPrice or PriceMatrixWithAllocationPrice.

type PriceBpsPrice

type PriceBpsPrice struct {
	ID                 string                      `json:"id,required"`
	BillableMetric     PriceBpsPriceBillableMetric `json:"billable_metric,required,nullable"`
	BpsConfig          PriceBpsPriceBpsConfig      `json:"bps_config,required"`
	Cadence            PriceBpsPriceCadence        `json:"cadence,required"`
	CreatedAt          time.Time                   `json:"created_at,required" format:"date-time"`
	Currency           string                      `json:"currency,required"`
	Discount           shared.Discount             `json:"discount,required,nullable"`
	ExternalPriceID    string                      `json:"external_price_id,required,nullable"`
	FixedPriceQuantity float64                     `json:"fixed_price_quantity,required,nullable"`
	Item               PriceBpsPriceItem           `json:"item,required"`
	Maximum            PriceBpsPriceMaximum        `json:"maximum,required,nullable"`
	MaximumAmount      string                      `json:"maximum_amount,required,nullable"`
	Minimum            PriceBpsPriceMinimum        `json:"minimum,required,nullable"`
	MinimumAmount      string                      `json:"minimum_amount,required,nullable"`
	ModelType          PriceBpsPriceModelType      `json:"model_type,required"`
	Name               string                      `json:"name,required"`
	PlanPhaseOrder     int64                       `json:"plan_phase_order,required,nullable"`
	PriceType          PriceBpsPricePriceType      `json:"price_type,required"`
	JSON               priceBpsPriceJSON           `json:"-"`
}

func (*PriceBpsPrice) UnmarshalJSON

func (r *PriceBpsPrice) UnmarshalJSON(data []byte) (err error)

type PriceBpsPriceBillableMetric

type PriceBpsPriceBillableMetric struct {
	ID   string                          `json:"id,required"`
	JSON priceBpsPriceBillableMetricJSON `json:"-"`
}

func (*PriceBpsPriceBillableMetric) UnmarshalJSON

func (r *PriceBpsPriceBillableMetric) UnmarshalJSON(data []byte) (err error)

type PriceBpsPriceBpsConfig

type PriceBpsPriceBpsConfig struct {
	// Basis point take rate per event
	Bps float64 `json:"bps,required"`
	// Optional currency amount maximum to cap spend per event
	PerUnitMaximum string                     `json:"per_unit_maximum,nullable"`
	JSON           priceBpsPriceBpsConfigJSON `json:"-"`
}

func (*PriceBpsPriceBpsConfig) UnmarshalJSON

func (r *PriceBpsPriceBpsConfig) UnmarshalJSON(data []byte) (err error)

type PriceBpsPriceCadence

type PriceBpsPriceCadence string
const (
	PriceBpsPriceCadenceOneTime   PriceBpsPriceCadence = "one_time"
	PriceBpsPriceCadenceMonthly   PriceBpsPriceCadence = "monthly"
	PriceBpsPriceCadenceQuarterly PriceBpsPriceCadence = "quarterly"
	PriceBpsPriceCadenceAnnual    PriceBpsPriceCadence = "annual"
)

func (PriceBpsPriceCadence) IsKnown added in v0.24.0

func (r PriceBpsPriceCadence) IsKnown() bool

type PriceBpsPriceItem

type PriceBpsPriceItem struct {
	ID   string                `json:"id,required"`
	Name string                `json:"name,required"`
	JSON priceBpsPriceItemJSON `json:"-"`
}

func (*PriceBpsPriceItem) UnmarshalJSON

func (r *PriceBpsPriceItem) UnmarshalJSON(data []byte) (err error)

type PriceBpsPriceMaximum

type PriceBpsPriceMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                   `json:"maximum_amount,required"`
	JSON          priceBpsPriceMaximumJSON `json:"-"`
}

func (*PriceBpsPriceMaximum) UnmarshalJSON

func (r *PriceBpsPriceMaximum) UnmarshalJSON(data []byte) (err error)

type PriceBpsPriceMinimum

type PriceBpsPriceMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                   `json:"minimum_amount,required"`
	JSON          priceBpsPriceMinimumJSON `json:"-"`
}

func (*PriceBpsPriceMinimum) UnmarshalJSON

func (r *PriceBpsPriceMinimum) UnmarshalJSON(data []byte) (err error)

type PriceBpsPriceModelType

type PriceBpsPriceModelType string
const (
	PriceBpsPriceModelTypeBps PriceBpsPriceModelType = "bps"
)

func (PriceBpsPriceModelType) IsKnown added in v0.24.0

func (r PriceBpsPriceModelType) IsKnown() bool

type PriceBpsPricePriceType

type PriceBpsPricePriceType string
const (
	PriceBpsPricePriceTypeUsagePrice PriceBpsPricePriceType = "usage_price"
	PriceBpsPricePriceTypeFixedPrice PriceBpsPricePriceType = "fixed_price"
)

func (PriceBpsPricePriceType) IsKnown added in v0.24.0

func (r PriceBpsPricePriceType) IsKnown() bool

type PriceBulkBpsPrice

type PriceBulkBpsPrice struct {
	ID                 string                          `json:"id,required"`
	BillableMetric     PriceBulkBpsPriceBillableMetric `json:"billable_metric,required,nullable"`
	BulkBpsConfig      PriceBulkBpsPriceBulkBpsConfig  `json:"bulk_bps_config,required"`
	Cadence            PriceBulkBpsPriceCadence        `json:"cadence,required"`
	CreatedAt          time.Time                       `json:"created_at,required" format:"date-time"`
	Currency           string                          `json:"currency,required"`
	Discount           shared.Discount                 `json:"discount,required,nullable"`
	ExternalPriceID    string                          `json:"external_price_id,required,nullable"`
	FixedPriceQuantity float64                         `json:"fixed_price_quantity,required,nullable"`
	Item               PriceBulkBpsPriceItem           `json:"item,required"`
	Maximum            PriceBulkBpsPriceMaximum        `json:"maximum,required,nullable"`
	MaximumAmount      string                          `json:"maximum_amount,required,nullable"`
	Minimum            PriceBulkBpsPriceMinimum        `json:"minimum,required,nullable"`
	MinimumAmount      string                          `json:"minimum_amount,required,nullable"`
	ModelType          PriceBulkBpsPriceModelType      `json:"model_type,required"`
	Name               string                          `json:"name,required"`
	PlanPhaseOrder     int64                           `json:"plan_phase_order,required,nullable"`
	PriceType          PriceBulkBpsPricePriceType      `json:"price_type,required"`
	JSON               priceBulkBpsPriceJSON           `json:"-"`
}

func (*PriceBulkBpsPrice) UnmarshalJSON

func (r *PriceBulkBpsPrice) UnmarshalJSON(data []byte) (err error)

type PriceBulkBpsPriceBillableMetric

type PriceBulkBpsPriceBillableMetric struct {
	ID   string                              `json:"id,required"`
	JSON priceBulkBpsPriceBillableMetricJSON `json:"-"`
}

func (*PriceBulkBpsPriceBillableMetric) UnmarshalJSON

func (r *PriceBulkBpsPriceBillableMetric) UnmarshalJSON(data []byte) (err error)

type PriceBulkBpsPriceBulkBpsConfig

type PriceBulkBpsPriceBulkBpsConfig struct {
	// Tiers for a bulk BPS pricing model where all usage is aggregated to a single
	// tier based on total volume
	Tiers []PriceBulkBpsPriceBulkBpsConfigTier `json:"tiers,required"`
	JSON  priceBulkBpsPriceBulkBpsConfigJSON   `json:"-"`
}

func (*PriceBulkBpsPriceBulkBpsConfig) UnmarshalJSON

func (r *PriceBulkBpsPriceBulkBpsConfig) UnmarshalJSON(data []byte) (err error)

type PriceBulkBpsPriceBulkBpsConfigTier

type PriceBulkBpsPriceBulkBpsConfigTier struct {
	// Basis points to rate on
	Bps float64 `json:"bps,required"`
	// Upper bound for tier
	MaximumAmount string `json:"maximum_amount,nullable"`
	// The maximum amount to charge for any one event
	PerUnitMaximum string                                 `json:"per_unit_maximum,nullable"`
	JSON           priceBulkBpsPriceBulkBpsConfigTierJSON `json:"-"`
}

func (*PriceBulkBpsPriceBulkBpsConfigTier) UnmarshalJSON

func (r *PriceBulkBpsPriceBulkBpsConfigTier) UnmarshalJSON(data []byte) (err error)

type PriceBulkBpsPriceCadence

type PriceBulkBpsPriceCadence string
const (
	PriceBulkBpsPriceCadenceOneTime   PriceBulkBpsPriceCadence = "one_time"
	PriceBulkBpsPriceCadenceMonthly   PriceBulkBpsPriceCadence = "monthly"
	PriceBulkBpsPriceCadenceQuarterly PriceBulkBpsPriceCadence = "quarterly"
	PriceBulkBpsPriceCadenceAnnual    PriceBulkBpsPriceCadence = "annual"
)

func (PriceBulkBpsPriceCadence) IsKnown added in v0.24.0

func (r PriceBulkBpsPriceCadence) IsKnown() bool

type PriceBulkBpsPriceItem

type PriceBulkBpsPriceItem struct {
	ID   string                    `json:"id,required"`
	Name string                    `json:"name,required"`
	JSON priceBulkBpsPriceItemJSON `json:"-"`
}

func (*PriceBulkBpsPriceItem) UnmarshalJSON

func (r *PriceBulkBpsPriceItem) UnmarshalJSON(data []byte) (err error)

type PriceBulkBpsPriceMaximum

type PriceBulkBpsPriceMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                       `json:"maximum_amount,required"`
	JSON          priceBulkBpsPriceMaximumJSON `json:"-"`
}

func (*PriceBulkBpsPriceMaximum) UnmarshalJSON

func (r *PriceBulkBpsPriceMaximum) UnmarshalJSON(data []byte) (err error)

type PriceBulkBpsPriceMinimum

type PriceBulkBpsPriceMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                       `json:"minimum_amount,required"`
	JSON          priceBulkBpsPriceMinimumJSON `json:"-"`
}

func (*PriceBulkBpsPriceMinimum) UnmarshalJSON

func (r *PriceBulkBpsPriceMinimum) UnmarshalJSON(data []byte) (err error)

type PriceBulkBpsPriceModelType

type PriceBulkBpsPriceModelType string
const (
	PriceBulkBpsPriceModelTypeBulkBps PriceBulkBpsPriceModelType = "bulk_bps"
)

func (PriceBulkBpsPriceModelType) IsKnown added in v0.24.0

func (r PriceBulkBpsPriceModelType) IsKnown() bool

type PriceBulkBpsPricePriceType

type PriceBulkBpsPricePriceType string
const (
	PriceBulkBpsPricePriceTypeUsagePrice PriceBulkBpsPricePriceType = "usage_price"
	PriceBulkBpsPricePriceTypeFixedPrice PriceBulkBpsPricePriceType = "fixed_price"
)

func (PriceBulkBpsPricePriceType) IsKnown added in v0.24.0

func (r PriceBulkBpsPricePriceType) IsKnown() bool

type PriceBulkPrice

type PriceBulkPrice struct {
	ID                 string                       `json:"id,required"`
	BillableMetric     PriceBulkPriceBillableMetric `json:"billable_metric,required,nullable"`
	BulkConfig         PriceBulkPriceBulkConfig     `json:"bulk_config,required"`
	Cadence            PriceBulkPriceCadence        `json:"cadence,required"`
	CreatedAt          time.Time                    `json:"created_at,required" format:"date-time"`
	Currency           string                       `json:"currency,required"`
	Discount           shared.Discount              `json:"discount,required,nullable"`
	ExternalPriceID    string                       `json:"external_price_id,required,nullable"`
	FixedPriceQuantity float64                      `json:"fixed_price_quantity,required,nullable"`
	Item               PriceBulkPriceItem           `json:"item,required"`
	Maximum            PriceBulkPriceMaximum        `json:"maximum,required,nullable"`
	MaximumAmount      string                       `json:"maximum_amount,required,nullable"`
	Minimum            PriceBulkPriceMinimum        `json:"minimum,required,nullable"`
	MinimumAmount      string                       `json:"minimum_amount,required,nullable"`
	ModelType          PriceBulkPriceModelType      `json:"model_type,required"`
	Name               string                       `json:"name,required"`
	PlanPhaseOrder     int64                        `json:"plan_phase_order,required,nullable"`
	PriceType          PriceBulkPricePriceType      `json:"price_type,required"`
	JSON               priceBulkPriceJSON           `json:"-"`
}

func (*PriceBulkPrice) UnmarshalJSON

func (r *PriceBulkPrice) UnmarshalJSON(data []byte) (err error)

type PriceBulkPriceBillableMetric

type PriceBulkPriceBillableMetric struct {
	ID   string                           `json:"id,required"`
	JSON priceBulkPriceBillableMetricJSON `json:"-"`
}

func (*PriceBulkPriceBillableMetric) UnmarshalJSON

func (r *PriceBulkPriceBillableMetric) UnmarshalJSON(data []byte) (err error)

type PriceBulkPriceBulkConfig

type PriceBulkPriceBulkConfig struct {
	// Bulk tiers for rating based on total usage volume
	Tiers []PriceBulkPriceBulkConfigTier `json:"tiers,required"`
	JSON  priceBulkPriceBulkConfigJSON   `json:"-"`
}

func (*PriceBulkPriceBulkConfig) UnmarshalJSON

func (r *PriceBulkPriceBulkConfig) UnmarshalJSON(data []byte) (err error)

type PriceBulkPriceBulkConfigTier

type PriceBulkPriceBulkConfigTier struct {
	// Amount per unit
	UnitAmount string `json:"unit_amount,required"`
	// Upper bound for this tier
	MaximumUnits float64                          `json:"maximum_units,nullable"`
	JSON         priceBulkPriceBulkConfigTierJSON `json:"-"`
}

func (*PriceBulkPriceBulkConfigTier) UnmarshalJSON

func (r *PriceBulkPriceBulkConfigTier) UnmarshalJSON(data []byte) (err error)

type PriceBulkPriceCadence

type PriceBulkPriceCadence string
const (
	PriceBulkPriceCadenceOneTime   PriceBulkPriceCadence = "one_time"
	PriceBulkPriceCadenceMonthly   PriceBulkPriceCadence = "monthly"
	PriceBulkPriceCadenceQuarterly PriceBulkPriceCadence = "quarterly"
	PriceBulkPriceCadenceAnnual    PriceBulkPriceCadence = "annual"
)

func (PriceBulkPriceCadence) IsKnown added in v0.24.0

func (r PriceBulkPriceCadence) IsKnown() bool

type PriceBulkPriceItem

type PriceBulkPriceItem struct {
	ID   string                 `json:"id,required"`
	Name string                 `json:"name,required"`
	JSON priceBulkPriceItemJSON `json:"-"`
}

func (*PriceBulkPriceItem) UnmarshalJSON

func (r *PriceBulkPriceItem) UnmarshalJSON(data []byte) (err error)

type PriceBulkPriceMaximum

type PriceBulkPriceMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                    `json:"maximum_amount,required"`
	JSON          priceBulkPriceMaximumJSON `json:"-"`
}

func (*PriceBulkPriceMaximum) UnmarshalJSON

func (r *PriceBulkPriceMaximum) UnmarshalJSON(data []byte) (err error)

type PriceBulkPriceMinimum

type PriceBulkPriceMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                    `json:"minimum_amount,required"`
	JSON          priceBulkPriceMinimumJSON `json:"-"`
}

func (*PriceBulkPriceMinimum) UnmarshalJSON

func (r *PriceBulkPriceMinimum) UnmarshalJSON(data []byte) (err error)

type PriceBulkPriceModelType

type PriceBulkPriceModelType string
const (
	PriceBulkPriceModelTypeBulk PriceBulkPriceModelType = "bulk"
)

func (PriceBulkPriceModelType) IsKnown added in v0.24.0

func (r PriceBulkPriceModelType) IsKnown() bool

type PriceBulkPricePriceType

type PriceBulkPricePriceType string
const (
	PriceBulkPricePriceTypeUsagePrice PriceBulkPricePriceType = "usage_price"
	PriceBulkPricePriceTypeFixedPrice PriceBulkPricePriceType = "fixed_price"
)

func (PriceBulkPricePriceType) IsKnown added in v0.24.0

func (r PriceBulkPricePriceType) IsKnown() bool

type PriceExternalPriceIDService

type PriceExternalPriceIDService struct {
	Options []option.RequestOption
}

PriceExternalPriceIDService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPriceExternalPriceIDService method instead.

func NewPriceExternalPriceIDService

func NewPriceExternalPriceIDService(opts ...option.RequestOption) (r *PriceExternalPriceIDService)

NewPriceExternalPriceIDService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PriceExternalPriceIDService) Fetch

func (r *PriceExternalPriceIDService) Fetch(ctx context.Context, externalPriceID string, opts ...option.RequestOption) (res *Price, err error)

This endpoint returns a price given an external price id. See the [price creation API](../reference/create-price) for more information about external price aliases.

type PriceListParams

type PriceListParams struct {
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor param.Field[string] `query:"cursor"`
	// The number of items to fetch. Defaults to 20.
	Limit param.Field[int64] `query:"limit"`
}

func (PriceListParams) URLQuery

func (r PriceListParams) URLQuery() (v url.Values)

URLQuery serializes PriceListParams's query parameters as `url.Values`.

type PriceMatrixPrice

type PriceMatrixPrice struct {
	ID                 string                         `json:"id,required"`
	BillableMetric     PriceMatrixPriceBillableMetric `json:"billable_metric,required,nullable"`
	Cadence            PriceMatrixPriceCadence        `json:"cadence,required"`
	CreatedAt          time.Time                      `json:"created_at,required" format:"date-time"`
	Currency           string                         `json:"currency,required"`
	Discount           shared.Discount                `json:"discount,required,nullable"`
	ExternalPriceID    string                         `json:"external_price_id,required,nullable"`
	FixedPriceQuantity float64                        `json:"fixed_price_quantity,required,nullable"`
	Item               PriceMatrixPriceItem           `json:"item,required"`
	MatrixConfig       PriceMatrixPriceMatrixConfig   `json:"matrix_config,required"`
	Maximum            PriceMatrixPriceMaximum        `json:"maximum,required,nullable"`
	MaximumAmount      string                         `json:"maximum_amount,required,nullable"`
	Minimum            PriceMatrixPriceMinimum        `json:"minimum,required,nullable"`
	MinimumAmount      string                         `json:"minimum_amount,required,nullable"`
	ModelType          PriceMatrixPriceModelType      `json:"model_type,required"`
	Name               string                         `json:"name,required"`
	PlanPhaseOrder     int64                          `json:"plan_phase_order,required,nullable"`
	PriceType          PriceMatrixPricePriceType      `json:"price_type,required"`
	JSON               priceMatrixPriceJSON           `json:"-"`
}

func (*PriceMatrixPrice) UnmarshalJSON

func (r *PriceMatrixPrice) UnmarshalJSON(data []byte) (err error)

type PriceMatrixPriceBillableMetric

type PriceMatrixPriceBillableMetric struct {
	ID   string                             `json:"id,required"`
	JSON priceMatrixPriceBillableMetricJSON `json:"-"`
}

func (*PriceMatrixPriceBillableMetric) UnmarshalJSON

func (r *PriceMatrixPriceBillableMetric) UnmarshalJSON(data []byte) (err error)

type PriceMatrixPriceCadence

type PriceMatrixPriceCadence string
const (
	PriceMatrixPriceCadenceOneTime   PriceMatrixPriceCadence = "one_time"
	PriceMatrixPriceCadenceMonthly   PriceMatrixPriceCadence = "monthly"
	PriceMatrixPriceCadenceQuarterly PriceMatrixPriceCadence = "quarterly"
	PriceMatrixPriceCadenceAnnual    PriceMatrixPriceCadence = "annual"
)

func (PriceMatrixPriceCadence) IsKnown added in v0.24.0

func (r PriceMatrixPriceCadence) IsKnown() bool

type PriceMatrixPriceItem

type PriceMatrixPriceItem struct {
	ID   string                   `json:"id,required"`
	Name string                   `json:"name,required"`
	JSON priceMatrixPriceItemJSON `json:"-"`
}

func (*PriceMatrixPriceItem) UnmarshalJSON

func (r *PriceMatrixPriceItem) UnmarshalJSON(data []byte) (err error)

type PriceMatrixPriceMatrixConfig

type PriceMatrixPriceMatrixConfig struct {
	// Default per unit rate for any usage not bucketed into a specified matrix_value
	DefaultUnitAmount string `json:"default_unit_amount,required"`
	// One or two event property values to evaluate matrix groups by
	Dimensions []string `json:"dimensions,required"`
	// Matrix values for specified matrix grouping keys
	MatrixValues []PriceMatrixPriceMatrixConfigMatrixValue `json:"matrix_values,required"`
	JSON         priceMatrixPriceMatrixConfigJSON          `json:"-"`
}

func (*PriceMatrixPriceMatrixConfig) UnmarshalJSON

func (r *PriceMatrixPriceMatrixConfig) UnmarshalJSON(data []byte) (err error)

type PriceMatrixPriceMatrixConfigMatrixValue

type PriceMatrixPriceMatrixConfigMatrixValue struct {
	// One or two matrix keys to filter usage to this Matrix value by. For example,
	// ["region", "tier"] could be used to filter cloud usage by a cloud region and an
	// instance tier.
	DimensionValues []string `json:"dimension_values,required"`
	// Unit price for the specified dimension_values
	UnitAmount string                                      `json:"unit_amount,required"`
	JSON       priceMatrixPriceMatrixConfigMatrixValueJSON `json:"-"`
}

func (*PriceMatrixPriceMatrixConfigMatrixValue) UnmarshalJSON

func (r *PriceMatrixPriceMatrixConfigMatrixValue) UnmarshalJSON(data []byte) (err error)

type PriceMatrixPriceMaximum

type PriceMatrixPriceMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                      `json:"maximum_amount,required"`
	JSON          priceMatrixPriceMaximumJSON `json:"-"`
}

func (*PriceMatrixPriceMaximum) UnmarshalJSON

func (r *PriceMatrixPriceMaximum) UnmarshalJSON(data []byte) (err error)

type PriceMatrixPriceMinimum

type PriceMatrixPriceMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                      `json:"minimum_amount,required"`
	JSON          priceMatrixPriceMinimumJSON `json:"-"`
}

func (*PriceMatrixPriceMinimum) UnmarshalJSON

func (r *PriceMatrixPriceMinimum) UnmarshalJSON(data []byte) (err error)

type PriceMatrixPriceModelType

type PriceMatrixPriceModelType string
const (
	PriceMatrixPriceModelTypeMatrix PriceMatrixPriceModelType = "matrix"
)

func (PriceMatrixPriceModelType) IsKnown added in v0.24.0

func (r PriceMatrixPriceModelType) IsKnown() bool

type PriceMatrixPricePriceType

type PriceMatrixPricePriceType string
const (
	PriceMatrixPricePriceTypeUsagePrice PriceMatrixPricePriceType = "usage_price"
	PriceMatrixPricePriceTypeFixedPrice PriceMatrixPricePriceType = "fixed_price"
)

func (PriceMatrixPricePriceType) IsKnown added in v0.24.0

func (r PriceMatrixPricePriceType) IsKnown() bool

type PriceMatrixWithAllocationPrice added in v0.22.0

type PriceMatrixWithAllocationPrice struct {
	ID                         string                                                   `json:"id,required"`
	BillableMetric             PriceMatrixWithAllocationPriceBillableMetric             `json:"billable_metric,required,nullable"`
	Cadence                    PriceMatrixWithAllocationPriceCadence                    `json:"cadence,required"`
	CreatedAt                  time.Time                                                `json:"created_at,required" format:"date-time"`
	Currency                   string                                                   `json:"currency,required"`
	Discount                   shared.Discount                                          `json:"discount,required,nullable"`
	ExternalPriceID            string                                                   `json:"external_price_id,required,nullable"`
	FixedPriceQuantity         float64                                                  `json:"fixed_price_quantity,required,nullable"`
	Item                       PriceMatrixWithAllocationPriceItem                       `json:"item,required"`
	MatrixWithAllocationConfig PriceMatrixWithAllocationPriceMatrixWithAllocationConfig `json:"matrix_with_allocation_config,required"`
	Maximum                    PriceMatrixWithAllocationPriceMaximum                    `json:"maximum,required,nullable"`
	MaximumAmount              string                                                   `json:"maximum_amount,required,nullable"`
	Minimum                    PriceMatrixWithAllocationPriceMinimum                    `json:"minimum,required,nullable"`
	MinimumAmount              string                                                   `json:"minimum_amount,required,nullable"`
	ModelType                  PriceMatrixWithAllocationPriceModelType                  `json:"model_type,required"`
	Name                       string                                                   `json:"name,required"`
	PlanPhaseOrder             int64                                                    `json:"plan_phase_order,required,nullable"`
	PriceType                  PriceMatrixWithAllocationPricePriceType                  `json:"price_type,required"`
	JSON                       priceMatrixWithAllocationPriceJSON                       `json:"-"`
}

func (*PriceMatrixWithAllocationPrice) UnmarshalJSON added in v0.22.0

func (r *PriceMatrixWithAllocationPrice) UnmarshalJSON(data []byte) (err error)

type PriceMatrixWithAllocationPriceBillableMetric added in v0.22.0

type PriceMatrixWithAllocationPriceBillableMetric struct {
	ID   string                                           `json:"id,required"`
	JSON priceMatrixWithAllocationPriceBillableMetricJSON `json:"-"`
}

func (*PriceMatrixWithAllocationPriceBillableMetric) UnmarshalJSON added in v0.22.0

func (r *PriceMatrixWithAllocationPriceBillableMetric) UnmarshalJSON(data []byte) (err error)

type PriceMatrixWithAllocationPriceCadence added in v0.22.0

type PriceMatrixWithAllocationPriceCadence string
const (
	PriceMatrixWithAllocationPriceCadenceOneTime   PriceMatrixWithAllocationPriceCadence = "one_time"
	PriceMatrixWithAllocationPriceCadenceMonthly   PriceMatrixWithAllocationPriceCadence = "monthly"
	PriceMatrixWithAllocationPriceCadenceQuarterly PriceMatrixWithAllocationPriceCadence = "quarterly"
	PriceMatrixWithAllocationPriceCadenceAnnual    PriceMatrixWithAllocationPriceCadence = "annual"
)

func (PriceMatrixWithAllocationPriceCadence) IsKnown added in v0.24.0

type PriceMatrixWithAllocationPriceItem added in v0.22.0

type PriceMatrixWithAllocationPriceItem struct {
	ID   string                                 `json:"id,required"`
	Name string                                 `json:"name,required"`
	JSON priceMatrixWithAllocationPriceItemJSON `json:"-"`
}

func (*PriceMatrixWithAllocationPriceItem) UnmarshalJSON added in v0.22.0

func (r *PriceMatrixWithAllocationPriceItem) UnmarshalJSON(data []byte) (err error)

type PriceMatrixWithAllocationPriceMatrixWithAllocationConfig added in v0.22.0

type PriceMatrixWithAllocationPriceMatrixWithAllocationConfig struct {
	// Allocation to be used to calculate the price
	Allocation float64 `json:"allocation,required"`
	// Default per unit rate for any usage not bucketed into a specified matrix_value
	DefaultUnitAmount string `json:"default_unit_amount,required"`
	// One or two event property values to evaluate matrix groups by
	Dimensions []string `json:"dimensions,required"`
	// Matrix values for specified matrix grouping keys
	MatrixValues []PriceMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue `json:"matrix_values,required"`
	JSON         priceMatrixWithAllocationPriceMatrixWithAllocationConfigJSON          `json:"-"`
}

func (*PriceMatrixWithAllocationPriceMatrixWithAllocationConfig) UnmarshalJSON added in v0.22.0

type PriceMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue added in v0.22.0

type PriceMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue struct {
	// One or two matrix keys to filter usage to this Matrix value by. For example,
	// ["region", "tier"] could be used to filter cloud usage by a cloud region and an
	// instance tier.
	DimensionValues []string `json:"dimension_values,required"`
	// Unit price for the specified dimension_values
	UnitAmount string                                                                  `json:"unit_amount,required"`
	JSON       priceMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValueJSON `json:"-"`
}

func (*PriceMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue) UnmarshalJSON added in v0.22.0

type PriceMatrixWithAllocationPriceMaximum added in v0.22.0

type PriceMatrixWithAllocationPriceMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                                    `json:"maximum_amount,required"`
	JSON          priceMatrixWithAllocationPriceMaximumJSON `json:"-"`
}

func (*PriceMatrixWithAllocationPriceMaximum) UnmarshalJSON added in v0.22.0

func (r *PriceMatrixWithAllocationPriceMaximum) UnmarshalJSON(data []byte) (err error)

type PriceMatrixWithAllocationPriceMinimum added in v0.22.0

type PriceMatrixWithAllocationPriceMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                                    `json:"minimum_amount,required"`
	JSON          priceMatrixWithAllocationPriceMinimumJSON `json:"-"`
}

func (*PriceMatrixWithAllocationPriceMinimum) UnmarshalJSON added in v0.22.0

func (r *PriceMatrixWithAllocationPriceMinimum) UnmarshalJSON(data []byte) (err error)

type PriceMatrixWithAllocationPriceModelType added in v0.22.0

type PriceMatrixWithAllocationPriceModelType string
const (
	PriceMatrixWithAllocationPriceModelTypeMatrixWithAllocation PriceMatrixWithAllocationPriceModelType = "matrix_with_allocation"
)

func (PriceMatrixWithAllocationPriceModelType) IsKnown added in v0.24.0

type PriceMatrixWithAllocationPricePriceType added in v0.22.0

type PriceMatrixWithAllocationPricePriceType string
const (
	PriceMatrixWithAllocationPricePriceTypeUsagePrice PriceMatrixWithAllocationPricePriceType = "usage_price"
	PriceMatrixWithAllocationPricePriceTypeFixedPrice PriceMatrixWithAllocationPricePriceType = "fixed_price"
)

func (PriceMatrixWithAllocationPricePriceType) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingBpsPrice added in v0.2.0

type PriceNewParamsNewFloatingBpsPrice struct {
	BpsConfig param.Field[PriceNewParamsNewFloatingBpsPriceBpsConfig] `json:"bps_config,required"`
	// The cadence to bill for this price on.
	Cadence param.Field[PriceNewParamsNewFloatingBpsPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                     `json:"item_id,required"`
	ModelType param.Field[PriceNewParamsNewFloatingBpsPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name param.Field[string] `json:"name,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PriceNewParamsNewFloatingBpsPrice) ImplementsPriceNewParams added in v0.2.0

func (PriceNewParamsNewFloatingBpsPrice) ImplementsPriceNewParams()

func (PriceNewParamsNewFloatingBpsPrice) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingBpsPrice) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingBpsPriceBpsConfig added in v0.2.0

type PriceNewParamsNewFloatingBpsPriceBpsConfig struct {
	// Basis point take rate per event
	Bps param.Field[float64] `json:"bps,required"`
	// Optional currency amount maximum to cap spend per event
	PerUnitMaximum param.Field[string] `json:"per_unit_maximum"`
}

func (PriceNewParamsNewFloatingBpsPriceBpsConfig) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingBpsPriceBpsConfig) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingBpsPriceCadence added in v0.2.0

type PriceNewParamsNewFloatingBpsPriceCadence string

The cadence to bill for this price on.

const (
	PriceNewParamsNewFloatingBpsPriceCadenceAnnual    PriceNewParamsNewFloatingBpsPriceCadence = "annual"
	PriceNewParamsNewFloatingBpsPriceCadenceMonthly   PriceNewParamsNewFloatingBpsPriceCadence = "monthly"
	PriceNewParamsNewFloatingBpsPriceCadenceQuarterly PriceNewParamsNewFloatingBpsPriceCadence = "quarterly"
	PriceNewParamsNewFloatingBpsPriceCadenceOneTime   PriceNewParamsNewFloatingBpsPriceCadence = "one_time"
)

func (PriceNewParamsNewFloatingBpsPriceCadence) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingBpsPriceModelType added in v0.2.0

type PriceNewParamsNewFloatingBpsPriceModelType string
const (
	PriceNewParamsNewFloatingBpsPriceModelTypeBps PriceNewParamsNewFloatingBpsPriceModelType = "bps"
)

func (PriceNewParamsNewFloatingBpsPriceModelType) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingBulkBpsPrice added in v0.2.0

type PriceNewParamsNewFloatingBulkBpsPrice struct {
	BulkBpsConfig param.Field[PriceNewParamsNewFloatingBulkBpsPriceBulkBpsConfig] `json:"bulk_bps_config,required"`
	// The cadence to bill for this price on.
	Cadence param.Field[PriceNewParamsNewFloatingBulkBpsPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                         `json:"item_id,required"`
	ModelType param.Field[PriceNewParamsNewFloatingBulkBpsPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name param.Field[string] `json:"name,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PriceNewParamsNewFloatingBulkBpsPrice) ImplementsPriceNewParams added in v0.2.0

func (PriceNewParamsNewFloatingBulkBpsPrice) ImplementsPriceNewParams()

func (PriceNewParamsNewFloatingBulkBpsPrice) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingBulkBpsPrice) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingBulkBpsPriceBulkBpsConfig added in v0.2.0

type PriceNewParamsNewFloatingBulkBpsPriceBulkBpsConfig struct {
	// Tiers for a bulk BPS pricing model where all usage is aggregated to a single
	// tier based on total volume
	Tiers param.Field[[]PriceNewParamsNewFloatingBulkBpsPriceBulkBpsConfigTier] `json:"tiers,required"`
}

func (PriceNewParamsNewFloatingBulkBpsPriceBulkBpsConfig) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingBulkBpsPriceBulkBpsConfig) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingBulkBpsPriceBulkBpsConfigTier added in v0.2.0

type PriceNewParamsNewFloatingBulkBpsPriceBulkBpsConfigTier struct {
	// Basis points to rate on
	Bps param.Field[float64] `json:"bps,required"`
	// Upper bound for tier
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The maximum amount to charge for any one event
	PerUnitMaximum param.Field[string] `json:"per_unit_maximum"`
}

func (PriceNewParamsNewFloatingBulkBpsPriceBulkBpsConfigTier) MarshalJSON added in v0.2.0

type PriceNewParamsNewFloatingBulkBpsPriceCadence added in v0.2.0

type PriceNewParamsNewFloatingBulkBpsPriceCadence string

The cadence to bill for this price on.

const (
	PriceNewParamsNewFloatingBulkBpsPriceCadenceAnnual    PriceNewParamsNewFloatingBulkBpsPriceCadence = "annual"
	PriceNewParamsNewFloatingBulkBpsPriceCadenceMonthly   PriceNewParamsNewFloatingBulkBpsPriceCadence = "monthly"
	PriceNewParamsNewFloatingBulkBpsPriceCadenceQuarterly PriceNewParamsNewFloatingBulkBpsPriceCadence = "quarterly"
	PriceNewParamsNewFloatingBulkBpsPriceCadenceOneTime   PriceNewParamsNewFloatingBulkBpsPriceCadence = "one_time"
)

func (PriceNewParamsNewFloatingBulkBpsPriceCadence) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingBulkBpsPriceModelType added in v0.2.0

type PriceNewParamsNewFloatingBulkBpsPriceModelType string
const (
	PriceNewParamsNewFloatingBulkBpsPriceModelTypeBulkBps PriceNewParamsNewFloatingBulkBpsPriceModelType = "bulk_bps"
)

func (PriceNewParamsNewFloatingBulkBpsPriceModelType) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingBulkPrice added in v0.2.0

type PriceNewParamsNewFloatingBulkPrice struct {
	BulkConfig param.Field[PriceNewParamsNewFloatingBulkPriceBulkConfig] `json:"bulk_config,required"`
	// The cadence to bill for this price on.
	Cadence param.Field[PriceNewParamsNewFloatingBulkPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                      `json:"item_id,required"`
	ModelType param.Field[PriceNewParamsNewFloatingBulkPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name param.Field[string] `json:"name,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PriceNewParamsNewFloatingBulkPrice) ImplementsPriceNewParams added in v0.2.0

func (PriceNewParamsNewFloatingBulkPrice) ImplementsPriceNewParams()

func (PriceNewParamsNewFloatingBulkPrice) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingBulkPrice) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingBulkPriceBulkConfig added in v0.2.0

type PriceNewParamsNewFloatingBulkPriceBulkConfig struct {
	// Bulk tiers for rating based on total usage volume
	Tiers param.Field[[]PriceNewParamsNewFloatingBulkPriceBulkConfigTier] `json:"tiers,required"`
}

func (PriceNewParamsNewFloatingBulkPriceBulkConfig) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingBulkPriceBulkConfig) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingBulkPriceBulkConfigTier added in v0.2.0

type PriceNewParamsNewFloatingBulkPriceBulkConfigTier struct {
	// Amount per unit
	UnitAmount param.Field[string] `json:"unit_amount,required"`
	// Upper bound for this tier
	MaximumUnits param.Field[float64] `json:"maximum_units"`
}

func (PriceNewParamsNewFloatingBulkPriceBulkConfigTier) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingBulkPriceBulkConfigTier) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingBulkPriceCadence added in v0.2.0

type PriceNewParamsNewFloatingBulkPriceCadence string

The cadence to bill for this price on.

const (
	PriceNewParamsNewFloatingBulkPriceCadenceAnnual    PriceNewParamsNewFloatingBulkPriceCadence = "annual"
	PriceNewParamsNewFloatingBulkPriceCadenceMonthly   PriceNewParamsNewFloatingBulkPriceCadence = "monthly"
	PriceNewParamsNewFloatingBulkPriceCadenceQuarterly PriceNewParamsNewFloatingBulkPriceCadence = "quarterly"
	PriceNewParamsNewFloatingBulkPriceCadenceOneTime   PriceNewParamsNewFloatingBulkPriceCadence = "one_time"
)

func (PriceNewParamsNewFloatingBulkPriceCadence) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingBulkPriceModelType added in v0.2.0

type PriceNewParamsNewFloatingBulkPriceModelType string
const (
	PriceNewParamsNewFloatingBulkPriceModelTypeBulk PriceNewParamsNewFloatingBulkPriceModelType = "bulk"
)

func (PriceNewParamsNewFloatingBulkPriceModelType) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingMatrixPrice added in v0.2.0

type PriceNewParamsNewFloatingMatrixPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PriceNewParamsNewFloatingMatrixPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID       param.Field[string]                                           `json:"item_id,required"`
	MatrixConfig param.Field[PriceNewParamsNewFloatingMatrixPriceMatrixConfig] `json:"matrix_config,required"`
	ModelType    param.Field[PriceNewParamsNewFloatingMatrixPriceModelType]    `json:"model_type,required"`
	// The name of the price.
	Name param.Field[string] `json:"name,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PriceNewParamsNewFloatingMatrixPrice) ImplementsPriceNewParams added in v0.2.0

func (PriceNewParamsNewFloatingMatrixPrice) ImplementsPriceNewParams()

func (PriceNewParamsNewFloatingMatrixPrice) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingMatrixPrice) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingMatrixPriceCadence added in v0.2.0

type PriceNewParamsNewFloatingMatrixPriceCadence string

The cadence to bill for this price on.

const (
	PriceNewParamsNewFloatingMatrixPriceCadenceAnnual    PriceNewParamsNewFloatingMatrixPriceCadence = "annual"
	PriceNewParamsNewFloatingMatrixPriceCadenceMonthly   PriceNewParamsNewFloatingMatrixPriceCadence = "monthly"
	PriceNewParamsNewFloatingMatrixPriceCadenceQuarterly PriceNewParamsNewFloatingMatrixPriceCadence = "quarterly"
	PriceNewParamsNewFloatingMatrixPriceCadenceOneTime   PriceNewParamsNewFloatingMatrixPriceCadence = "one_time"
)

func (PriceNewParamsNewFloatingMatrixPriceCadence) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingMatrixPriceMatrixConfig added in v0.2.0

type PriceNewParamsNewFloatingMatrixPriceMatrixConfig struct {
	// Default per unit rate for any usage not bucketed into a specified matrix_value
	DefaultUnitAmount param.Field[string] `json:"default_unit_amount,required"`
	// One or two event property values to evaluate matrix groups by
	Dimensions param.Field[[]string] `json:"dimensions,required"`
	// Matrix values for specified matrix grouping keys
	MatrixValues param.Field[[]PriceNewParamsNewFloatingMatrixPriceMatrixConfigMatrixValue] `json:"matrix_values,required"`
}

func (PriceNewParamsNewFloatingMatrixPriceMatrixConfig) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingMatrixPriceMatrixConfig) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingMatrixPriceMatrixConfigMatrixValue added in v0.2.0

type PriceNewParamsNewFloatingMatrixPriceMatrixConfigMatrixValue struct {
	// One or two matrix keys to filter usage to this Matrix value by. For example,
	// ["region", "tier"] could be used to filter cloud usage by a cloud region and an
	// instance tier.
	DimensionValues param.Field[[]string] `json:"dimension_values,required"`
	// Unit price for the specified dimension_values
	UnitAmount param.Field[string] `json:"unit_amount,required"`
}

func (PriceNewParamsNewFloatingMatrixPriceMatrixConfigMatrixValue) MarshalJSON added in v0.2.0

type PriceNewParamsNewFloatingMatrixPriceModelType added in v0.2.0

type PriceNewParamsNewFloatingMatrixPriceModelType string
const (
	PriceNewParamsNewFloatingMatrixPriceModelTypeMatrix PriceNewParamsNewFloatingMatrixPriceModelType = "matrix"
)

func (PriceNewParamsNewFloatingMatrixPriceModelType) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingMatrixWithAllocationPrice added in v0.22.0

type PriceNewParamsNewFloatingMatrixWithAllocationPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PriceNewParamsNewFloatingMatrixWithAllocationPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID                     param.Field[string]                                                                       `json:"item_id,required"`
	MatrixWithAllocationConfig param.Field[PriceNewParamsNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig] `json:"matrix_with_allocation_config,required"`
	ModelType                  param.Field[PriceNewParamsNewFloatingMatrixWithAllocationPriceModelType]                  `json:"model_type,required"`
	// The name of the price.
	Name param.Field[string] `json:"name,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PriceNewParamsNewFloatingMatrixWithAllocationPrice) ImplementsPriceNewParams added in v0.22.0

func (PriceNewParamsNewFloatingMatrixWithAllocationPrice) ImplementsPriceNewParams()

func (PriceNewParamsNewFloatingMatrixWithAllocationPrice) MarshalJSON added in v0.22.0

func (r PriceNewParamsNewFloatingMatrixWithAllocationPrice) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingMatrixWithAllocationPriceCadence added in v0.22.0

type PriceNewParamsNewFloatingMatrixWithAllocationPriceCadence string

The cadence to bill for this price on.

const (
	PriceNewParamsNewFloatingMatrixWithAllocationPriceCadenceAnnual    PriceNewParamsNewFloatingMatrixWithAllocationPriceCadence = "annual"
	PriceNewParamsNewFloatingMatrixWithAllocationPriceCadenceMonthly   PriceNewParamsNewFloatingMatrixWithAllocationPriceCadence = "monthly"
	PriceNewParamsNewFloatingMatrixWithAllocationPriceCadenceQuarterly PriceNewParamsNewFloatingMatrixWithAllocationPriceCadence = "quarterly"
	PriceNewParamsNewFloatingMatrixWithAllocationPriceCadenceOneTime   PriceNewParamsNewFloatingMatrixWithAllocationPriceCadence = "one_time"
)

func (PriceNewParamsNewFloatingMatrixWithAllocationPriceCadence) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig added in v0.22.0

type PriceNewParamsNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig struct {
	// Allocation to be used to calculate the price
	Allocation param.Field[float64] `json:"allocation,required"`
	// Default per unit rate for any usage not bucketed into a specified matrix_value
	DefaultUnitAmount param.Field[string] `json:"default_unit_amount,required"`
	// One or two event property values to evaluate matrix groups by
	Dimensions param.Field[[]string] `json:"dimensions,required"`
	// Matrix values for specified matrix grouping keys
	MatrixValues param.Field[[]PriceNewParamsNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue] `json:"matrix_values,required"`
}

func (PriceNewParamsNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig) MarshalJSON added in v0.22.0

type PriceNewParamsNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue added in v0.22.0

type PriceNewParamsNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue struct {
	// One or two matrix keys to filter usage to this Matrix value by. For example,
	// ["region", "tier"] could be used to filter cloud usage by a cloud region and an
	// instance tier.
	DimensionValues param.Field[[]string] `json:"dimension_values,required"`
	// Unit price for the specified dimension_values
	UnitAmount param.Field[string] `json:"unit_amount,required"`
}

func (PriceNewParamsNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue) MarshalJSON added in v0.22.0

type PriceNewParamsNewFloatingMatrixWithAllocationPriceModelType added in v0.22.0

type PriceNewParamsNewFloatingMatrixWithAllocationPriceModelType string
const (
	PriceNewParamsNewFloatingMatrixWithAllocationPriceModelTypeMatrixWithAllocation PriceNewParamsNewFloatingMatrixWithAllocationPriceModelType = "matrix_with_allocation"
)

func (PriceNewParamsNewFloatingMatrixWithAllocationPriceModelType) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingPackagePrice added in v0.2.0

type PriceNewParamsNewFloatingPackagePrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PriceNewParamsNewFloatingPackagePriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                         `json:"item_id,required"`
	ModelType param.Field[PriceNewParamsNewFloatingPackagePriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name          param.Field[string]                                             `json:"name,required"`
	PackageConfig param.Field[PriceNewParamsNewFloatingPackagePricePackageConfig] `json:"package_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PriceNewParamsNewFloatingPackagePrice) ImplementsPriceNewParams added in v0.2.0

func (PriceNewParamsNewFloatingPackagePrice) ImplementsPriceNewParams()

func (PriceNewParamsNewFloatingPackagePrice) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingPackagePrice) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingPackagePriceCadence added in v0.2.0

type PriceNewParamsNewFloatingPackagePriceCadence string

The cadence to bill for this price on.

const (
	PriceNewParamsNewFloatingPackagePriceCadenceAnnual    PriceNewParamsNewFloatingPackagePriceCadence = "annual"
	PriceNewParamsNewFloatingPackagePriceCadenceMonthly   PriceNewParamsNewFloatingPackagePriceCadence = "monthly"
	PriceNewParamsNewFloatingPackagePriceCadenceQuarterly PriceNewParamsNewFloatingPackagePriceCadence = "quarterly"
	PriceNewParamsNewFloatingPackagePriceCadenceOneTime   PriceNewParamsNewFloatingPackagePriceCadence = "one_time"
)

func (PriceNewParamsNewFloatingPackagePriceCadence) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingPackagePriceModelType added in v0.2.0

type PriceNewParamsNewFloatingPackagePriceModelType string
const (
	PriceNewParamsNewFloatingPackagePriceModelTypePackage PriceNewParamsNewFloatingPackagePriceModelType = "package"
)

func (PriceNewParamsNewFloatingPackagePriceModelType) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingPackagePricePackageConfig added in v0.2.0

type PriceNewParamsNewFloatingPackagePricePackageConfig struct {
	// A currency amount to rate usage by
	PackageAmount param.Field[string] `json:"package_amount,required"`
	// An integer amount to represent package size. For example, 1000 here would divide
	// usage by 1000 before multiplying by package_amount in rating
	PackageSize param.Field[int64] `json:"package_size"`
}

func (PriceNewParamsNewFloatingPackagePricePackageConfig) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingPackagePricePackageConfig) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingPackageWithAllocationPrice added in v0.2.0

type PriceNewParamsNewFloatingPackageWithAllocationPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PriceNewParamsNewFloatingPackageWithAllocationPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                       `json:"item_id,required"`
	ModelType param.Field[PriceNewParamsNewFloatingPackageWithAllocationPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                        param.Field[string]                 `json:"name,required"`
	PackageWithAllocationConfig param.Field[map[string]interface{}] `json:"package_with_allocation_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PriceNewParamsNewFloatingPackageWithAllocationPrice) ImplementsPriceNewParams added in v0.2.0

func (PriceNewParamsNewFloatingPackageWithAllocationPrice) ImplementsPriceNewParams()

func (PriceNewParamsNewFloatingPackageWithAllocationPrice) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingPackageWithAllocationPrice) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingPackageWithAllocationPriceCadence added in v0.2.0

type PriceNewParamsNewFloatingPackageWithAllocationPriceCadence string

The cadence to bill for this price on.

const (
	PriceNewParamsNewFloatingPackageWithAllocationPriceCadenceAnnual    PriceNewParamsNewFloatingPackageWithAllocationPriceCadence = "annual"
	PriceNewParamsNewFloatingPackageWithAllocationPriceCadenceMonthly   PriceNewParamsNewFloatingPackageWithAllocationPriceCadence = "monthly"
	PriceNewParamsNewFloatingPackageWithAllocationPriceCadenceQuarterly PriceNewParamsNewFloatingPackageWithAllocationPriceCadence = "quarterly"
	PriceNewParamsNewFloatingPackageWithAllocationPriceCadenceOneTime   PriceNewParamsNewFloatingPackageWithAllocationPriceCadence = "one_time"
)

func (PriceNewParamsNewFloatingPackageWithAllocationPriceCadence) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingPackageWithAllocationPriceModelType added in v0.2.0

type PriceNewParamsNewFloatingPackageWithAllocationPriceModelType string
const (
	PriceNewParamsNewFloatingPackageWithAllocationPriceModelTypePackageWithAllocation PriceNewParamsNewFloatingPackageWithAllocationPriceModelType = "package_with_allocation"
)

func (PriceNewParamsNewFloatingPackageWithAllocationPriceModelType) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingThresholdTotalAmountPrice added in v0.2.0

type PriceNewParamsNewFloatingThresholdTotalAmountPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PriceNewParamsNewFloatingThresholdTotalAmountPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                      `json:"item_id,required"`
	ModelType param.Field[PriceNewParamsNewFloatingThresholdTotalAmountPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                       param.Field[string]                 `json:"name,required"`
	ThresholdTotalAmountConfig param.Field[map[string]interface{}] `json:"threshold_total_amount_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PriceNewParamsNewFloatingThresholdTotalAmountPrice) ImplementsPriceNewParams added in v0.2.0

func (PriceNewParamsNewFloatingThresholdTotalAmountPrice) ImplementsPriceNewParams()

func (PriceNewParamsNewFloatingThresholdTotalAmountPrice) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingThresholdTotalAmountPrice) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingThresholdTotalAmountPriceCadence added in v0.2.0

type PriceNewParamsNewFloatingThresholdTotalAmountPriceCadence string

The cadence to bill for this price on.

const (
	PriceNewParamsNewFloatingThresholdTotalAmountPriceCadenceAnnual    PriceNewParamsNewFloatingThresholdTotalAmountPriceCadence = "annual"
	PriceNewParamsNewFloatingThresholdTotalAmountPriceCadenceMonthly   PriceNewParamsNewFloatingThresholdTotalAmountPriceCadence = "monthly"
	PriceNewParamsNewFloatingThresholdTotalAmountPriceCadenceQuarterly PriceNewParamsNewFloatingThresholdTotalAmountPriceCadence = "quarterly"
	PriceNewParamsNewFloatingThresholdTotalAmountPriceCadenceOneTime   PriceNewParamsNewFloatingThresholdTotalAmountPriceCadence = "one_time"
)

func (PriceNewParamsNewFloatingThresholdTotalAmountPriceCadence) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingThresholdTotalAmountPriceModelType added in v0.2.0

type PriceNewParamsNewFloatingThresholdTotalAmountPriceModelType string
const (
	PriceNewParamsNewFloatingThresholdTotalAmountPriceModelTypeThresholdTotalAmount PriceNewParamsNewFloatingThresholdTotalAmountPriceModelType = "threshold_total_amount"
)

func (PriceNewParamsNewFloatingThresholdTotalAmountPriceModelType) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingTieredBpsPrice added in v0.2.0

type PriceNewParamsNewFloatingTieredBpsPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PriceNewParamsNewFloatingTieredBpsPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                           `json:"item_id,required"`
	ModelType param.Field[PriceNewParamsNewFloatingTieredBpsPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name            param.Field[string]                                                 `json:"name,required"`
	TieredBpsConfig param.Field[PriceNewParamsNewFloatingTieredBpsPriceTieredBpsConfig] `json:"tiered_bps_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PriceNewParamsNewFloatingTieredBpsPrice) ImplementsPriceNewParams added in v0.2.0

func (PriceNewParamsNewFloatingTieredBpsPrice) ImplementsPriceNewParams()

func (PriceNewParamsNewFloatingTieredBpsPrice) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingTieredBpsPrice) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingTieredBpsPriceCadence added in v0.2.0

type PriceNewParamsNewFloatingTieredBpsPriceCadence string

The cadence to bill for this price on.

const (
	PriceNewParamsNewFloatingTieredBpsPriceCadenceAnnual    PriceNewParamsNewFloatingTieredBpsPriceCadence = "annual"
	PriceNewParamsNewFloatingTieredBpsPriceCadenceMonthly   PriceNewParamsNewFloatingTieredBpsPriceCadence = "monthly"
	PriceNewParamsNewFloatingTieredBpsPriceCadenceQuarterly PriceNewParamsNewFloatingTieredBpsPriceCadence = "quarterly"
	PriceNewParamsNewFloatingTieredBpsPriceCadenceOneTime   PriceNewParamsNewFloatingTieredBpsPriceCadence = "one_time"
)

func (PriceNewParamsNewFloatingTieredBpsPriceCadence) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingTieredBpsPriceModelType added in v0.2.0

type PriceNewParamsNewFloatingTieredBpsPriceModelType string
const (
	PriceNewParamsNewFloatingTieredBpsPriceModelTypeTieredBps PriceNewParamsNewFloatingTieredBpsPriceModelType = "tiered_bps"
)

func (PriceNewParamsNewFloatingTieredBpsPriceModelType) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingTieredBpsPriceTieredBpsConfig added in v0.2.0

type PriceNewParamsNewFloatingTieredBpsPriceTieredBpsConfig struct {
	// Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
	// tiers
	Tiers param.Field[[]PriceNewParamsNewFloatingTieredBpsPriceTieredBpsConfigTier] `json:"tiers,required"`
}

func (PriceNewParamsNewFloatingTieredBpsPriceTieredBpsConfig) MarshalJSON added in v0.2.0

type PriceNewParamsNewFloatingTieredBpsPriceTieredBpsConfigTier added in v0.2.0

type PriceNewParamsNewFloatingTieredBpsPriceTieredBpsConfigTier struct {
	// Per-event basis point rate
	Bps param.Field[float64] `json:"bps,required"`
	// Inclusive tier starting value
	MinimumAmount param.Field[string] `json:"minimum_amount,required"`
	// Exclusive tier ending value
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// Per unit maximum to charge
	PerUnitMaximum param.Field[string] `json:"per_unit_maximum"`
}

func (PriceNewParamsNewFloatingTieredBpsPriceTieredBpsConfigTier) MarshalJSON added in v0.2.0

type PriceNewParamsNewFloatingTieredPackagePrice added in v0.2.0

type PriceNewParamsNewFloatingTieredPackagePrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PriceNewParamsNewFloatingTieredPackagePriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                               `json:"item_id,required"`
	ModelType param.Field[PriceNewParamsNewFloatingTieredPackagePriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                param.Field[string]                 `json:"name,required"`
	TieredPackageConfig param.Field[map[string]interface{}] `json:"tiered_package_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PriceNewParamsNewFloatingTieredPackagePrice) ImplementsPriceNewParams added in v0.2.0

func (PriceNewParamsNewFloatingTieredPackagePrice) ImplementsPriceNewParams()

func (PriceNewParamsNewFloatingTieredPackagePrice) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingTieredPackagePrice) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingTieredPackagePriceCadence added in v0.2.0

type PriceNewParamsNewFloatingTieredPackagePriceCadence string

The cadence to bill for this price on.

const (
	PriceNewParamsNewFloatingTieredPackagePriceCadenceAnnual    PriceNewParamsNewFloatingTieredPackagePriceCadence = "annual"
	PriceNewParamsNewFloatingTieredPackagePriceCadenceMonthly   PriceNewParamsNewFloatingTieredPackagePriceCadence = "monthly"
	PriceNewParamsNewFloatingTieredPackagePriceCadenceQuarterly PriceNewParamsNewFloatingTieredPackagePriceCadence = "quarterly"
	PriceNewParamsNewFloatingTieredPackagePriceCadenceOneTime   PriceNewParamsNewFloatingTieredPackagePriceCadence = "one_time"
)

func (PriceNewParamsNewFloatingTieredPackagePriceCadence) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingTieredPackagePriceModelType added in v0.2.0

type PriceNewParamsNewFloatingTieredPackagePriceModelType string
const (
	PriceNewParamsNewFloatingTieredPackagePriceModelTypeTieredPackage PriceNewParamsNewFloatingTieredPackagePriceModelType = "tiered_package"
)

func (PriceNewParamsNewFloatingTieredPackagePriceModelType) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingTieredPackageWithMinimumPrice added in v0.20.0

type PriceNewParamsNewFloatingTieredPackageWithMinimumPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PriceNewParamsNewFloatingTieredPackageWithMinimumPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                          `json:"item_id,required"`
	ModelType param.Field[PriceNewParamsNewFloatingTieredPackageWithMinimumPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                           param.Field[string]                 `json:"name,required"`
	TieredPackageWithMinimumConfig param.Field[map[string]interface{}] `json:"tiered_package_with_minimum_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PriceNewParamsNewFloatingTieredPackageWithMinimumPrice) ImplementsPriceNewParams added in v0.20.0

func (PriceNewParamsNewFloatingTieredPackageWithMinimumPrice) ImplementsPriceNewParams()

func (PriceNewParamsNewFloatingTieredPackageWithMinimumPrice) MarshalJSON added in v0.20.0

type PriceNewParamsNewFloatingTieredPackageWithMinimumPriceCadence added in v0.20.0

type PriceNewParamsNewFloatingTieredPackageWithMinimumPriceCadence string

The cadence to bill for this price on.

const (
	PriceNewParamsNewFloatingTieredPackageWithMinimumPriceCadenceAnnual    PriceNewParamsNewFloatingTieredPackageWithMinimumPriceCadence = "annual"
	PriceNewParamsNewFloatingTieredPackageWithMinimumPriceCadenceMonthly   PriceNewParamsNewFloatingTieredPackageWithMinimumPriceCadence = "monthly"
	PriceNewParamsNewFloatingTieredPackageWithMinimumPriceCadenceQuarterly PriceNewParamsNewFloatingTieredPackageWithMinimumPriceCadence = "quarterly"
	PriceNewParamsNewFloatingTieredPackageWithMinimumPriceCadenceOneTime   PriceNewParamsNewFloatingTieredPackageWithMinimumPriceCadence = "one_time"
)

func (PriceNewParamsNewFloatingTieredPackageWithMinimumPriceCadence) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingTieredPackageWithMinimumPriceModelType added in v0.20.0

type PriceNewParamsNewFloatingTieredPackageWithMinimumPriceModelType string
const (
	PriceNewParamsNewFloatingTieredPackageWithMinimumPriceModelTypeTieredPackageWithMinimum PriceNewParamsNewFloatingTieredPackageWithMinimumPriceModelType = "tiered_package_with_minimum"
)

func (PriceNewParamsNewFloatingTieredPackageWithMinimumPriceModelType) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingTieredPrice added in v0.2.0

type PriceNewParamsNewFloatingTieredPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PriceNewParamsNewFloatingTieredPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                        `json:"item_id,required"`
	ModelType param.Field[PriceNewParamsNewFloatingTieredPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name         param.Field[string]                                           `json:"name,required"`
	TieredConfig param.Field[PriceNewParamsNewFloatingTieredPriceTieredConfig] `json:"tiered_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PriceNewParamsNewFloatingTieredPrice) ImplementsPriceNewParams added in v0.2.0

func (PriceNewParamsNewFloatingTieredPrice) ImplementsPriceNewParams()

func (PriceNewParamsNewFloatingTieredPrice) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingTieredPrice) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingTieredPriceCadence added in v0.2.0

type PriceNewParamsNewFloatingTieredPriceCadence string

The cadence to bill for this price on.

const (
	PriceNewParamsNewFloatingTieredPriceCadenceAnnual    PriceNewParamsNewFloatingTieredPriceCadence = "annual"
	PriceNewParamsNewFloatingTieredPriceCadenceMonthly   PriceNewParamsNewFloatingTieredPriceCadence = "monthly"
	PriceNewParamsNewFloatingTieredPriceCadenceQuarterly PriceNewParamsNewFloatingTieredPriceCadence = "quarterly"
	PriceNewParamsNewFloatingTieredPriceCadenceOneTime   PriceNewParamsNewFloatingTieredPriceCadence = "one_time"
)

func (PriceNewParamsNewFloatingTieredPriceCadence) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingTieredPriceModelType added in v0.2.0

type PriceNewParamsNewFloatingTieredPriceModelType string
const (
	PriceNewParamsNewFloatingTieredPriceModelTypeTiered PriceNewParamsNewFloatingTieredPriceModelType = "tiered"
)

func (PriceNewParamsNewFloatingTieredPriceModelType) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingTieredPriceTieredConfig added in v0.2.0

type PriceNewParamsNewFloatingTieredPriceTieredConfig struct {
	// Tiers for rating based on total usage quantities into the specified tier
	Tiers param.Field[[]PriceNewParamsNewFloatingTieredPriceTieredConfigTier] `json:"tiers,required"`
}

func (PriceNewParamsNewFloatingTieredPriceTieredConfig) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingTieredPriceTieredConfig) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingTieredPriceTieredConfigTier added in v0.2.0

type PriceNewParamsNewFloatingTieredPriceTieredConfigTier struct {
	// Inclusive tier starting value
	FirstUnit param.Field[float64] `json:"first_unit,required"`
	// Amount per unit
	UnitAmount param.Field[string] `json:"unit_amount,required"`
	// Exclusive tier ending value. If null, this is treated as the last tier
	LastUnit param.Field[float64] `json:"last_unit"`
}

func (PriceNewParamsNewFloatingTieredPriceTieredConfigTier) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingTieredPriceTieredConfigTier) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingTieredWithMinimumPrice added in v0.2.0

type PriceNewParamsNewFloatingTieredWithMinimumPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PriceNewParamsNewFloatingTieredWithMinimumPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                   `json:"item_id,required"`
	ModelType param.Field[PriceNewParamsNewFloatingTieredWithMinimumPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                    param.Field[string]                 `json:"name,required"`
	TieredWithMinimumConfig param.Field[map[string]interface{}] `json:"tiered_with_minimum_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PriceNewParamsNewFloatingTieredWithMinimumPrice) ImplementsPriceNewParams added in v0.2.0

func (PriceNewParamsNewFloatingTieredWithMinimumPrice) ImplementsPriceNewParams()

func (PriceNewParamsNewFloatingTieredWithMinimumPrice) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingTieredWithMinimumPrice) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingTieredWithMinimumPriceCadence added in v0.2.0

type PriceNewParamsNewFloatingTieredWithMinimumPriceCadence string

The cadence to bill for this price on.

const (
	PriceNewParamsNewFloatingTieredWithMinimumPriceCadenceAnnual    PriceNewParamsNewFloatingTieredWithMinimumPriceCadence = "annual"
	PriceNewParamsNewFloatingTieredWithMinimumPriceCadenceMonthly   PriceNewParamsNewFloatingTieredWithMinimumPriceCadence = "monthly"
	PriceNewParamsNewFloatingTieredWithMinimumPriceCadenceQuarterly PriceNewParamsNewFloatingTieredWithMinimumPriceCadence = "quarterly"
	PriceNewParamsNewFloatingTieredWithMinimumPriceCadenceOneTime   PriceNewParamsNewFloatingTieredWithMinimumPriceCadence = "one_time"
)

func (PriceNewParamsNewFloatingTieredWithMinimumPriceCadence) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingTieredWithMinimumPriceModelType added in v0.2.0

type PriceNewParamsNewFloatingTieredWithMinimumPriceModelType string
const (
	PriceNewParamsNewFloatingTieredWithMinimumPriceModelTypeTieredWithMinimum PriceNewParamsNewFloatingTieredWithMinimumPriceModelType = "tiered_with_minimum"
)

func (PriceNewParamsNewFloatingTieredWithMinimumPriceModelType) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingUnitPrice added in v0.2.0

type PriceNewParamsNewFloatingUnitPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PriceNewParamsNewFloatingUnitPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                      `json:"item_id,required"`
	ModelType param.Field[PriceNewParamsNewFloatingUnitPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name       param.Field[string]                                       `json:"name,required"`
	UnitConfig param.Field[PriceNewParamsNewFloatingUnitPriceUnitConfig] `json:"unit_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PriceNewParamsNewFloatingUnitPrice) ImplementsPriceNewParams added in v0.2.0

func (PriceNewParamsNewFloatingUnitPrice) ImplementsPriceNewParams()

func (PriceNewParamsNewFloatingUnitPrice) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingUnitPrice) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingUnitPriceCadence added in v0.2.0

type PriceNewParamsNewFloatingUnitPriceCadence string

The cadence to bill for this price on.

const (
	PriceNewParamsNewFloatingUnitPriceCadenceAnnual    PriceNewParamsNewFloatingUnitPriceCadence = "annual"
	PriceNewParamsNewFloatingUnitPriceCadenceMonthly   PriceNewParamsNewFloatingUnitPriceCadence = "monthly"
	PriceNewParamsNewFloatingUnitPriceCadenceQuarterly PriceNewParamsNewFloatingUnitPriceCadence = "quarterly"
	PriceNewParamsNewFloatingUnitPriceCadenceOneTime   PriceNewParamsNewFloatingUnitPriceCadence = "one_time"
)

func (PriceNewParamsNewFloatingUnitPriceCadence) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingUnitPriceModelType added in v0.2.0

type PriceNewParamsNewFloatingUnitPriceModelType string
const (
	PriceNewParamsNewFloatingUnitPriceModelTypeUnit PriceNewParamsNewFloatingUnitPriceModelType = "unit"
)

func (PriceNewParamsNewFloatingUnitPriceModelType) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingUnitPriceUnitConfig added in v0.2.0

type PriceNewParamsNewFloatingUnitPriceUnitConfig struct {
	// Rate per unit of usage
	UnitAmount param.Field[string] `json:"unit_amount,required"`
}

func (PriceNewParamsNewFloatingUnitPriceUnitConfig) MarshalJSON added in v0.2.0

func (r PriceNewParamsNewFloatingUnitPriceUnitConfig) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingUnitWithPercentPrice added in v0.20.0

type PriceNewParamsNewFloatingUnitWithPercentPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[PriceNewParamsNewFloatingUnitWithPercentPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                 `json:"item_id,required"`
	ModelType param.Field[PriceNewParamsNewFloatingUnitWithPercentPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                  param.Field[string]                 `json:"name,required"`
	UnitWithPercentConfig param.Field[map[string]interface{}] `json:"unit_with_percent_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (PriceNewParamsNewFloatingUnitWithPercentPrice) ImplementsPriceNewParams added in v0.20.0

func (PriceNewParamsNewFloatingUnitWithPercentPrice) ImplementsPriceNewParams()

func (PriceNewParamsNewFloatingUnitWithPercentPrice) MarshalJSON added in v0.20.0

func (r PriceNewParamsNewFloatingUnitWithPercentPrice) MarshalJSON() (data []byte, err error)

type PriceNewParamsNewFloatingUnitWithPercentPriceCadence added in v0.20.0

type PriceNewParamsNewFloatingUnitWithPercentPriceCadence string

The cadence to bill for this price on.

const (
	PriceNewParamsNewFloatingUnitWithPercentPriceCadenceAnnual    PriceNewParamsNewFloatingUnitWithPercentPriceCadence = "annual"
	PriceNewParamsNewFloatingUnitWithPercentPriceCadenceMonthly   PriceNewParamsNewFloatingUnitWithPercentPriceCadence = "monthly"
	PriceNewParamsNewFloatingUnitWithPercentPriceCadenceQuarterly PriceNewParamsNewFloatingUnitWithPercentPriceCadence = "quarterly"
	PriceNewParamsNewFloatingUnitWithPercentPriceCadenceOneTime   PriceNewParamsNewFloatingUnitWithPercentPriceCadence = "one_time"
)

func (PriceNewParamsNewFloatingUnitWithPercentPriceCadence) IsKnown added in v0.24.0

type PriceNewParamsNewFloatingUnitWithPercentPriceModelType added in v0.20.0

type PriceNewParamsNewFloatingUnitWithPercentPriceModelType string
const (
	PriceNewParamsNewFloatingUnitWithPercentPriceModelTypeUnitWithPercent PriceNewParamsNewFloatingUnitWithPercentPriceModelType = "unit_with_percent"
)

func (PriceNewParamsNewFloatingUnitWithPercentPriceModelType) IsKnown added in v0.24.0

type PricePackagePrice

type PricePackagePrice struct {
	ID                 string                          `json:"id,required"`
	BillableMetric     PricePackagePriceBillableMetric `json:"billable_metric,required,nullable"`
	Cadence            PricePackagePriceCadence        `json:"cadence,required"`
	CreatedAt          time.Time                       `json:"created_at,required" format:"date-time"`
	Currency           string                          `json:"currency,required"`
	Discount           shared.Discount                 `json:"discount,required,nullable"`
	ExternalPriceID    string                          `json:"external_price_id,required,nullable"`
	FixedPriceQuantity float64                         `json:"fixed_price_quantity,required,nullable"`
	Item               PricePackagePriceItem           `json:"item,required"`
	Maximum            PricePackagePriceMaximum        `json:"maximum,required,nullable"`
	MaximumAmount      string                          `json:"maximum_amount,required,nullable"`
	Minimum            PricePackagePriceMinimum        `json:"minimum,required,nullable"`
	MinimumAmount      string                          `json:"minimum_amount,required,nullable"`
	ModelType          PricePackagePriceModelType      `json:"model_type,required"`
	Name               string                          `json:"name,required"`
	PackageConfig      PricePackagePricePackageConfig  `json:"package_config,required"`
	PlanPhaseOrder     int64                           `json:"plan_phase_order,required,nullable"`
	PriceType          PricePackagePricePriceType      `json:"price_type,required"`
	JSON               pricePackagePriceJSON           `json:"-"`
}

func (*PricePackagePrice) UnmarshalJSON

func (r *PricePackagePrice) UnmarshalJSON(data []byte) (err error)

type PricePackagePriceBillableMetric

type PricePackagePriceBillableMetric struct {
	ID   string                              `json:"id,required"`
	JSON pricePackagePriceBillableMetricJSON `json:"-"`
}

func (*PricePackagePriceBillableMetric) UnmarshalJSON

func (r *PricePackagePriceBillableMetric) UnmarshalJSON(data []byte) (err error)

type PricePackagePriceCadence

type PricePackagePriceCadence string
const (
	PricePackagePriceCadenceOneTime   PricePackagePriceCadence = "one_time"
	PricePackagePriceCadenceMonthly   PricePackagePriceCadence = "monthly"
	PricePackagePriceCadenceQuarterly PricePackagePriceCadence = "quarterly"
	PricePackagePriceCadenceAnnual    PricePackagePriceCadence = "annual"
)

func (PricePackagePriceCadence) IsKnown added in v0.24.0

func (r PricePackagePriceCadence) IsKnown() bool

type PricePackagePriceItem

type PricePackagePriceItem struct {
	ID   string                    `json:"id,required"`
	Name string                    `json:"name,required"`
	JSON pricePackagePriceItemJSON `json:"-"`
}

func (*PricePackagePriceItem) UnmarshalJSON

func (r *PricePackagePriceItem) UnmarshalJSON(data []byte) (err error)

type PricePackagePriceMaximum

type PricePackagePriceMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                       `json:"maximum_amount,required"`
	JSON          pricePackagePriceMaximumJSON `json:"-"`
}

func (*PricePackagePriceMaximum) UnmarshalJSON

func (r *PricePackagePriceMaximum) UnmarshalJSON(data []byte) (err error)

type PricePackagePriceMinimum

type PricePackagePriceMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                       `json:"minimum_amount,required"`
	JSON          pricePackagePriceMinimumJSON `json:"-"`
}

func (*PricePackagePriceMinimum) UnmarshalJSON

func (r *PricePackagePriceMinimum) UnmarshalJSON(data []byte) (err error)

type PricePackagePriceModelType

type PricePackagePriceModelType string
const (
	PricePackagePriceModelTypePackage PricePackagePriceModelType = "package"
)

func (PricePackagePriceModelType) IsKnown added in v0.24.0

func (r PricePackagePriceModelType) IsKnown() bool

type PricePackagePricePackageConfig

type PricePackagePricePackageConfig struct {
	// A currency amount to rate usage by
	PackageAmount string `json:"package_amount,required"`
	// An integer amount to represent package size. For example, 1000 here would divide
	// usage by 1000 before multiplying by package_amount in rating
	PackageSize int64                              `json:"package_size,nullable"`
	JSON        pricePackagePricePackageConfigJSON `json:"-"`
}

func (*PricePackagePricePackageConfig) UnmarshalJSON

func (r *PricePackagePricePackageConfig) UnmarshalJSON(data []byte) (err error)

type PricePackagePricePriceType

type PricePackagePricePriceType string
const (
	PricePackagePricePriceTypeUsagePrice PricePackagePricePriceType = "usage_price"
	PricePackagePricePriceTypeFixedPrice PricePackagePricePriceType = "fixed_price"
)

func (PricePackagePricePriceType) IsKnown added in v0.24.0

func (r PricePackagePricePriceType) IsKnown() bool

type PricePackageWithAllocationPrice

type PricePackageWithAllocationPrice struct {
	ID                          string                                        `json:"id,required"`
	BillableMetric              PricePackageWithAllocationPriceBillableMetric `json:"billable_metric,required,nullable"`
	Cadence                     PricePackageWithAllocationPriceCadence        `json:"cadence,required"`
	CreatedAt                   time.Time                                     `json:"created_at,required" format:"date-time"`
	Currency                    string                                        `json:"currency,required"`
	Discount                    shared.Discount                               `json:"discount,required,nullable"`
	ExternalPriceID             string                                        `json:"external_price_id,required,nullable"`
	FixedPriceQuantity          float64                                       `json:"fixed_price_quantity,required,nullable"`
	Item                        PricePackageWithAllocationPriceItem           `json:"item,required"`
	Maximum                     PricePackageWithAllocationPriceMaximum        `json:"maximum,required,nullable"`
	MaximumAmount               string                                        `json:"maximum_amount,required,nullable"`
	Minimum                     PricePackageWithAllocationPriceMinimum        `json:"minimum,required,nullable"`
	MinimumAmount               string                                        `json:"minimum_amount,required,nullable"`
	ModelType                   PricePackageWithAllocationPriceModelType      `json:"model_type,required"`
	Name                        string                                        `json:"name,required"`
	PackageWithAllocationConfig map[string]interface{}                        `json:"package_with_allocation_config,required"`
	PlanPhaseOrder              int64                                         `json:"plan_phase_order,required,nullable"`
	PriceType                   PricePackageWithAllocationPricePriceType      `json:"price_type,required"`
	JSON                        pricePackageWithAllocationPriceJSON           `json:"-"`
}

func (*PricePackageWithAllocationPrice) UnmarshalJSON

func (r *PricePackageWithAllocationPrice) UnmarshalJSON(data []byte) (err error)

type PricePackageWithAllocationPriceBillableMetric

type PricePackageWithAllocationPriceBillableMetric struct {
	ID   string                                            `json:"id,required"`
	JSON pricePackageWithAllocationPriceBillableMetricJSON `json:"-"`
}

func (*PricePackageWithAllocationPriceBillableMetric) UnmarshalJSON

func (r *PricePackageWithAllocationPriceBillableMetric) UnmarshalJSON(data []byte) (err error)

type PricePackageWithAllocationPriceCadence

type PricePackageWithAllocationPriceCadence string
const (
	PricePackageWithAllocationPriceCadenceOneTime   PricePackageWithAllocationPriceCadence = "one_time"
	PricePackageWithAllocationPriceCadenceMonthly   PricePackageWithAllocationPriceCadence = "monthly"
	PricePackageWithAllocationPriceCadenceQuarterly PricePackageWithAllocationPriceCadence = "quarterly"
	PricePackageWithAllocationPriceCadenceAnnual    PricePackageWithAllocationPriceCadence = "annual"
)

func (PricePackageWithAllocationPriceCadence) IsKnown added in v0.24.0

type PricePackageWithAllocationPriceItem

type PricePackageWithAllocationPriceItem struct {
	ID   string                                  `json:"id,required"`
	Name string                                  `json:"name,required"`
	JSON pricePackageWithAllocationPriceItemJSON `json:"-"`
}

func (*PricePackageWithAllocationPriceItem) UnmarshalJSON

func (r *PricePackageWithAllocationPriceItem) UnmarshalJSON(data []byte) (err error)

type PricePackageWithAllocationPriceMaximum

type PricePackageWithAllocationPriceMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                                     `json:"maximum_amount,required"`
	JSON          pricePackageWithAllocationPriceMaximumJSON `json:"-"`
}

func (*PricePackageWithAllocationPriceMaximum) UnmarshalJSON

func (r *PricePackageWithAllocationPriceMaximum) UnmarshalJSON(data []byte) (err error)

type PricePackageWithAllocationPriceMinimum

type PricePackageWithAllocationPriceMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                                     `json:"minimum_amount,required"`
	JSON          pricePackageWithAllocationPriceMinimumJSON `json:"-"`
}

func (*PricePackageWithAllocationPriceMinimum) UnmarshalJSON

func (r *PricePackageWithAllocationPriceMinimum) UnmarshalJSON(data []byte) (err error)

type PricePackageWithAllocationPriceModelType

type PricePackageWithAllocationPriceModelType string
const (
	PricePackageWithAllocationPriceModelTypePackageWithAllocation PricePackageWithAllocationPriceModelType = "package_with_allocation"
)

func (PricePackageWithAllocationPriceModelType) IsKnown added in v0.24.0

type PricePackageWithAllocationPricePriceType

type PricePackageWithAllocationPricePriceType string
const (
	PricePackageWithAllocationPricePriceTypeUsagePrice PricePackageWithAllocationPricePriceType = "usage_price"
	PricePackageWithAllocationPricePriceTypeFixedPrice PricePackageWithAllocationPricePriceType = "fixed_price"
)

func (PricePackageWithAllocationPricePriceType) IsKnown added in v0.24.0

type PriceService

type PriceService struct {
	Options         []option.RequestOption
	ExternalPriceID *PriceExternalPriceIDService
}

PriceService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPriceService method instead.

func NewPriceService

func NewPriceService(opts ...option.RequestOption) (r *PriceService)

NewPriceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PriceService) Fetch

func (r *PriceService) Fetch(ctx context.Context, priceID string, opts ...option.RequestOption) (res *Price, err error)

This endpoint returns a price given an identifier.

func (*PriceService) List

func (r *PriceService) List(ctx context.Context, query PriceListParams, opts ...option.RequestOption) (res *shared.Page[Price], err error)

This endpoint is used to list all add-on prices created using the [price creation endpoint](../reference/create-price).

func (*PriceService) ListAutoPaging

func (r *PriceService) ListAutoPaging(ctx context.Context, query PriceListParams, opts ...option.RequestOption) *shared.PageAutoPager[Price]

This endpoint is used to list all add-on prices created using the [price creation endpoint](../reference/create-price).

func (*PriceService) New

func (r *PriceService) New(ctx context.Context, body PriceNewParams, opts ...option.RequestOption) (res *Price, err error)

This endpoint is used to create a [price](../reference/price). A price created using this endpoint is always an add-on, meaning that it’s not associated with a specific plan and can instead be individually added to subscriptions, including subscriptions on different plans.

An `external_price_id` can be optionally specified as an alias to allow ergonomic interaction with prices in the Orb API.

See the [Price resource](../reference/price) for the specification of different price model configurations possible in this endpoint.

type PriceThresholdTotalAmountPrice

type PriceThresholdTotalAmountPrice struct {
	ID                         string                                       `json:"id,required"`
	BillableMetric             PriceThresholdTotalAmountPriceBillableMetric `json:"billable_metric,required,nullable"`
	Cadence                    PriceThresholdTotalAmountPriceCadence        `json:"cadence,required"`
	CreatedAt                  time.Time                                    `json:"created_at,required" format:"date-time"`
	Currency                   string                                       `json:"currency,required"`
	Discount                   shared.Discount                              `json:"discount,required,nullable"`
	ExternalPriceID            string                                       `json:"external_price_id,required,nullable"`
	FixedPriceQuantity         float64                                      `json:"fixed_price_quantity,required,nullable"`
	Item                       PriceThresholdTotalAmountPriceItem           `json:"item,required"`
	Maximum                    PriceThresholdTotalAmountPriceMaximum        `json:"maximum,required,nullable"`
	MaximumAmount              string                                       `json:"maximum_amount,required,nullable"`
	Minimum                    PriceThresholdTotalAmountPriceMinimum        `json:"minimum,required,nullable"`
	MinimumAmount              string                                       `json:"minimum_amount,required,nullable"`
	ModelType                  PriceThresholdTotalAmountPriceModelType      `json:"model_type,required"`
	Name                       string                                       `json:"name,required"`
	PlanPhaseOrder             int64                                        `json:"plan_phase_order,required,nullable"`
	PriceType                  PriceThresholdTotalAmountPricePriceType      `json:"price_type,required"`
	ThresholdTotalAmountConfig map[string]interface{}                       `json:"threshold_total_amount_config,required"`
	JSON                       priceThresholdTotalAmountPriceJSON           `json:"-"`
}

func (*PriceThresholdTotalAmountPrice) UnmarshalJSON

func (r *PriceThresholdTotalAmountPrice) UnmarshalJSON(data []byte) (err error)

type PriceThresholdTotalAmountPriceBillableMetric

type PriceThresholdTotalAmountPriceBillableMetric struct {
	ID   string                                           `json:"id,required"`
	JSON priceThresholdTotalAmountPriceBillableMetricJSON `json:"-"`
}

func (*PriceThresholdTotalAmountPriceBillableMetric) UnmarshalJSON

func (r *PriceThresholdTotalAmountPriceBillableMetric) UnmarshalJSON(data []byte) (err error)

type PriceThresholdTotalAmountPriceCadence

type PriceThresholdTotalAmountPriceCadence string
const (
	PriceThresholdTotalAmountPriceCadenceOneTime   PriceThresholdTotalAmountPriceCadence = "one_time"
	PriceThresholdTotalAmountPriceCadenceMonthly   PriceThresholdTotalAmountPriceCadence = "monthly"
	PriceThresholdTotalAmountPriceCadenceQuarterly PriceThresholdTotalAmountPriceCadence = "quarterly"
	PriceThresholdTotalAmountPriceCadenceAnnual    PriceThresholdTotalAmountPriceCadence = "annual"
)

func (PriceThresholdTotalAmountPriceCadence) IsKnown added in v0.24.0

type PriceThresholdTotalAmountPriceItem

type PriceThresholdTotalAmountPriceItem struct {
	ID   string                                 `json:"id,required"`
	Name string                                 `json:"name,required"`
	JSON priceThresholdTotalAmountPriceItemJSON `json:"-"`
}

func (*PriceThresholdTotalAmountPriceItem) UnmarshalJSON

func (r *PriceThresholdTotalAmountPriceItem) UnmarshalJSON(data []byte) (err error)

type PriceThresholdTotalAmountPriceMaximum

type PriceThresholdTotalAmountPriceMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                                    `json:"maximum_amount,required"`
	JSON          priceThresholdTotalAmountPriceMaximumJSON `json:"-"`
}

func (*PriceThresholdTotalAmountPriceMaximum) UnmarshalJSON

func (r *PriceThresholdTotalAmountPriceMaximum) UnmarshalJSON(data []byte) (err error)

type PriceThresholdTotalAmountPriceMinimum

type PriceThresholdTotalAmountPriceMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                                    `json:"minimum_amount,required"`
	JSON          priceThresholdTotalAmountPriceMinimumJSON `json:"-"`
}

func (*PriceThresholdTotalAmountPriceMinimum) UnmarshalJSON

func (r *PriceThresholdTotalAmountPriceMinimum) UnmarshalJSON(data []byte) (err error)

type PriceThresholdTotalAmountPriceModelType

type PriceThresholdTotalAmountPriceModelType string
const (
	PriceThresholdTotalAmountPriceModelTypeThresholdTotalAmount PriceThresholdTotalAmountPriceModelType = "threshold_total_amount"
)

func (PriceThresholdTotalAmountPriceModelType) IsKnown added in v0.24.0

type PriceThresholdTotalAmountPricePriceType

type PriceThresholdTotalAmountPricePriceType string
const (
	PriceThresholdTotalAmountPricePriceTypeUsagePrice PriceThresholdTotalAmountPricePriceType = "usage_price"
	PriceThresholdTotalAmountPricePriceTypeFixedPrice PriceThresholdTotalAmountPricePriceType = "fixed_price"
)

func (PriceThresholdTotalAmountPricePriceType) IsKnown added in v0.24.0

type PriceTieredBpsPrice

type PriceTieredBpsPrice struct {
	ID                 string                             `json:"id,required"`
	BillableMetric     PriceTieredBpsPriceBillableMetric  `json:"billable_metric,required,nullable"`
	Cadence            PriceTieredBpsPriceCadence         `json:"cadence,required"`
	CreatedAt          time.Time                          `json:"created_at,required" format:"date-time"`
	Currency           string                             `json:"currency,required"`
	Discount           shared.Discount                    `json:"discount,required,nullable"`
	ExternalPriceID    string                             `json:"external_price_id,required,nullable"`
	FixedPriceQuantity float64                            `json:"fixed_price_quantity,required,nullable"`
	Item               PriceTieredBpsPriceItem            `json:"item,required"`
	Maximum            PriceTieredBpsPriceMaximum         `json:"maximum,required,nullable"`
	MaximumAmount      string                             `json:"maximum_amount,required,nullable"`
	Minimum            PriceTieredBpsPriceMinimum         `json:"minimum,required,nullable"`
	MinimumAmount      string                             `json:"minimum_amount,required,nullable"`
	ModelType          PriceTieredBpsPriceModelType       `json:"model_type,required"`
	Name               string                             `json:"name,required"`
	PlanPhaseOrder     int64                              `json:"plan_phase_order,required,nullable"`
	PriceType          PriceTieredBpsPricePriceType       `json:"price_type,required"`
	TieredBpsConfig    PriceTieredBpsPriceTieredBpsConfig `json:"tiered_bps_config,required"`
	JSON               priceTieredBpsPriceJSON            `json:"-"`
}

func (*PriceTieredBpsPrice) UnmarshalJSON

func (r *PriceTieredBpsPrice) UnmarshalJSON(data []byte) (err error)

type PriceTieredBpsPriceBillableMetric

type PriceTieredBpsPriceBillableMetric struct {
	ID   string                                `json:"id,required"`
	JSON priceTieredBpsPriceBillableMetricJSON `json:"-"`
}

func (*PriceTieredBpsPriceBillableMetric) UnmarshalJSON

func (r *PriceTieredBpsPriceBillableMetric) UnmarshalJSON(data []byte) (err error)

type PriceTieredBpsPriceCadence

type PriceTieredBpsPriceCadence string
const (
	PriceTieredBpsPriceCadenceOneTime   PriceTieredBpsPriceCadence = "one_time"
	PriceTieredBpsPriceCadenceMonthly   PriceTieredBpsPriceCadence = "monthly"
	PriceTieredBpsPriceCadenceQuarterly PriceTieredBpsPriceCadence = "quarterly"
	PriceTieredBpsPriceCadenceAnnual    PriceTieredBpsPriceCadence = "annual"
)

func (PriceTieredBpsPriceCadence) IsKnown added in v0.24.0

func (r PriceTieredBpsPriceCadence) IsKnown() bool

type PriceTieredBpsPriceItem

type PriceTieredBpsPriceItem struct {
	ID   string                      `json:"id,required"`
	Name string                      `json:"name,required"`
	JSON priceTieredBpsPriceItemJSON `json:"-"`
}

func (*PriceTieredBpsPriceItem) UnmarshalJSON

func (r *PriceTieredBpsPriceItem) UnmarshalJSON(data []byte) (err error)

type PriceTieredBpsPriceMaximum

type PriceTieredBpsPriceMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                         `json:"maximum_amount,required"`
	JSON          priceTieredBpsPriceMaximumJSON `json:"-"`
}

func (*PriceTieredBpsPriceMaximum) UnmarshalJSON

func (r *PriceTieredBpsPriceMaximum) UnmarshalJSON(data []byte) (err error)

type PriceTieredBpsPriceMinimum

type PriceTieredBpsPriceMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                         `json:"minimum_amount,required"`
	JSON          priceTieredBpsPriceMinimumJSON `json:"-"`
}

func (*PriceTieredBpsPriceMinimum) UnmarshalJSON

func (r *PriceTieredBpsPriceMinimum) UnmarshalJSON(data []byte) (err error)

type PriceTieredBpsPriceModelType

type PriceTieredBpsPriceModelType string
const (
	PriceTieredBpsPriceModelTypeTieredBps PriceTieredBpsPriceModelType = "tiered_bps"
)

func (PriceTieredBpsPriceModelType) IsKnown added in v0.24.0

func (r PriceTieredBpsPriceModelType) IsKnown() bool

type PriceTieredBpsPricePriceType

type PriceTieredBpsPricePriceType string
const (
	PriceTieredBpsPricePriceTypeUsagePrice PriceTieredBpsPricePriceType = "usage_price"
	PriceTieredBpsPricePriceTypeFixedPrice PriceTieredBpsPricePriceType = "fixed_price"
)

func (PriceTieredBpsPricePriceType) IsKnown added in v0.24.0

func (r PriceTieredBpsPricePriceType) IsKnown() bool

type PriceTieredBpsPriceTieredBpsConfig

type PriceTieredBpsPriceTieredBpsConfig struct {
	// Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
	// tiers
	Tiers []PriceTieredBpsPriceTieredBpsConfigTier `json:"tiers,required"`
	JSON  priceTieredBpsPriceTieredBpsConfigJSON   `json:"-"`
}

func (*PriceTieredBpsPriceTieredBpsConfig) UnmarshalJSON

func (r *PriceTieredBpsPriceTieredBpsConfig) UnmarshalJSON(data []byte) (err error)

type PriceTieredBpsPriceTieredBpsConfigTier

type PriceTieredBpsPriceTieredBpsConfigTier struct {
	// Per-event basis point rate
	Bps float64 `json:"bps,required"`
	// Inclusive tier starting value
	MinimumAmount string `json:"minimum_amount,required"`
	// Exclusive tier ending value
	MaximumAmount string `json:"maximum_amount,nullable"`
	// Per unit maximum to charge
	PerUnitMaximum string                                     `json:"per_unit_maximum,nullable"`
	JSON           priceTieredBpsPriceTieredBpsConfigTierJSON `json:"-"`
}

func (*PriceTieredBpsPriceTieredBpsConfigTier) UnmarshalJSON

func (r *PriceTieredBpsPriceTieredBpsConfigTier) UnmarshalJSON(data []byte) (err error)

type PriceTieredPackagePrice

type PriceTieredPackagePrice struct {
	ID                  string                                `json:"id,required"`
	BillableMetric      PriceTieredPackagePriceBillableMetric `json:"billable_metric,required,nullable"`
	Cadence             PriceTieredPackagePriceCadence        `json:"cadence,required"`
	CreatedAt           time.Time                             `json:"created_at,required" format:"date-time"`
	Currency            string                                `json:"currency,required"`
	Discount            shared.Discount                       `json:"discount,required,nullable"`
	ExternalPriceID     string                                `json:"external_price_id,required,nullable"`
	FixedPriceQuantity  float64                               `json:"fixed_price_quantity,required,nullable"`
	Item                PriceTieredPackagePriceItem           `json:"item,required"`
	Maximum             PriceTieredPackagePriceMaximum        `json:"maximum,required,nullable"`
	MaximumAmount       string                                `json:"maximum_amount,required,nullable"`
	Minimum             PriceTieredPackagePriceMinimum        `json:"minimum,required,nullable"`
	MinimumAmount       string                                `json:"minimum_amount,required,nullable"`
	ModelType           PriceTieredPackagePriceModelType      `json:"model_type,required"`
	Name                string                                `json:"name,required"`
	PlanPhaseOrder      int64                                 `json:"plan_phase_order,required,nullable"`
	PriceType           PriceTieredPackagePricePriceType      `json:"price_type,required"`
	TieredPackageConfig map[string]interface{}                `json:"tiered_package_config,required"`
	JSON                priceTieredPackagePriceJSON           `json:"-"`
}

func (*PriceTieredPackagePrice) UnmarshalJSON

func (r *PriceTieredPackagePrice) UnmarshalJSON(data []byte) (err error)

type PriceTieredPackagePriceBillableMetric

type PriceTieredPackagePriceBillableMetric struct {
	ID   string                                    `json:"id,required"`
	JSON priceTieredPackagePriceBillableMetricJSON `json:"-"`
}

func (*PriceTieredPackagePriceBillableMetric) UnmarshalJSON

func (r *PriceTieredPackagePriceBillableMetric) UnmarshalJSON(data []byte) (err error)

type PriceTieredPackagePriceCadence

type PriceTieredPackagePriceCadence string
const (
	PriceTieredPackagePriceCadenceOneTime   PriceTieredPackagePriceCadence = "one_time"
	PriceTieredPackagePriceCadenceMonthly   PriceTieredPackagePriceCadence = "monthly"
	PriceTieredPackagePriceCadenceQuarterly PriceTieredPackagePriceCadence = "quarterly"
	PriceTieredPackagePriceCadenceAnnual    PriceTieredPackagePriceCadence = "annual"
)

func (PriceTieredPackagePriceCadence) IsKnown added in v0.24.0

type PriceTieredPackagePriceItem

type PriceTieredPackagePriceItem struct {
	ID   string                          `json:"id,required"`
	Name string                          `json:"name,required"`
	JSON priceTieredPackagePriceItemJSON `json:"-"`
}

func (*PriceTieredPackagePriceItem) UnmarshalJSON

func (r *PriceTieredPackagePriceItem) UnmarshalJSON(data []byte) (err error)

type PriceTieredPackagePriceMaximum

type PriceTieredPackagePriceMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                             `json:"maximum_amount,required"`
	JSON          priceTieredPackagePriceMaximumJSON `json:"-"`
}

func (*PriceTieredPackagePriceMaximum) UnmarshalJSON

func (r *PriceTieredPackagePriceMaximum) UnmarshalJSON(data []byte) (err error)

type PriceTieredPackagePriceMinimum

type PriceTieredPackagePriceMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                             `json:"minimum_amount,required"`
	JSON          priceTieredPackagePriceMinimumJSON `json:"-"`
}

func (*PriceTieredPackagePriceMinimum) UnmarshalJSON

func (r *PriceTieredPackagePriceMinimum) UnmarshalJSON(data []byte) (err error)

type PriceTieredPackagePriceModelType

type PriceTieredPackagePriceModelType string
const (
	PriceTieredPackagePriceModelTypeTieredPackage PriceTieredPackagePriceModelType = "tiered_package"
)

func (PriceTieredPackagePriceModelType) IsKnown added in v0.24.0

type PriceTieredPackagePricePriceType

type PriceTieredPackagePricePriceType string
const (
	PriceTieredPackagePricePriceTypeUsagePrice PriceTieredPackagePricePriceType = "usage_price"
	PriceTieredPackagePricePriceTypeFixedPrice PriceTieredPackagePricePriceType = "fixed_price"
)

func (PriceTieredPackagePricePriceType) IsKnown added in v0.24.0

type PriceTieredPrice

type PriceTieredPrice struct {
	ID                 string                         `json:"id,required"`
	BillableMetric     PriceTieredPriceBillableMetric `json:"billable_metric,required,nullable"`
	Cadence            PriceTieredPriceCadence        `json:"cadence,required"`
	CreatedAt          time.Time                      `json:"created_at,required" format:"date-time"`
	Currency           string                         `json:"currency,required"`
	Discount           shared.Discount                `json:"discount,required,nullable"`
	ExternalPriceID    string                         `json:"external_price_id,required,nullable"`
	FixedPriceQuantity float64                        `json:"fixed_price_quantity,required,nullable"`
	Item               PriceTieredPriceItem           `json:"item,required"`
	Maximum            PriceTieredPriceMaximum        `json:"maximum,required,nullable"`
	MaximumAmount      string                         `json:"maximum_amount,required,nullable"`
	Minimum            PriceTieredPriceMinimum        `json:"minimum,required,nullable"`
	MinimumAmount      string                         `json:"minimum_amount,required,nullable"`
	ModelType          PriceTieredPriceModelType      `json:"model_type,required"`
	Name               string                         `json:"name,required"`
	PlanPhaseOrder     int64                          `json:"plan_phase_order,required,nullable"`
	PriceType          PriceTieredPricePriceType      `json:"price_type,required"`
	TieredConfig       PriceTieredPriceTieredConfig   `json:"tiered_config,required"`
	JSON               priceTieredPriceJSON           `json:"-"`
}

func (*PriceTieredPrice) UnmarshalJSON

func (r *PriceTieredPrice) UnmarshalJSON(data []byte) (err error)

type PriceTieredPriceBillableMetric

type PriceTieredPriceBillableMetric struct {
	ID   string                             `json:"id,required"`
	JSON priceTieredPriceBillableMetricJSON `json:"-"`
}

func (*PriceTieredPriceBillableMetric) UnmarshalJSON

func (r *PriceTieredPriceBillableMetric) UnmarshalJSON(data []byte) (err error)

type PriceTieredPriceCadence

type PriceTieredPriceCadence string
const (
	PriceTieredPriceCadenceOneTime   PriceTieredPriceCadence = "one_time"
	PriceTieredPriceCadenceMonthly   PriceTieredPriceCadence = "monthly"
	PriceTieredPriceCadenceQuarterly PriceTieredPriceCadence = "quarterly"
	PriceTieredPriceCadenceAnnual    PriceTieredPriceCadence = "annual"
)

func (PriceTieredPriceCadence) IsKnown added in v0.24.0

func (r PriceTieredPriceCadence) IsKnown() bool

type PriceTieredPriceItem

type PriceTieredPriceItem struct {
	ID   string                   `json:"id,required"`
	Name string                   `json:"name,required"`
	JSON priceTieredPriceItemJSON `json:"-"`
}

func (*PriceTieredPriceItem) UnmarshalJSON

func (r *PriceTieredPriceItem) UnmarshalJSON(data []byte) (err error)

type PriceTieredPriceMaximum

type PriceTieredPriceMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                      `json:"maximum_amount,required"`
	JSON          priceTieredPriceMaximumJSON `json:"-"`
}

func (*PriceTieredPriceMaximum) UnmarshalJSON

func (r *PriceTieredPriceMaximum) UnmarshalJSON(data []byte) (err error)

type PriceTieredPriceMinimum

type PriceTieredPriceMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                      `json:"minimum_amount,required"`
	JSON          priceTieredPriceMinimumJSON `json:"-"`
}

func (*PriceTieredPriceMinimum) UnmarshalJSON

func (r *PriceTieredPriceMinimum) UnmarshalJSON(data []byte) (err error)

type PriceTieredPriceModelType

type PriceTieredPriceModelType string
const (
	PriceTieredPriceModelTypeTiered PriceTieredPriceModelType = "tiered"
)

func (PriceTieredPriceModelType) IsKnown added in v0.24.0

func (r PriceTieredPriceModelType) IsKnown() bool

type PriceTieredPricePriceType

type PriceTieredPricePriceType string
const (
	PriceTieredPricePriceTypeUsagePrice PriceTieredPricePriceType = "usage_price"
	PriceTieredPricePriceTypeFixedPrice PriceTieredPricePriceType = "fixed_price"
)

func (PriceTieredPricePriceType) IsKnown added in v0.24.0

func (r PriceTieredPricePriceType) IsKnown() bool

type PriceTieredPriceTieredConfig

type PriceTieredPriceTieredConfig struct {
	// Tiers for rating based on total usage quantities into the specified tier
	Tiers []PriceTieredPriceTieredConfigTier `json:"tiers,required"`
	JSON  priceTieredPriceTieredConfigJSON   `json:"-"`
}

func (*PriceTieredPriceTieredConfig) UnmarshalJSON

func (r *PriceTieredPriceTieredConfig) UnmarshalJSON(data []byte) (err error)

type PriceTieredPriceTieredConfigTier

type PriceTieredPriceTieredConfigTier struct {
	// Inclusive tier starting value
	FirstUnit float64 `json:"first_unit,required"`
	// Amount per unit
	UnitAmount string `json:"unit_amount,required"`
	// Exclusive tier ending value. If null, this is treated as the last tier
	LastUnit float64                              `json:"last_unit,nullable"`
	JSON     priceTieredPriceTieredConfigTierJSON `json:"-"`
}

func (*PriceTieredPriceTieredConfigTier) UnmarshalJSON

func (r *PriceTieredPriceTieredConfigTier) UnmarshalJSON(data []byte) (err error)

type PriceTieredWithMinimumPrice

type PriceTieredWithMinimumPrice struct {
	ID                      string                                    `json:"id,required"`
	BillableMetric          PriceTieredWithMinimumPriceBillableMetric `json:"billable_metric,required,nullable"`
	Cadence                 PriceTieredWithMinimumPriceCadence        `json:"cadence,required"`
	CreatedAt               time.Time                                 `json:"created_at,required" format:"date-time"`
	Currency                string                                    `json:"currency,required"`
	Discount                shared.Discount                           `json:"discount,required,nullable"`
	ExternalPriceID         string                                    `json:"external_price_id,required,nullable"`
	FixedPriceQuantity      float64                                   `json:"fixed_price_quantity,required,nullable"`
	Item                    PriceTieredWithMinimumPriceItem           `json:"item,required"`
	Maximum                 PriceTieredWithMinimumPriceMaximum        `json:"maximum,required,nullable"`
	MaximumAmount           string                                    `json:"maximum_amount,required,nullable"`
	Minimum                 PriceTieredWithMinimumPriceMinimum        `json:"minimum,required,nullable"`
	MinimumAmount           string                                    `json:"minimum_amount,required,nullable"`
	ModelType               PriceTieredWithMinimumPriceModelType      `json:"model_type,required"`
	Name                    string                                    `json:"name,required"`
	PlanPhaseOrder          int64                                     `json:"plan_phase_order,required,nullable"`
	PriceType               PriceTieredWithMinimumPricePriceType      `json:"price_type,required"`
	TieredWithMinimumConfig map[string]interface{}                    `json:"tiered_with_minimum_config,required"`
	JSON                    priceTieredWithMinimumPriceJSON           `json:"-"`
}

func (*PriceTieredWithMinimumPrice) UnmarshalJSON

func (r *PriceTieredWithMinimumPrice) UnmarshalJSON(data []byte) (err error)

type PriceTieredWithMinimumPriceBillableMetric

type PriceTieredWithMinimumPriceBillableMetric struct {
	ID   string                                        `json:"id,required"`
	JSON priceTieredWithMinimumPriceBillableMetricJSON `json:"-"`
}

func (*PriceTieredWithMinimumPriceBillableMetric) UnmarshalJSON

func (r *PriceTieredWithMinimumPriceBillableMetric) UnmarshalJSON(data []byte) (err error)

type PriceTieredWithMinimumPriceCadence

type PriceTieredWithMinimumPriceCadence string
const (
	PriceTieredWithMinimumPriceCadenceOneTime   PriceTieredWithMinimumPriceCadence = "one_time"
	PriceTieredWithMinimumPriceCadenceMonthly   PriceTieredWithMinimumPriceCadence = "monthly"
	PriceTieredWithMinimumPriceCadenceQuarterly PriceTieredWithMinimumPriceCadence = "quarterly"
	PriceTieredWithMinimumPriceCadenceAnnual    PriceTieredWithMinimumPriceCadence = "annual"
)

func (PriceTieredWithMinimumPriceCadence) IsKnown added in v0.24.0

type PriceTieredWithMinimumPriceItem

type PriceTieredWithMinimumPriceItem struct {
	ID   string                              `json:"id,required"`
	Name string                              `json:"name,required"`
	JSON priceTieredWithMinimumPriceItemJSON `json:"-"`
}

func (*PriceTieredWithMinimumPriceItem) UnmarshalJSON

func (r *PriceTieredWithMinimumPriceItem) UnmarshalJSON(data []byte) (err error)

type PriceTieredWithMinimumPriceMaximum

type PriceTieredWithMinimumPriceMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                                 `json:"maximum_amount,required"`
	JSON          priceTieredWithMinimumPriceMaximumJSON `json:"-"`
}

func (*PriceTieredWithMinimumPriceMaximum) UnmarshalJSON

func (r *PriceTieredWithMinimumPriceMaximum) UnmarshalJSON(data []byte) (err error)

type PriceTieredWithMinimumPriceMinimum

type PriceTieredWithMinimumPriceMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                                 `json:"minimum_amount,required"`
	JSON          priceTieredWithMinimumPriceMinimumJSON `json:"-"`
}

func (*PriceTieredWithMinimumPriceMinimum) UnmarshalJSON

func (r *PriceTieredWithMinimumPriceMinimum) UnmarshalJSON(data []byte) (err error)

type PriceTieredWithMinimumPriceModelType

type PriceTieredWithMinimumPriceModelType string
const (
	PriceTieredWithMinimumPriceModelTypeTieredWithMinimum PriceTieredWithMinimumPriceModelType = "tiered_with_minimum"
)

func (PriceTieredWithMinimumPriceModelType) IsKnown added in v0.24.0

type PriceTieredWithMinimumPricePriceType

type PriceTieredWithMinimumPricePriceType string
const (
	PriceTieredWithMinimumPricePriceTypeUsagePrice PriceTieredWithMinimumPricePriceType = "usage_price"
	PriceTieredWithMinimumPricePriceTypeFixedPrice PriceTieredWithMinimumPricePriceType = "fixed_price"
)

func (PriceTieredWithMinimumPricePriceType) IsKnown added in v0.24.0

type PriceUnitPrice

type PriceUnitPrice struct {
	ID                 string                       `json:"id,required"`
	BillableMetric     PriceUnitPriceBillableMetric `json:"billable_metric,required,nullable"`
	Cadence            PriceUnitPriceCadence        `json:"cadence,required"`
	CreatedAt          time.Time                    `json:"created_at,required" format:"date-time"`
	Currency           string                       `json:"currency,required"`
	Discount           shared.Discount              `json:"discount,required,nullable"`
	ExternalPriceID    string                       `json:"external_price_id,required,nullable"`
	FixedPriceQuantity float64                      `json:"fixed_price_quantity,required,nullable"`
	Item               PriceUnitPriceItem           `json:"item,required"`
	Maximum            PriceUnitPriceMaximum        `json:"maximum,required,nullable"`
	MaximumAmount      string                       `json:"maximum_amount,required,nullable"`
	Minimum            PriceUnitPriceMinimum        `json:"minimum,required,nullable"`
	MinimumAmount      string                       `json:"minimum_amount,required,nullable"`
	ModelType          PriceUnitPriceModelType      `json:"model_type,required"`
	Name               string                       `json:"name,required"`
	PlanPhaseOrder     int64                        `json:"plan_phase_order,required,nullable"`
	PriceType          PriceUnitPricePriceType      `json:"price_type,required"`
	UnitConfig         PriceUnitPriceUnitConfig     `json:"unit_config,required"`
	JSON               priceUnitPriceJSON           `json:"-"`
}

func (*PriceUnitPrice) UnmarshalJSON

func (r *PriceUnitPrice) UnmarshalJSON(data []byte) (err error)

type PriceUnitPriceBillableMetric

type PriceUnitPriceBillableMetric struct {
	ID   string                           `json:"id,required"`
	JSON priceUnitPriceBillableMetricJSON `json:"-"`
}

func (*PriceUnitPriceBillableMetric) UnmarshalJSON

func (r *PriceUnitPriceBillableMetric) UnmarshalJSON(data []byte) (err error)

type PriceUnitPriceCadence

type PriceUnitPriceCadence string
const (
	PriceUnitPriceCadenceOneTime   PriceUnitPriceCadence = "one_time"
	PriceUnitPriceCadenceMonthly   PriceUnitPriceCadence = "monthly"
	PriceUnitPriceCadenceQuarterly PriceUnitPriceCadence = "quarterly"
	PriceUnitPriceCadenceAnnual    PriceUnitPriceCadence = "annual"
)

func (PriceUnitPriceCadence) IsKnown added in v0.24.0

func (r PriceUnitPriceCadence) IsKnown() bool

type PriceUnitPriceItem

type PriceUnitPriceItem struct {
	ID   string                 `json:"id,required"`
	Name string                 `json:"name,required"`
	JSON priceUnitPriceItemJSON `json:"-"`
}

func (*PriceUnitPriceItem) UnmarshalJSON

func (r *PriceUnitPriceItem) UnmarshalJSON(data []byte) (err error)

type PriceUnitPriceMaximum

type PriceUnitPriceMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                    `json:"maximum_amount,required"`
	JSON          priceUnitPriceMaximumJSON `json:"-"`
}

func (*PriceUnitPriceMaximum) UnmarshalJSON

func (r *PriceUnitPriceMaximum) UnmarshalJSON(data []byte) (err error)

type PriceUnitPriceMinimum

type PriceUnitPriceMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                    `json:"minimum_amount,required"`
	JSON          priceUnitPriceMinimumJSON `json:"-"`
}

func (*PriceUnitPriceMinimum) UnmarshalJSON

func (r *PriceUnitPriceMinimum) UnmarshalJSON(data []byte) (err error)

type PriceUnitPriceModelType

type PriceUnitPriceModelType string
const (
	PriceUnitPriceModelTypeUnit PriceUnitPriceModelType = "unit"
)

func (PriceUnitPriceModelType) IsKnown added in v0.24.0

func (r PriceUnitPriceModelType) IsKnown() bool

type PriceUnitPricePriceType

type PriceUnitPricePriceType string
const (
	PriceUnitPricePriceTypeUsagePrice PriceUnitPricePriceType = "usage_price"
	PriceUnitPricePriceTypeFixedPrice PriceUnitPricePriceType = "fixed_price"
)

func (PriceUnitPricePriceType) IsKnown added in v0.24.0

func (r PriceUnitPricePriceType) IsKnown() bool

type PriceUnitPriceUnitConfig

type PriceUnitPriceUnitConfig struct {
	// Rate per unit of usage
	UnitAmount string                       `json:"unit_amount,required"`
	JSON       priceUnitPriceUnitConfigJSON `json:"-"`
}

func (*PriceUnitPriceUnitConfig) UnmarshalJSON

func (r *PriceUnitPriceUnitConfig) UnmarshalJSON(data []byte) (err error)

type PriceUnitWithPercentPrice added in v0.20.0

type PriceUnitWithPercentPrice struct {
	ID                    string                                  `json:"id,required"`
	BillableMetric        PriceUnitWithPercentPriceBillableMetric `json:"billable_metric,required,nullable"`
	Cadence               PriceUnitWithPercentPriceCadence        `json:"cadence,required"`
	CreatedAt             time.Time                               `json:"created_at,required" format:"date-time"`
	Currency              string                                  `json:"currency,required"`
	Discount              shared.Discount                         `json:"discount,required,nullable"`
	ExternalPriceID       string                                  `json:"external_price_id,required,nullable"`
	FixedPriceQuantity    float64                                 `json:"fixed_price_quantity,required,nullable"`
	Item                  PriceUnitWithPercentPriceItem           `json:"item,required"`
	Maximum               PriceUnitWithPercentPriceMaximum        `json:"maximum,required,nullable"`
	MaximumAmount         string                                  `json:"maximum_amount,required,nullable"`
	Minimum               PriceUnitWithPercentPriceMinimum        `json:"minimum,required,nullable"`
	MinimumAmount         string                                  `json:"minimum_amount,required,nullable"`
	ModelType             PriceUnitWithPercentPriceModelType      `json:"model_type,required"`
	Name                  string                                  `json:"name,required"`
	PlanPhaseOrder        int64                                   `json:"plan_phase_order,required,nullable"`
	PriceType             PriceUnitWithPercentPricePriceType      `json:"price_type,required"`
	UnitWithPercentConfig map[string]interface{}                  `json:"unit_with_percent_config,required"`
	JSON                  priceUnitWithPercentPriceJSON           `json:"-"`
}

func (*PriceUnitWithPercentPrice) UnmarshalJSON added in v0.20.0

func (r *PriceUnitWithPercentPrice) UnmarshalJSON(data []byte) (err error)

type PriceUnitWithPercentPriceBillableMetric added in v0.20.0

type PriceUnitWithPercentPriceBillableMetric struct {
	ID   string                                      `json:"id,required"`
	JSON priceUnitWithPercentPriceBillableMetricJSON `json:"-"`
}

func (*PriceUnitWithPercentPriceBillableMetric) UnmarshalJSON added in v0.20.0

func (r *PriceUnitWithPercentPriceBillableMetric) UnmarshalJSON(data []byte) (err error)

type PriceUnitWithPercentPriceCadence added in v0.20.0

type PriceUnitWithPercentPriceCadence string
const (
	PriceUnitWithPercentPriceCadenceOneTime   PriceUnitWithPercentPriceCadence = "one_time"
	PriceUnitWithPercentPriceCadenceMonthly   PriceUnitWithPercentPriceCadence = "monthly"
	PriceUnitWithPercentPriceCadenceQuarterly PriceUnitWithPercentPriceCadence = "quarterly"
	PriceUnitWithPercentPriceCadenceAnnual    PriceUnitWithPercentPriceCadence = "annual"
)

func (PriceUnitWithPercentPriceCadence) IsKnown added in v0.24.0

type PriceUnitWithPercentPriceItem added in v0.20.0

type PriceUnitWithPercentPriceItem struct {
	ID   string                            `json:"id,required"`
	Name string                            `json:"name,required"`
	JSON priceUnitWithPercentPriceItemJSON `json:"-"`
}

func (*PriceUnitWithPercentPriceItem) UnmarshalJSON added in v0.20.0

func (r *PriceUnitWithPercentPriceItem) UnmarshalJSON(data []byte) (err error)

type PriceUnitWithPercentPriceMaximum added in v0.20.0

type PriceUnitWithPercentPriceMaximum struct {
	// List of price_ids that this maximum amount applies to. For plan/plan phase
	// maximums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Maximum amount applied
	MaximumAmount string                               `json:"maximum_amount,required"`
	JSON          priceUnitWithPercentPriceMaximumJSON `json:"-"`
}

func (*PriceUnitWithPercentPriceMaximum) UnmarshalJSON added in v0.20.0

func (r *PriceUnitWithPercentPriceMaximum) UnmarshalJSON(data []byte) (err error)

type PriceUnitWithPercentPriceMinimum added in v0.20.0

type PriceUnitWithPercentPriceMinimum struct {
	// List of price_ids that this minimum amount applies to. For plan/plan phase
	// minimums, this can be a subset of prices.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// Minimum amount applied
	MinimumAmount string                               `json:"minimum_amount,required"`
	JSON          priceUnitWithPercentPriceMinimumJSON `json:"-"`
}

func (*PriceUnitWithPercentPriceMinimum) UnmarshalJSON added in v0.20.0

func (r *PriceUnitWithPercentPriceMinimum) UnmarshalJSON(data []byte) (err error)

type PriceUnitWithPercentPriceModelType added in v0.20.0

type PriceUnitWithPercentPriceModelType string
const (
	PriceUnitWithPercentPriceModelTypeUnitWithPercent PriceUnitWithPercentPriceModelType = "unit_with_percent"
)

func (PriceUnitWithPercentPriceModelType) IsKnown added in v0.24.0

type PriceUnitWithPercentPricePriceType added in v0.20.0

type PriceUnitWithPercentPricePriceType string
const (
	PriceUnitWithPercentPricePriceTypeUsagePrice PriceUnitWithPercentPricePriceType = "usage_price"
	PriceUnitWithPercentPricePriceTypeFixedPrice PriceUnitWithPercentPricePriceType = "fixed_price"
)

func (PriceUnitWithPercentPricePriceType) IsKnown added in v0.24.0

type Subscription

type Subscription struct {
	ID string `json:"id,required"`
	// The current plan phase that is active, only if the subscription's plan has
	// phases.
	ActivePlanPhaseOrder int64 `json:"active_plan_phase_order,required,nullable"`
	// Determines whether issued invoices for this subscription will automatically be
	// charged with the saved payment method on the due date. This property defaults to
	// the plan's behavior.
	AutoCollection bool `json:"auto_collection,required,nullable"`
	// The day of the month on which the billing cycle is anchored. If the maximum
	// number of days in a month is greater than this value, the last day of the month
	// is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
	// period begins on the 30th.
	BillingCycleDay int64     `json:"billing_cycle_day,required"`
	CreatedAt       time.Time `json:"created_at,required" format:"date-time"`
	// The end of the current billing period. This is an exclusive timestamp, such that
	// the instant returned is not part of the billing period. Set to null for
	// subscriptions that are not currently active.
	CurrentBillingPeriodEndDate time.Time `json:"current_billing_period_end_date,required,nullable" format:"date-time"`
	// The start date of the current billing period. This is an inclusive timestamp;
	// the instant returned is exactly the beginning of the billing period. Set to null
	// if the subscription is not currently active.
	CurrentBillingPeriodStartDate time.Time `json:"current_billing_period_start_date,required,nullable" format:"date-time"`
	// A customer is a buyer of your products, and the other party to the billing
	// relationship.
	//
	// In Orb, customers are assigned system generated identifiers automatically, but
	// it's often desirable to have these match existing identifiers in your system. To
	// avoid having to denormalize Orb ID information, you can pass in an
	// `external_customer_id` with your own identifier. See
	// [Customer ID Aliases](../guides/events-and-metrics/customer-aliases) for further
	// information about how these aliases work in Orb.
	//
	// In addition to having an identifier in your system, a customer may exist in a
	// payment provider solution like Stripe. Use the `payment_provider_id` and the
	// `payment_provider` enum field to express this mapping.
	//
	// A customer also has a timezone (from the standard
	// [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
	// your account's timezone. See
	// [Timezone localization](../guides/product-catalog/timezones.md) for information
	// on what this timezone parameter influences within Orb.
	Customer Customer `json:"customer,required"`
	// Determines the default memo on this subscriptions' invoices. Note that if this
	// is not provided, it is determined by the plan configuration.
	DefaultInvoiceMemo string `json:"default_invoice_memo,required,nullable"`
	// The discount intervals for this subscription.
	DiscountIntervals []SubscriptionDiscountInterval `json:"discount_intervals,required"`
	// The date Orb stops billing for this subscription.
	EndDate                  time.Time                              `json:"end_date,required,nullable" format:"date-time"`
	FixedFeeQuantitySchedule []SubscriptionFixedFeeQuantitySchedule `json:"fixed_fee_quantity_schedule,required"`
	InvoicingThreshold       string                                 `json:"invoicing_threshold,required,nullable"`
	// The maximum intervals for this subscription.
	MaximumIntervals []SubscriptionMaximumInterval `json:"maximum_intervals,required"`
	// User specified key-value pairs for the resource. If not present, this defaults
	// to an empty dictionary. Individual keys can be removed by setting the value to
	// `null`, and the entire metadata mapping can be cleared by setting `metadata` to
	// `null`.
	Metadata map[string]string `json:"metadata,required"`
	// The minimum intervals for this subscription.
	MinimumIntervals []SubscriptionMinimumInterval `json:"minimum_intervals,required"`
	// Determines the difference between the invoice issue date for subscription
	// invoices as the date that they are due. A value of `0` here represents that the
	// invoice is due on issue, whereas a value of `30` represents that the customer
	// has a month to pay the invoice.
	NetTerms int64 `json:"net_terms,required"`
	// The [Plan](../guides/core-concepts.mdx#plan-and-price) resource represents a
	// plan that can be subscribed to by a customer. Plans define the billing behavior
	// of the subscription. You can see more about how to configure prices in the
	// [Price resource](/reference/price).
	Plan Plan `json:"plan,required"`
	// The price intervals for this subscription.
	PriceIntervals []SubscriptionPriceInterval `json:"price_intervals,required"`
	RedeemedCoupon SubscriptionRedeemedCoupon  `json:"redeemed_coupon,required,nullable"`
	// The date Orb starts billing for this subscription.
	StartDate time.Time             `json:"start_date,required" format:"date-time"`
	Status    SubscriptionStatus    `json:"status,required"`
	TrialInfo SubscriptionTrialInfo `json:"trial_info,required"`
	JSON      subscriptionJSON      `json:"-"`
}

A [subscription](../guides/core-concepts.mdx#subscription) represents the purchase of a plan by a customer.

By default, subscriptions begin on the day that they're created and renew automatically for each billing cycle at the cadence that's configured in the plan definition.

Subscriptions also default to **beginning of month alignment**, which means the first invoice issued for the subscription will have pro-rated charges between the `start_date` and the first of the following month. Subsequent billing periods will always start and end on a month boundary (e.g. subsequent month starts for monthly billing).

Depending on the plan configuration, any _flat_ recurring fees will be billed either at the beginning (in-advance) or end (in-arrears) of each billing cycle. Plans default to **in-advance billing**. Usage-based fees are billed in arrears as usage is accumulated. In the normal course of events, you can expect an invoice to contain usage-based charges for the previous period, and a recurring fee for the following period.

func (*Subscription) UnmarshalJSON

func (r *Subscription) UnmarshalJSON(data []byte) (err error)

type SubscriptionCancelParams

type SubscriptionCancelParams struct {
	// Determines the timing of subscription cancellation
	CancelOption param.Field[SubscriptionCancelParamsCancelOption] `json:"cancel_option,required"`
	// The date that the cancellation should take effect. This parameter can only be
	// passed if the `cancel_option` is `requested_date`.
	CancellationDate param.Field[time.Time] `json:"cancellation_date" format:"date-time"`
}

func (SubscriptionCancelParams) MarshalJSON

func (r SubscriptionCancelParams) MarshalJSON() (data []byte, err error)

type SubscriptionCancelParamsCancelOption

type SubscriptionCancelParamsCancelOption string

Determines the timing of subscription cancellation

const (
	SubscriptionCancelParamsCancelOptionEndOfSubscriptionTerm SubscriptionCancelParamsCancelOption = "end_of_subscription_term"
	SubscriptionCancelParamsCancelOptionImmediate             SubscriptionCancelParamsCancelOption = "immediate"
	SubscriptionCancelParamsCancelOptionRequestedDate         SubscriptionCancelParamsCancelOption = "requested_date"
)

func (SubscriptionCancelParamsCancelOption) IsKnown added in v0.24.0

type SubscriptionDiscountInterval

type SubscriptionDiscountInterval interface {
	// contains filtered or unexported methods
}

Union satisfied by SubscriptionDiscountIntervalsAmountDiscountInterval, SubscriptionDiscountIntervalsPercentageDiscountInterval or SubscriptionDiscountIntervalsUsageDiscountInterval.

type SubscriptionDiscountIntervalsAmountDiscountInterval

type SubscriptionDiscountIntervalsAmountDiscountInterval struct {
	// Only available if discount_type is `amount`.
	AmountDiscount string `json:"amount_discount,required"`
	// The price ids that this discount interval applies to.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// The price interval ids that this discount interval applies to.
	AppliesToPriceIntervalIDs []string                                                        `json:"applies_to_price_interval_ids,required"`
	DiscountType              SubscriptionDiscountIntervalsAmountDiscountIntervalDiscountType `json:"discount_type,required"`
	// The end date of the discount interval.
	EndDate time.Time `json:"end_date,required,nullable" format:"date-time"`
	// The start date of the discount interval.
	StartDate time.Time                                               `json:"start_date,required" format:"date-time"`
	JSON      subscriptionDiscountIntervalsAmountDiscountIntervalJSON `json:"-"`
}

func (*SubscriptionDiscountIntervalsAmountDiscountInterval) UnmarshalJSON

func (r *SubscriptionDiscountIntervalsAmountDiscountInterval) UnmarshalJSON(data []byte) (err error)

type SubscriptionDiscountIntervalsAmountDiscountIntervalDiscountType

type SubscriptionDiscountIntervalsAmountDiscountIntervalDiscountType string
const (
	SubscriptionDiscountIntervalsAmountDiscountIntervalDiscountTypeAmount SubscriptionDiscountIntervalsAmountDiscountIntervalDiscountType = "amount"
)

func (SubscriptionDiscountIntervalsAmountDiscountIntervalDiscountType) IsKnown added in v0.24.0

type SubscriptionDiscountIntervalsPercentageDiscountInterval

type SubscriptionDiscountIntervalsPercentageDiscountInterval struct {
	// The price ids that this discount interval applies to.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// The price interval ids that this discount interval applies to.
	AppliesToPriceIntervalIDs []string                                                            `json:"applies_to_price_interval_ids,required"`
	DiscountType              SubscriptionDiscountIntervalsPercentageDiscountIntervalDiscountType `json:"discount_type,required"`
	// The end date of the discount interval.
	EndDate time.Time `json:"end_date,required,nullable" format:"date-time"`
	// Only available if discount_type is `percentage`.This is a number between 0
	// and 1.
	PercentageDiscount float64 `json:"percentage_discount,required"`
	// The start date of the discount interval.
	StartDate time.Time                                                   `json:"start_date,required" format:"date-time"`
	JSON      subscriptionDiscountIntervalsPercentageDiscountIntervalJSON `json:"-"`
}

func (*SubscriptionDiscountIntervalsPercentageDiscountInterval) UnmarshalJSON

type SubscriptionDiscountIntervalsPercentageDiscountIntervalDiscountType

type SubscriptionDiscountIntervalsPercentageDiscountIntervalDiscountType string
const (
	SubscriptionDiscountIntervalsPercentageDiscountIntervalDiscountTypePercentage SubscriptionDiscountIntervalsPercentageDiscountIntervalDiscountType = "percentage"
)

func (SubscriptionDiscountIntervalsPercentageDiscountIntervalDiscountType) IsKnown added in v0.24.0

type SubscriptionDiscountIntervalsUsageDiscountInterval

type SubscriptionDiscountIntervalsUsageDiscountInterval struct {
	// The price ids that this discount interval applies to.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// The price interval ids that this discount interval applies to.
	AppliesToPriceIntervalIDs []string                                                       `json:"applies_to_price_interval_ids,required"`
	DiscountType              SubscriptionDiscountIntervalsUsageDiscountIntervalDiscountType `json:"discount_type,required"`
	// The end date of the discount interval.
	EndDate time.Time `json:"end_date,required,nullable" format:"date-time"`
	// The start date of the discount interval.
	StartDate time.Time `json:"start_date,required" format:"date-time"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount float64                                                `json:"usage_discount,required"`
	JSON          subscriptionDiscountIntervalsUsageDiscountIntervalJSON `json:"-"`
}

func (*SubscriptionDiscountIntervalsUsageDiscountInterval) UnmarshalJSON

func (r *SubscriptionDiscountIntervalsUsageDiscountInterval) UnmarshalJSON(data []byte) (err error)

type SubscriptionDiscountIntervalsUsageDiscountIntervalDiscountType

type SubscriptionDiscountIntervalsUsageDiscountIntervalDiscountType string
const (
	SubscriptionDiscountIntervalsUsageDiscountIntervalDiscountTypeUsage SubscriptionDiscountIntervalsUsageDiscountIntervalDiscountType = "usage"
)

func (SubscriptionDiscountIntervalsUsageDiscountIntervalDiscountType) IsKnown added in v0.24.0

type SubscriptionFetchCostsParams

type SubscriptionFetchCostsParams struct {
	// Costs returned are exclusive of `timeframe_end`.
	TimeframeEnd param.Field[time.Time] `query:"timeframe_end" format:"date-time"`
	// Costs returned are inclusive of `timeframe_start`.
	TimeframeStart param.Field[time.Time] `query:"timeframe_start" format:"date-time"`
	// Controls whether Orb returns cumulative costs since the start of the billing
	// period, or incremental day-by-day costs. If your customer has minimums or
	// discounts, it's strongly recommended that you use the default cumulative
	// behavior.
	ViewMode param.Field[SubscriptionFetchCostsParamsViewMode] `query:"view_mode"`
}

func (SubscriptionFetchCostsParams) URLQuery

func (r SubscriptionFetchCostsParams) URLQuery() (v url.Values)

URLQuery serializes SubscriptionFetchCostsParams's query parameters as `url.Values`.

type SubscriptionFetchCostsParamsViewMode

type SubscriptionFetchCostsParamsViewMode string

Controls whether Orb returns cumulative costs since the start of the billing period, or incremental day-by-day costs. If your customer has minimums or discounts, it's strongly recommended that you use the default cumulative behavior.

const (
	SubscriptionFetchCostsParamsViewModePeriodic   SubscriptionFetchCostsParamsViewMode = "periodic"
	SubscriptionFetchCostsParamsViewModeCumulative SubscriptionFetchCostsParamsViewMode = "cumulative"
)

func (SubscriptionFetchCostsParamsViewMode) IsKnown added in v0.24.0

type SubscriptionFetchCostsResponse

type SubscriptionFetchCostsResponse struct {
	Data []SubscriptionFetchCostsResponseData `json:"data,required"`
	JSON subscriptionFetchCostsResponseJSON   `json:"-"`
}

func (*SubscriptionFetchCostsResponse) UnmarshalJSON

func (r *SubscriptionFetchCostsResponse) UnmarshalJSON(data []byte) (err error)

type SubscriptionFetchCostsResponseData

type SubscriptionFetchCostsResponseData struct {
	PerPriceCosts []SubscriptionFetchCostsResponseDataPerPriceCost `json:"per_price_costs,required"`
	// Total costs for the timeframe, excluding any minimums and discounts.
	Subtotal       string    `json:"subtotal,required"`
	TimeframeEnd   time.Time `json:"timeframe_end,required" format:"date-time"`
	TimeframeStart time.Time `json:"timeframe_start,required" format:"date-time"`
	// Total costs for the timeframe, including any minimums and discounts.
	Total string                                 `json:"total,required"`
	JSON  subscriptionFetchCostsResponseDataJSON `json:"-"`
}

func (*SubscriptionFetchCostsResponseData) UnmarshalJSON

func (r *SubscriptionFetchCostsResponseData) UnmarshalJSON(data []byte) (err error)

type SubscriptionFetchCostsResponseDataPerPriceCost

type SubscriptionFetchCostsResponseDataPerPriceCost struct {
	// The Price resource represents a price that can be billed on a subscription,
	// resulting in a charge on an invoice in the form of an invoice line item. Prices
	// take a quantity and determine an amount to bill.
	//
	// Orb supports a few different pricing models out of the box. Each of these models
	// is serialized differently in a given Price object. The model_type field
	// determines the key for the configuration object that is present.
	//
	// ## Unit pricing
	//
	// With unit pricing, each unit costs a fixed amount.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "unit",
	//	    "unit_config": {
	//	        "unit_amount": "0.50"
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Tiered pricing
	//
	// In tiered pricing, the cost of a given unit depends on the tier range that it
	// falls into, where each tier range is defined by an upper and lower bound. For
	// example, the first ten units may cost $0.50 each and all units thereafter may
	// cost $0.10 each.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "tiered",
	//	    "tiered_config": {
	//	        "tiers": [
	//	            {
	//	                "first_unit": 1,
	//	                "last_unit": 10,
	//	                "unit_amount": "0.50"
	//	            },
	//	            {
	//	                "first_unit": 11,
	//	                "last_unit": null,
	//	                "unit_amount": "0.10"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//
	// “`
	//
	// ## Bulk pricing
	//
	// Bulk pricing applies when the number of units determine the cost of all units.
	// For example, if you've bought less than 10 units, they may each be $0.50 for a
	// total of $5.00. Once you've bought more than 10 units, all units may now be
	// priced at $0.40 (i.e. 101 units total would be $40.40).
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "bulk",
	//	    "bulk_config": {
	//	        "tiers": [
	//	            {
	//	                "maximum_units": 10,
	//	                "unit_amount": "0.50"
	//	            },
	//	            {
	//	                "maximum_units": 1000,
	//	                "unit_amount": "0.40"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Package pricing
	//
	// Package pricing defines the size or granularity of a unit for billing purposes.
	// For example, if the package size is set to 5, then 4 units will be billed as 5
	// and 6 units will be billed at 10.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "package",
	//	    "package_config": {
	//	        "package_amount": "0.80",
	//	        "package_size": 10
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## BPS pricing
	//
	// BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
	// percent (the number of basis points to charge), as well as a cap per event to
	// assess. For example, this would allow you to assess a fee of 0.25% on every
	// payment you process, with a maximum charge of $25 per payment.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "bps",
	//	    "bps_config": {
	//	       "bps": 125,
	//	       "per_unit_maximum": "11.00"
	//	    }
	//	    ...
	//	 }
	//
	// “`
	//
	// ## Bulk BPS pricing
	//
	// Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
	// total quantity across all events. Similar to bulk pricing, the BPS parameters of
	// a given event depends on the tier range that the billing period falls into. Each
	// tier range is defined by an upper bound. For example, after $1.5M of payment
	// volume is reached, each individual payment may have a lower cap or a smaller
	// take-rate.
	//
	// “`json
	//
	//	    ...
	//	    "model_type": "bulk_bps",
	//	    "bulk_bps_config": {
	//	        "tiers": [
	//	           {
	//	                "maximum_amount": "1000000.00",
	//	                "bps": 125,
	//	                "per_unit_maximum": "19.00"
	//	           },
	//	          {
	//	                "maximum_amount": null,
	//	                "bps": 115,
	//	                "per_unit_maximum": "4.00"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Tiered BPS pricing
	//
	// Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
	// event's applicable parameter is a function of its marginal addition to the
	// period total. Similar to tiered pricing, the BPS parameters of a given event
	// depends on the tier range that it falls into, where each tier range is defined
	// by an upper and lower bound. For example, the first few payments may have a 0.8
	// BPS take-rate and all payments after a specific volume may incur a take-rate of
	// 0.5 BPS each.
	//
	// “`json
	//
	//	    ...
	//	    "model_type": "tiered_bps",
	//	    "tiered_bps_config": {
	//	        "tiers": [
	//	           {
	//	                "minimum_amount": "0",
	//	                "maximum_amount": "1000000.00",
	//	                "bps": 125,
	//	                "per_unit_maximum": "19.00"
	//	           },
	//	          {
	//	                "minimum_amount": "1000000.00",
	//	                "maximum_amount": null,
	//	                "bps": 115,
	//	                "per_unit_maximum": "4.00"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Matrix pricing
	//
	// Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
	// `dimensions` defines the two event property values evaluated in this pricing
	// model. In a one-dimensional matrix, the second value is `null`. Every
	// configuration has a list of `matrix_values` which give the unit prices for
	// specified property values. In a one-dimensional matrix, the matrix values will
	// have `dimension_values` where the second value of the pair is null. If an event
	// does not match any of the dimension values in the matrix, it will resort to the
	// `default_unit_amount`.
	//
	// “`json
	//
	//	{
	//	    "model_type": "matrix"
	//	    "matrix_config": {
	//	        "default_unit_amount": "3.00",
	//	        "dimensions": [
	//	            "cluster_name",
	//	            "region"
	//	        ],
	//	        "matrix_values": [
	//	            {
	//	                "dimension_values": [
	//	                    "alpha",
	//	                    "west"
	//	                ],
	//	                "unit_amount": "2.00"
	//	            },
	//	            ...
	//	        ]
	//	    }
	//	}
	//
	// “`
	//
	// ## Fixed fees
	//
	// Fixed fees are prices that are applied independent of usage quantities, and
	// follow unit pricing. They also have an additional parameter
	// `fixed_price_quantity`. If the Price represents a fixed cost, this represents
	// the quantity of units applied.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "id": "price_id",
	//	    "model_type": "unit",
	//	    "unit_config": {
	//	       "unit_amount": "2.00"
	//	    },
	//	    "fixed_price_quantity": 3.0
	//	    ...
	//	}
	//
	// “`
	Price Price `json:"price,required"`
	// Price's contributions for the timeframe, excluding any minimums and discounts.
	Subtotal string `json:"subtotal,required"`
	// Price's contributions for the timeframe, including minimums and discounts.
	Total string `json:"total,required"`
	// The price's quantity for the timeframe
	Quantity float64                                            `json:"quantity,nullable"`
	JSON     subscriptionFetchCostsResponseDataPerPriceCostJSON `json:"-"`
}

func (*SubscriptionFetchCostsResponseDataPerPriceCost) UnmarshalJSON

func (r *SubscriptionFetchCostsResponseDataPerPriceCost) UnmarshalJSON(data []byte) (err error)

type SubscriptionFetchScheduleParams

type SubscriptionFetchScheduleParams struct {
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor param.Field[string] `query:"cursor"`
	// The number of items to fetch. Defaults to 20.
	Limit        param.Field[int64]     `query:"limit"`
	StartDateGt  param.Field[time.Time] `query:"start_date[gt]" format:"date-time"`
	StartDateGte param.Field[time.Time] `query:"start_date[gte]" format:"date-time"`
	StartDateLt  param.Field[time.Time] `query:"start_date[lt]" format:"date-time"`
	StartDateLte param.Field[time.Time] `query:"start_date[lte]" format:"date-time"`
}

func (SubscriptionFetchScheduleParams) URLQuery

func (r SubscriptionFetchScheduleParams) URLQuery() (v url.Values)

URLQuery serializes SubscriptionFetchScheduleParams's query parameters as `url.Values`.

type SubscriptionFetchScheduleResponse

type SubscriptionFetchScheduleResponse struct {
	CreatedAt time.Time                             `json:"created_at,required" format:"date-time"`
	EndDate   time.Time                             `json:"end_date,required,nullable" format:"date-time"`
	Plan      SubscriptionFetchScheduleResponsePlan `json:"plan,required"`
	StartDate time.Time                             `json:"start_date,required" format:"date-time"`
	JSON      subscriptionFetchScheduleResponseJSON `json:"-"`
}

func (*SubscriptionFetchScheduleResponse) UnmarshalJSON

func (r *SubscriptionFetchScheduleResponse) UnmarshalJSON(data []byte) (err error)

type SubscriptionFetchScheduleResponsePlan

type SubscriptionFetchScheduleResponsePlan struct {
	ID string `json:"id,required,nullable"`
	// An optional user-defined ID for this plan resource, used throughout the system
	// as an alias for this Plan. Use this field to identify a plan by an existing
	// identifier in your system.
	ExternalPlanID string                                    `json:"external_plan_id,required,nullable"`
	Name           string                                    `json:"name,required,nullable"`
	JSON           subscriptionFetchScheduleResponsePlanJSON `json:"-"`
}

func (*SubscriptionFetchScheduleResponsePlan) UnmarshalJSON

func (r *SubscriptionFetchScheduleResponsePlan) UnmarshalJSON(data []byte) (err error)

type SubscriptionFetchUsageParams

type SubscriptionFetchUsageParams struct {
	// When specified in conjunction with `group_by`, this parameter filters usage to a
	// single billable metric. Note that both `group_by` and `billable_metric_id` must
	// be specified together.
	BillableMetricID param.Field[string] `query:"billable_metric_id"`
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor              param.Field[string] `query:"cursor"`
	FirstDimensionKey   param.Field[string] `query:"first_dimension_key"`
	FirstDimensionValue param.Field[string] `query:"first_dimension_value"`
	// This determines the windowing of usage reporting.
	Granularity param.Field[SubscriptionFetchUsageParamsGranularity] `query:"granularity"`
	// Groups per-price usage by the key provided.
	GroupBy param.Field[string] `query:"group_by"`
	// If including a `group_by`, the number of groups to fetch data for. Defaults
	// to 1000.
	Limit                param.Field[int64]  `query:"limit"`
	SecondDimensionKey   param.Field[string] `query:"second_dimension_key"`
	SecondDimensionValue param.Field[string] `query:"second_dimension_value"`
	// Usage returned is exclusive of `timeframe_end`.
	TimeframeEnd param.Field[time.Time] `query:"timeframe_end" format:"date-time"`
	// Usage returned is inclusive of `timeframe_start`.
	TimeframeStart param.Field[time.Time] `query:"timeframe_start" format:"date-time"`
	// Controls whether Orb returns cumulative usage since the start of the billing
	// period, or incremental day-by-day usage. If your customer has minimums or
	// discounts, it's strongly recommended that you use the default cumulative
	// behavior.
	ViewMode param.Field[SubscriptionFetchUsageParamsViewMode] `query:"view_mode"`
}

func (SubscriptionFetchUsageParams) URLQuery

func (r SubscriptionFetchUsageParams) URLQuery() (v url.Values)

URLQuery serializes SubscriptionFetchUsageParams's query parameters as `url.Values`.

type SubscriptionFetchUsageParamsGranularity

type SubscriptionFetchUsageParamsGranularity string

This determines the windowing of usage reporting.

const (
	SubscriptionFetchUsageParamsGranularityDay SubscriptionFetchUsageParamsGranularity = "day"
)

func (SubscriptionFetchUsageParamsGranularity) IsKnown added in v0.24.0

type SubscriptionFetchUsageParamsViewMode

type SubscriptionFetchUsageParamsViewMode string

Controls whether Orb returns cumulative usage since the start of the billing period, or incremental day-by-day usage. If your customer has minimums or discounts, it's strongly recommended that you use the default cumulative behavior.

const (
	SubscriptionFetchUsageParamsViewModePeriodic   SubscriptionFetchUsageParamsViewMode = "periodic"
	SubscriptionFetchUsageParamsViewModeCumulative SubscriptionFetchUsageParamsViewMode = "cumulative"
)

func (SubscriptionFetchUsageParamsViewMode) IsKnown added in v0.24.0

type SubscriptionFixedFeeQuantitySchedule

type SubscriptionFixedFeeQuantitySchedule struct {
	EndDate   time.Time                                `json:"end_date,required,nullable" format:"date-time"`
	PriceID   string                                   `json:"price_id,required"`
	Quantity  float64                                  `json:"quantity,required"`
	StartDate time.Time                                `json:"start_date,required" format:"date-time"`
	JSON      subscriptionFixedFeeQuantityScheduleJSON `json:"-"`
}

func (*SubscriptionFixedFeeQuantitySchedule) UnmarshalJSON

func (r *SubscriptionFixedFeeQuantitySchedule) UnmarshalJSON(data []byte) (err error)

type SubscriptionListParams

type SubscriptionListParams struct {
	CreatedAtGt  param.Field[time.Time] `query:"created_at[gt]" format:"date-time"`
	CreatedAtGte param.Field[time.Time] `query:"created_at[gte]" format:"date-time"`
	CreatedAtLt  param.Field[time.Time] `query:"created_at[lt]" format:"date-time"`
	CreatedAtLte param.Field[time.Time] `query:"created_at[lte]" format:"date-time"`
	// Cursor for pagination. This can be populated by the `next_cursor` value returned
	// from the initial request.
	Cursor             param.Field[string] `query:"cursor"`
	CustomerID         param.Field[string] `query:"customer_id"`
	ExternalCustomerID param.Field[string] `query:"external_customer_id"`
	// The number of items to fetch. Defaults to 20.
	Limit  param.Field[int64]                        `query:"limit"`
	Status param.Field[SubscriptionListParamsStatus] `query:"status"`
}

func (SubscriptionListParams) URLQuery

func (r SubscriptionListParams) URLQuery() (v url.Values)

URLQuery serializes SubscriptionListParams's query parameters as `url.Values`.

type SubscriptionListParamsStatus

type SubscriptionListParamsStatus string
const (
	SubscriptionListParamsStatusActive   SubscriptionListParamsStatus = "active"
	SubscriptionListParamsStatusEnded    SubscriptionListParamsStatus = "ended"
	SubscriptionListParamsStatusUpcoming SubscriptionListParamsStatus = "upcoming"
)

func (SubscriptionListParamsStatus) IsKnown added in v0.24.0

func (r SubscriptionListParamsStatus) IsKnown() bool

type SubscriptionMaximumInterval

type SubscriptionMaximumInterval struct {
	// The price ids that this maximum interval applies to.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// The price interval ids that this maximum interval applies to.
	AppliesToPriceIntervalIDs []string `json:"applies_to_price_interval_ids,required"`
	// The end date of the maximum interval.
	EndDate time.Time `json:"end_date,required,nullable" format:"date-time"`
	// The maximum amount to charge in a given billing period for the price intervals
	// this transform applies to.
	MaximumAmount string `json:"maximum_amount,required"`
	// The start date of the maximum interval.
	StartDate time.Time                       `json:"start_date,required" format:"date-time"`
	JSON      subscriptionMaximumIntervalJSON `json:"-"`
}

func (*SubscriptionMaximumInterval) UnmarshalJSON

func (r *SubscriptionMaximumInterval) UnmarshalJSON(data []byte) (err error)

type SubscriptionMinimumInterval

type SubscriptionMinimumInterval struct {
	// The price ids that this minimum interval applies to.
	AppliesToPriceIDs []string `json:"applies_to_price_ids,required"`
	// The price interval ids that this minimum interval applies to.
	AppliesToPriceIntervalIDs []string `json:"applies_to_price_interval_ids,required"`
	// The end date of the minimum interval.
	EndDate time.Time `json:"end_date,required,nullable" format:"date-time"`
	// The minimum amount to charge in a given billing period for the price intervals
	// this minimum applies to.
	MinimumAmount string `json:"minimum_amount,required"`
	// The start date of the minimum interval.
	StartDate time.Time                       `json:"start_date,required" format:"date-time"`
	JSON      subscriptionMinimumIntervalJSON `json:"-"`
}

func (*SubscriptionMinimumInterval) UnmarshalJSON

func (r *SubscriptionMinimumInterval) UnmarshalJSON(data []byte) (err error)

type SubscriptionNewParams

type SubscriptionNewParams struct {
	AlignBillingWithSubscriptionStartDate param.Field[bool]                                     `json:"align_billing_with_subscription_start_date"`
	AutoCollection                        param.Field[bool]                                     `json:"auto_collection"`
	AwsRegion                             param.Field[string]                                   `json:"aws_region"`
	CouponRedemptionCode                  param.Field[string]                                   `json:"coupon_redemption_code"`
	CreditsOverageRate                    param.Field[float64]                                  `json:"credits_overage_rate"`
	CustomerID                            param.Field[string]                                   `json:"customer_id"`
	DefaultInvoiceMemo                    param.Field[string]                                   `json:"default_invoice_memo"`
	EndDate                               param.Field[time.Time]                                `json:"end_date" format:"date-time"`
	ExternalCustomerID                    param.Field[string]                                   `json:"external_customer_id"`
	ExternalMarketplace                   param.Field[SubscriptionNewParamsExternalMarketplace] `json:"external_marketplace"`
	ExternalMarketplaceReportingID        param.Field[string]                                   `json:"external_marketplace_reporting_id"`
	// The external_plan_id of the plan that the given subscription should be switched
	// to. Note that either this property or `plan_id` must be specified.
	ExternalPlanID     param.Field[string] `json:"external_plan_id"`
	InitialPhaseOrder  param.Field[int64]  `json:"initial_phase_order"`
	InvoicingThreshold param.Field[string] `json:"invoicing_threshold"`
	// User-specified key/value pairs for the resource. Individual keys can be removed
	// by setting the value to `null`, and the entire metadata mapping can be cleared
	// by setting `metadata` to `null`.
	Metadata               param.Field[map[string]string] `json:"metadata"`
	NetTerms               param.Field[int64]             `json:"net_terms"`
	PerCreditOverageAmount param.Field[string]            `json:"per_credit_overage_amount"`
	// The plan that the given subscription should be switched to. Note that either
	// this property or `external_plan_id` must be specified.
	PlanID param.Field[string] `json:"plan_id"`
	// Optionally provide a list of overrides for prices on the plan
	PriceOverrides param.Field[[]SubscriptionNewParamsPriceOverride] `json:"price_overrides"`
	StartDate      param.Field[time.Time]                            `json:"start_date" format:"date-time"`
}

func (SubscriptionNewParams) MarshalJSON

func (r SubscriptionNewParams) MarshalJSON() (data []byte, err error)

type SubscriptionNewParamsExternalMarketplace

type SubscriptionNewParamsExternalMarketplace string
const (
	SubscriptionNewParamsExternalMarketplaceGoogle SubscriptionNewParamsExternalMarketplace = "google"
	SubscriptionNewParamsExternalMarketplaceAws    SubscriptionNewParamsExternalMarketplace = "aws"
	SubscriptionNewParamsExternalMarketplaceAzure  SubscriptionNewParamsExternalMarketplace = "azure"
)

func (SubscriptionNewParamsExternalMarketplace) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideBpsPrice

type SubscriptionNewParamsPriceOverridesOverrideBpsPrice struct {
	ID        param.Field[string]                                                       `json:"id,required"`
	BpsConfig param.Field[SubscriptionNewParamsPriceOverridesOverrideBpsPriceBpsConfig] `json:"bps_config,required"`
	ModelType param.Field[SubscriptionNewParamsPriceOverridesOverrideBpsPriceModelType] `json:"model_type,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionNewParamsPriceOverridesOverrideBpsPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionNewParamsPriceOverridesOverrideBpsPrice) MarshalJSON

func (r SubscriptionNewParamsPriceOverridesOverrideBpsPrice) MarshalJSON() (data []byte, err error)

type SubscriptionNewParamsPriceOverridesOverrideBpsPriceBpsConfig

type SubscriptionNewParamsPriceOverridesOverrideBpsPriceBpsConfig struct {
	// Basis point take rate per event
	Bps param.Field[float64] `json:"bps,required"`
	// Optional currency amount maximum to cap spend per event
	PerUnitMaximum param.Field[string] `json:"per_unit_maximum"`
}

func (SubscriptionNewParamsPriceOverridesOverrideBpsPriceBpsConfig) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideBpsPriceDiscount added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideBpsPriceDiscount struct {
	DiscountType param.Field[SubscriptionNewParamsPriceOverridesOverrideBpsPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionNewParamsPriceOverridesOverrideBpsPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideBpsPriceDiscountDiscountType added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideBpsPriceDiscountDiscountType string
const (
	SubscriptionNewParamsPriceOverridesOverrideBpsPriceDiscountDiscountTypePercentage SubscriptionNewParamsPriceOverridesOverrideBpsPriceDiscountDiscountType = "percentage"
	SubscriptionNewParamsPriceOverridesOverrideBpsPriceDiscountDiscountTypeTrial      SubscriptionNewParamsPriceOverridesOverrideBpsPriceDiscountDiscountType = "trial"
	SubscriptionNewParamsPriceOverridesOverrideBpsPriceDiscountDiscountTypeUsage      SubscriptionNewParamsPriceOverridesOverrideBpsPriceDiscountDiscountType = "usage"
	SubscriptionNewParamsPriceOverridesOverrideBpsPriceDiscountDiscountTypeAmount     SubscriptionNewParamsPriceOverridesOverrideBpsPriceDiscountDiscountType = "amount"
)

func (SubscriptionNewParamsPriceOverridesOverrideBpsPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideBpsPriceModelType

type SubscriptionNewParamsPriceOverridesOverrideBpsPriceModelType string
const (
	SubscriptionNewParamsPriceOverridesOverrideBpsPriceModelTypeBps SubscriptionNewParamsPriceOverridesOverrideBpsPriceModelType = "bps"
)

func (SubscriptionNewParamsPriceOverridesOverrideBpsPriceModelType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideBulkBpsPrice

type SubscriptionNewParamsPriceOverridesOverrideBulkBpsPrice struct {
	ID            param.Field[string]                                                               `json:"id,required"`
	BulkBpsConfig param.Field[SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceBulkBpsConfig] `json:"bulk_bps_config,required"`
	ModelType     param.Field[SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceModelType]     `json:"model_type,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionNewParamsPriceOverridesOverrideBulkBpsPrice) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceBulkBpsConfig

type SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceBulkBpsConfig struct {
	// Tiers for a bulk BPS pricing model where all usage is aggregated to a single
	// tier based on total volume
	Tiers param.Field[[]SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceBulkBpsConfigTier] `json:"tiers,required"`
}

func (SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceBulkBpsConfig) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceBulkBpsConfigTier

type SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceBulkBpsConfigTier struct {
	// Basis points to rate on
	Bps param.Field[float64] `json:"bps,required"`
	// Upper bound for tier
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The maximum amount to charge for any one event
	PerUnitMaximum param.Field[string] `json:"per_unit_maximum"`
}

func (SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceBulkBpsConfigTier) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceDiscount added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceDiscount struct {
	DiscountType param.Field[SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountType added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountType string
const (
	SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountTypePercentage SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountType = "percentage"
	SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountTypeTrial      SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountType = "trial"
	SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountTypeUsage      SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountType = "usage"
	SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountTypeAmount     SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountType = "amount"
)

func (SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceModelType

type SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceModelType string
const (
	SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceModelTypeBulkBps SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceModelType = "bulk_bps"
)

func (SubscriptionNewParamsPriceOverridesOverrideBulkBpsPriceModelType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideBulkPrice

type SubscriptionNewParamsPriceOverridesOverrideBulkPrice struct {
	ID         param.Field[string]                                                         `json:"id,required"`
	BulkConfig param.Field[SubscriptionNewParamsPriceOverridesOverrideBulkPriceBulkConfig] `json:"bulk_config,required"`
	ModelType  param.Field[SubscriptionNewParamsPriceOverridesOverrideBulkPriceModelType]  `json:"model_type,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionNewParamsPriceOverridesOverrideBulkPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionNewParamsPriceOverridesOverrideBulkPrice) MarshalJSON

func (r SubscriptionNewParamsPriceOverridesOverrideBulkPrice) MarshalJSON() (data []byte, err error)

type SubscriptionNewParamsPriceOverridesOverrideBulkPriceBulkConfig

type SubscriptionNewParamsPriceOverridesOverrideBulkPriceBulkConfig struct {
	// Bulk tiers for rating based on total usage volume
	Tiers param.Field[[]SubscriptionNewParamsPriceOverridesOverrideBulkPriceBulkConfigTier] `json:"tiers,required"`
}

func (SubscriptionNewParamsPriceOverridesOverrideBulkPriceBulkConfig) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideBulkPriceBulkConfigTier

type SubscriptionNewParamsPriceOverridesOverrideBulkPriceBulkConfigTier struct {
	// Amount per unit
	UnitAmount param.Field[string] `json:"unit_amount,required"`
	// Upper bound for this tier
	MaximumUnits param.Field[float64] `json:"maximum_units"`
}

func (SubscriptionNewParamsPriceOverridesOverrideBulkPriceBulkConfigTier) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideBulkPriceDiscount added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideBulkPriceDiscount struct {
	DiscountType param.Field[SubscriptionNewParamsPriceOverridesOverrideBulkPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionNewParamsPriceOverridesOverrideBulkPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideBulkPriceDiscountDiscountType added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideBulkPriceDiscountDiscountType string
const (
	SubscriptionNewParamsPriceOverridesOverrideBulkPriceDiscountDiscountTypePercentage SubscriptionNewParamsPriceOverridesOverrideBulkPriceDiscountDiscountType = "percentage"
	SubscriptionNewParamsPriceOverridesOverrideBulkPriceDiscountDiscountTypeTrial      SubscriptionNewParamsPriceOverridesOverrideBulkPriceDiscountDiscountType = "trial"
	SubscriptionNewParamsPriceOverridesOverrideBulkPriceDiscountDiscountTypeUsage      SubscriptionNewParamsPriceOverridesOverrideBulkPriceDiscountDiscountType = "usage"
	SubscriptionNewParamsPriceOverridesOverrideBulkPriceDiscountDiscountTypeAmount     SubscriptionNewParamsPriceOverridesOverrideBulkPriceDiscountDiscountType = "amount"
)

func (SubscriptionNewParamsPriceOverridesOverrideBulkPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideBulkPriceModelType

type SubscriptionNewParamsPriceOverridesOverrideBulkPriceModelType string
const (
	SubscriptionNewParamsPriceOverridesOverrideBulkPriceModelTypeBulk SubscriptionNewParamsPriceOverridesOverrideBulkPriceModelType = "bulk"
)

func (SubscriptionNewParamsPriceOverridesOverrideBulkPriceModelType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideMatrixPrice

type SubscriptionNewParamsPriceOverridesOverrideMatrixPrice struct {
	ID           param.Field[string]                                                             `json:"id,required"`
	MatrixConfig param.Field[SubscriptionNewParamsPriceOverridesOverrideMatrixPriceMatrixConfig] `json:"matrix_config,required"`
	ModelType    param.Field[SubscriptionNewParamsPriceOverridesOverrideMatrixPriceModelType]    `json:"model_type,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionNewParamsPriceOverridesOverrideMatrixPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionNewParamsPriceOverridesOverrideMatrixPrice) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideMatrixPriceDiscount added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideMatrixPriceDiscount struct {
	DiscountType param.Field[SubscriptionNewParamsPriceOverridesOverrideMatrixPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionNewParamsPriceOverridesOverrideMatrixPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideMatrixPriceDiscountDiscountType added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideMatrixPriceDiscountDiscountType string
const (
	SubscriptionNewParamsPriceOverridesOverrideMatrixPriceDiscountDiscountTypePercentage SubscriptionNewParamsPriceOverridesOverrideMatrixPriceDiscountDiscountType = "percentage"
	SubscriptionNewParamsPriceOverridesOverrideMatrixPriceDiscountDiscountTypeTrial      SubscriptionNewParamsPriceOverridesOverrideMatrixPriceDiscountDiscountType = "trial"
	SubscriptionNewParamsPriceOverridesOverrideMatrixPriceDiscountDiscountTypeUsage      SubscriptionNewParamsPriceOverridesOverrideMatrixPriceDiscountDiscountType = "usage"
	SubscriptionNewParamsPriceOverridesOverrideMatrixPriceDiscountDiscountTypeAmount     SubscriptionNewParamsPriceOverridesOverrideMatrixPriceDiscountDiscountType = "amount"
)

func (SubscriptionNewParamsPriceOverridesOverrideMatrixPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideMatrixPriceMatrixConfig

type SubscriptionNewParamsPriceOverridesOverrideMatrixPriceMatrixConfig struct {
	// Default per unit rate for any usage not bucketed into a specified matrix_value
	DefaultUnitAmount param.Field[string] `json:"default_unit_amount,required"`
	// One or two event property values to evaluate matrix groups by
	Dimensions param.Field[[]string] `json:"dimensions,required"`
	// Matrix values for specified matrix grouping keys
	MatrixValues param.Field[[]SubscriptionNewParamsPriceOverridesOverrideMatrixPriceMatrixConfigMatrixValue] `json:"matrix_values,required"`
}

func (SubscriptionNewParamsPriceOverridesOverrideMatrixPriceMatrixConfig) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideMatrixPriceMatrixConfigMatrixValue

type SubscriptionNewParamsPriceOverridesOverrideMatrixPriceMatrixConfigMatrixValue struct {
	// One or two matrix keys to filter usage to this Matrix value by. For example,
	// ["region", "tier"] could be used to filter cloud usage by a cloud region and an
	// instance tier.
	DimensionValues param.Field[[]string] `json:"dimension_values,required"`
	// Unit price for the specified dimension_values
	UnitAmount param.Field[string] `json:"unit_amount,required"`
}

func (SubscriptionNewParamsPriceOverridesOverrideMatrixPriceMatrixConfigMatrixValue) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideMatrixPriceModelType

type SubscriptionNewParamsPriceOverridesOverrideMatrixPriceModelType string
const (
	SubscriptionNewParamsPriceOverridesOverrideMatrixPriceModelTypeMatrix SubscriptionNewParamsPriceOverridesOverrideMatrixPriceModelType = "matrix"
)

func (SubscriptionNewParamsPriceOverridesOverrideMatrixPriceModelType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverridePackagePrice

type SubscriptionNewParamsPriceOverridesOverridePackagePrice struct {
	ID            param.Field[string]                                                               `json:"id,required"`
	ModelType     param.Field[SubscriptionNewParamsPriceOverridesOverridePackagePriceModelType]     `json:"model_type,required"`
	PackageConfig param.Field[SubscriptionNewParamsPriceOverridesOverridePackagePricePackageConfig] `json:"package_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionNewParamsPriceOverridesOverridePackagePriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionNewParamsPriceOverridesOverridePackagePrice) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverridePackagePriceDiscount added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverridePackagePriceDiscount struct {
	DiscountType param.Field[SubscriptionNewParamsPriceOverridesOverridePackagePriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionNewParamsPriceOverridesOverridePackagePriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverridePackagePriceDiscountDiscountType added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverridePackagePriceDiscountDiscountType string
const (
	SubscriptionNewParamsPriceOverridesOverridePackagePriceDiscountDiscountTypePercentage SubscriptionNewParamsPriceOverridesOverridePackagePriceDiscountDiscountType = "percentage"
	SubscriptionNewParamsPriceOverridesOverridePackagePriceDiscountDiscountTypeTrial      SubscriptionNewParamsPriceOverridesOverridePackagePriceDiscountDiscountType = "trial"
	SubscriptionNewParamsPriceOverridesOverridePackagePriceDiscountDiscountTypeUsage      SubscriptionNewParamsPriceOverridesOverridePackagePriceDiscountDiscountType = "usage"
	SubscriptionNewParamsPriceOverridesOverridePackagePriceDiscountDiscountTypeAmount     SubscriptionNewParamsPriceOverridesOverridePackagePriceDiscountDiscountType = "amount"
)

func (SubscriptionNewParamsPriceOverridesOverridePackagePriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverridePackagePriceModelType

type SubscriptionNewParamsPriceOverridesOverridePackagePriceModelType string
const (
	SubscriptionNewParamsPriceOverridesOverridePackagePriceModelTypePackage SubscriptionNewParamsPriceOverridesOverridePackagePriceModelType = "package"
)

func (SubscriptionNewParamsPriceOverridesOverridePackagePriceModelType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverridePackagePricePackageConfig

type SubscriptionNewParamsPriceOverridesOverridePackagePricePackageConfig struct {
	// A currency amount to rate usage by
	PackageAmount param.Field[string] `json:"package_amount,required"`
	// An integer amount to represent package size. For example, 1000 here would divide
	// usage by 1000 before multiplying by package_amount in rating
	PackageSize param.Field[int64] `json:"package_size"`
}

func (SubscriptionNewParamsPriceOverridesOverridePackagePricePackageConfig) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPrice

type SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPrice struct {
	ID                          param.Field[string]                                                                         `json:"id,required"`
	ModelType                   param.Field[SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceModelType] `json:"model_type,required"`
	PackageWithAllocationConfig param.Field[map[string]interface{}]                                                         `json:"package_with_allocation_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPrice) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceDiscount added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceDiscount struct {
	DiscountType param.Field[SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountType added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountType string
const (
	SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountTypePercentage SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountType = "percentage"
	SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountTypeTrial      SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountType = "trial"
	SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountTypeUsage      SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountType = "usage"
	SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountTypeAmount     SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountType = "amount"
)

func (SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceModelType

type SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceModelType string
const (
	SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceModelTypePackageWithAllocation SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceModelType = "package_with_allocation"
)

func (SubscriptionNewParamsPriceOverridesOverridePackageWithAllocationPriceModelType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPrice

type SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPrice struct {
	ID                         param.Field[string]                                                                        `json:"id,required"`
	ModelType                  param.Field[SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceModelType] `json:"model_type,required"`
	ThresholdTotalAmountConfig param.Field[map[string]interface{}]                                                        `json:"threshold_total_amount_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPrice) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscount added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscount struct {
	DiscountType param.Field[SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountType added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountType string
const (
	SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountTypePercentage SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountType = "percentage"
	SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountTypeTrial      SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountType = "trial"
	SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountTypeUsage      SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountType = "usage"
	SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountTypeAmount     SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountType = "amount"
)

func (SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceModelType

type SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceModelType string
const (
	SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceModelTypeThresholdTotalAmount SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceModelType = "threshold_total_amount"
)

func (SubscriptionNewParamsPriceOverridesOverrideThresholdTotalAmountPriceModelType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideTieredBpsPrice

type SubscriptionNewParamsPriceOverridesOverrideTieredBpsPrice struct {
	ID              param.Field[string]                                                                   `json:"id,required"`
	ModelType       param.Field[SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceModelType]       `json:"model_type,required"`
	TieredBpsConfig param.Field[SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceTieredBpsConfig] `json:"tiered_bps_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionNewParamsPriceOverridesOverrideTieredBpsPrice) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceDiscount added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceDiscount struct {
	DiscountType param.Field[SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountType added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountType string
const (
	SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountTypePercentage SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountType = "percentage"
	SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountTypeTrial      SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountType = "trial"
	SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountTypeUsage      SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountType = "usage"
	SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountTypeAmount     SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountType = "amount"
)

func (SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceModelType

type SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceModelType string
const (
	SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceModelTypeTieredBps SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceModelType = "tiered_bps"
)

func (SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceModelType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceTieredBpsConfig

type SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceTieredBpsConfig struct {
	// Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
	// tiers
	Tiers param.Field[[]SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceTieredBpsConfigTier] `json:"tiers,required"`
}

func (SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceTieredBpsConfig) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceTieredBpsConfigTier

type SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceTieredBpsConfigTier struct {
	// Per-event basis point rate
	Bps param.Field[float64] `json:"bps,required"`
	// Inclusive tier starting value
	MinimumAmount param.Field[string] `json:"minimum_amount,required"`
	// Exclusive tier ending value
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// Per unit maximum to charge
	PerUnitMaximum param.Field[string] `json:"per_unit_maximum"`
}

func (SubscriptionNewParamsPriceOverridesOverrideTieredBpsPriceTieredBpsConfigTier) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideTieredPackagePrice

type SubscriptionNewParamsPriceOverridesOverrideTieredPackagePrice struct {
	ID                  param.Field[string]                                                                 `json:"id,required"`
	ModelType           param.Field[SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceModelType] `json:"model_type,required"`
	TieredPackageConfig param.Field[map[string]interface{}]                                                 `json:"tiered_package_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionNewParamsPriceOverridesOverrideTieredPackagePrice) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceDiscount added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceDiscount struct {
	DiscountType param.Field[SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountType added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountType string
const (
	SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountTypePercentage SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountType = "percentage"
	SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountTypeTrial      SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountType = "trial"
	SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountTypeUsage      SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountType = "usage"
	SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountTypeAmount     SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountType = "amount"
)

func (SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceModelType

type SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceModelType string
const (
	SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceModelTypeTieredPackage SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceModelType = "tiered_package"
)

func (SubscriptionNewParamsPriceOverridesOverrideTieredPackagePriceModelType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideTieredPrice

type SubscriptionNewParamsPriceOverridesOverrideTieredPrice struct {
	ID           param.Field[string]                                                             `json:"id,required"`
	ModelType    param.Field[SubscriptionNewParamsPriceOverridesOverrideTieredPriceModelType]    `json:"model_type,required"`
	TieredConfig param.Field[SubscriptionNewParamsPriceOverridesOverrideTieredPriceTieredConfig] `json:"tiered_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionNewParamsPriceOverridesOverrideTieredPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionNewParamsPriceOverridesOverrideTieredPrice) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideTieredPriceDiscount added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideTieredPriceDiscount struct {
	DiscountType param.Field[SubscriptionNewParamsPriceOverridesOverrideTieredPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionNewParamsPriceOverridesOverrideTieredPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideTieredPriceDiscountDiscountType added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideTieredPriceDiscountDiscountType string
const (
	SubscriptionNewParamsPriceOverridesOverrideTieredPriceDiscountDiscountTypePercentage SubscriptionNewParamsPriceOverridesOverrideTieredPriceDiscountDiscountType = "percentage"
	SubscriptionNewParamsPriceOverridesOverrideTieredPriceDiscountDiscountTypeTrial      SubscriptionNewParamsPriceOverridesOverrideTieredPriceDiscountDiscountType = "trial"
	SubscriptionNewParamsPriceOverridesOverrideTieredPriceDiscountDiscountTypeUsage      SubscriptionNewParamsPriceOverridesOverrideTieredPriceDiscountDiscountType = "usage"
	SubscriptionNewParamsPriceOverridesOverrideTieredPriceDiscountDiscountTypeAmount     SubscriptionNewParamsPriceOverridesOverrideTieredPriceDiscountDiscountType = "amount"
)

func (SubscriptionNewParamsPriceOverridesOverrideTieredPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideTieredPriceModelType

type SubscriptionNewParamsPriceOverridesOverrideTieredPriceModelType string
const (
	SubscriptionNewParamsPriceOverridesOverrideTieredPriceModelTypeTiered SubscriptionNewParamsPriceOverridesOverrideTieredPriceModelType = "tiered"
)

func (SubscriptionNewParamsPriceOverridesOverrideTieredPriceModelType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideTieredPriceTieredConfig

type SubscriptionNewParamsPriceOverridesOverrideTieredPriceTieredConfig struct {
	// Tiers for rating based on total usage quantities into the specified tier
	Tiers param.Field[[]SubscriptionNewParamsPriceOverridesOverrideTieredPriceTieredConfigTier] `json:"tiers,required"`
}

func (SubscriptionNewParamsPriceOverridesOverrideTieredPriceTieredConfig) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideTieredPriceTieredConfigTier

type SubscriptionNewParamsPriceOverridesOverrideTieredPriceTieredConfigTier struct {
	// Inclusive tier starting value
	FirstUnit param.Field[float64] `json:"first_unit,required"`
	// Amount per unit
	UnitAmount param.Field[string] `json:"unit_amount,required"`
	// Exclusive tier ending value. If null, this is treated as the last tier
	LastUnit param.Field[float64] `json:"last_unit"`
}

func (SubscriptionNewParamsPriceOverridesOverrideTieredPriceTieredConfigTier) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPrice

type SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPrice struct {
	ID                      param.Field[string]                                                                     `json:"id,required"`
	ModelType               param.Field[SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceModelType] `json:"model_type,required"`
	TieredWithMinimumConfig param.Field[map[string]interface{}]                                                     `json:"tiered_with_minimum_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPrice) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceDiscount added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceDiscount struct {
	DiscountType param.Field[SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountType added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountType string
const (
	SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountTypePercentage SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountType = "percentage"
	SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountTypeTrial      SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountType = "trial"
	SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountTypeUsage      SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountType = "usage"
	SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountTypeAmount     SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountType = "amount"
)

func (SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceModelType

type SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceModelType string
const (
	SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceModelTypeTieredWithMinimum SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceModelType = "tiered_with_minimum"
)

func (SubscriptionNewParamsPriceOverridesOverrideTieredWithMinimumPriceModelType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideUnitPrice

type SubscriptionNewParamsPriceOverridesOverrideUnitPrice struct {
	ID         param.Field[string]                                                         `json:"id,required"`
	ModelType  param.Field[SubscriptionNewParamsPriceOverridesOverrideUnitPriceModelType]  `json:"model_type,required"`
	UnitConfig param.Field[SubscriptionNewParamsPriceOverridesOverrideUnitPriceUnitConfig] `json:"unit_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionNewParamsPriceOverridesOverrideUnitPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionNewParamsPriceOverridesOverrideUnitPrice) MarshalJSON

func (r SubscriptionNewParamsPriceOverridesOverrideUnitPrice) MarshalJSON() (data []byte, err error)

type SubscriptionNewParamsPriceOverridesOverrideUnitPriceDiscount added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideUnitPriceDiscount struct {
	DiscountType param.Field[SubscriptionNewParamsPriceOverridesOverrideUnitPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionNewParamsPriceOverridesOverrideUnitPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideUnitPriceDiscountDiscountType added in v0.2.0

type SubscriptionNewParamsPriceOverridesOverrideUnitPriceDiscountDiscountType string
const (
	SubscriptionNewParamsPriceOverridesOverrideUnitPriceDiscountDiscountTypePercentage SubscriptionNewParamsPriceOverridesOverrideUnitPriceDiscountDiscountType = "percentage"
	SubscriptionNewParamsPriceOverridesOverrideUnitPriceDiscountDiscountTypeTrial      SubscriptionNewParamsPriceOverridesOverrideUnitPriceDiscountDiscountType = "trial"
	SubscriptionNewParamsPriceOverridesOverrideUnitPriceDiscountDiscountTypeUsage      SubscriptionNewParamsPriceOverridesOverrideUnitPriceDiscountDiscountType = "usage"
	SubscriptionNewParamsPriceOverridesOverrideUnitPriceDiscountDiscountTypeAmount     SubscriptionNewParamsPriceOverridesOverrideUnitPriceDiscountDiscountType = "amount"
)

func (SubscriptionNewParamsPriceOverridesOverrideUnitPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideUnitPriceModelType

type SubscriptionNewParamsPriceOverridesOverrideUnitPriceModelType string
const (
	SubscriptionNewParamsPriceOverridesOverrideUnitPriceModelTypeUnit SubscriptionNewParamsPriceOverridesOverrideUnitPriceModelType = "unit"
)

func (SubscriptionNewParamsPriceOverridesOverrideUnitPriceModelType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideUnitPriceUnitConfig

type SubscriptionNewParamsPriceOverridesOverrideUnitPriceUnitConfig struct {
	// Rate per unit of usage
	UnitAmount param.Field[string] `json:"unit_amount,required"`
}

func (SubscriptionNewParamsPriceOverridesOverrideUnitPriceUnitConfig) MarshalJSON

type SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPrice added in v0.20.0

type SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPrice struct {
	ID                    param.Field[string]                                                                   `json:"id,required"`
	ModelType             param.Field[SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceModelType] `json:"model_type,required"`
	UnitWithPercentConfig param.Field[map[string]interface{}]                                                   `json:"unit_with_percent_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPrice) MarshalJSON added in v0.20.0

type SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceDiscount added in v0.20.0

type SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceDiscount struct {
	DiscountType param.Field[SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceDiscount) MarshalJSON added in v0.20.0

type SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountType added in v0.20.0

type SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountType string
const (
	SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountTypePercentage SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountType = "percentage"
	SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountTypeTrial      SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountType = "trial"
	SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountTypeUsage      SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountType = "usage"
	SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountTypeAmount     SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountType = "amount"
)

func (SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceModelType added in v0.20.0

type SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceModelType string
const (
	SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceModelTypeUnitWithPercent SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceModelType = "unit_with_percent"
)

func (SubscriptionNewParamsPriceOverridesOverrideUnitWithPercentPriceModelType) IsKnown added in v0.24.0

type SubscriptionPriceInterval

type SubscriptionPriceInterval struct {
	ID string `json:"id,required"`
	// The day of the month that Orb bills for this price
	BillingCycleDay int64 `json:"billing_cycle_day,required"`
	// The end of the current billing period. This is an exclusive timestamp, such that
	// the instant returned is exactly the end of the billing period. Set to null if
	// this price interval is not currently active.
	CurrentBillingPeriodEndDate time.Time `json:"current_billing_period_end_date,required,nullable" format:"date-time"`
	// The start date of the current billing period. This is an inclusive timestamp;
	// the instant returned is exactly the beginning of the billing period. Set to null
	// if this price interval is not currently active.
	CurrentBillingPeriodStartDate time.Time `json:"current_billing_period_start_date,required,nullable" format:"date-time"`
	// The end date of the price interval. This is the date that Orb stops billing for
	// this price.
	EndDate time.Time `json:"end_date,required,nullable" format:"date-time"`
	// The fixed fee quantity transitions for this price interval. This is only
	// relevant for fixed fees.
	FixedFeeQuantityTransitions []SubscriptionPriceIntervalsFixedFeeQuantityTransition `json:"fixed_fee_quantity_transitions,required,nullable"`
	// The Price resource represents a price that can be billed on a subscription,
	// resulting in a charge on an invoice in the form of an invoice line item. Prices
	// take a quantity and determine an amount to bill.
	//
	// Orb supports a few different pricing models out of the box. Each of these models
	// is serialized differently in a given Price object. The model_type field
	// determines the key for the configuration object that is present.
	//
	// ## Unit pricing
	//
	// With unit pricing, each unit costs a fixed amount.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "unit",
	//	    "unit_config": {
	//	        "unit_amount": "0.50"
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Tiered pricing
	//
	// In tiered pricing, the cost of a given unit depends on the tier range that it
	// falls into, where each tier range is defined by an upper and lower bound. For
	// example, the first ten units may cost $0.50 each and all units thereafter may
	// cost $0.10 each.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "tiered",
	//	    "tiered_config": {
	//	        "tiers": [
	//	            {
	//	                "first_unit": 1,
	//	                "last_unit": 10,
	//	                "unit_amount": "0.50"
	//	            },
	//	            {
	//	                "first_unit": 11,
	//	                "last_unit": null,
	//	                "unit_amount": "0.10"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//
	// “`
	//
	// ## Bulk pricing
	//
	// Bulk pricing applies when the number of units determine the cost of all units.
	// For example, if you've bought less than 10 units, they may each be $0.50 for a
	// total of $5.00. Once you've bought more than 10 units, all units may now be
	// priced at $0.40 (i.e. 101 units total would be $40.40).
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "bulk",
	//	    "bulk_config": {
	//	        "tiers": [
	//	            {
	//	                "maximum_units": 10,
	//	                "unit_amount": "0.50"
	//	            },
	//	            {
	//	                "maximum_units": 1000,
	//	                "unit_amount": "0.40"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Package pricing
	//
	// Package pricing defines the size or granularity of a unit for billing purposes.
	// For example, if the package size is set to 5, then 4 units will be billed as 5
	// and 6 units will be billed at 10.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "package",
	//	    "package_config": {
	//	        "package_amount": "0.80",
	//	        "package_size": 10
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## BPS pricing
	//
	// BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
	// percent (the number of basis points to charge), as well as a cap per event to
	// assess. For example, this would allow you to assess a fee of 0.25% on every
	// payment you process, with a maximum charge of $25 per payment.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "model_type": "bps",
	//	    "bps_config": {
	//	       "bps": 125,
	//	       "per_unit_maximum": "11.00"
	//	    }
	//	    ...
	//	 }
	//
	// “`
	//
	// ## Bulk BPS pricing
	//
	// Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
	// total quantity across all events. Similar to bulk pricing, the BPS parameters of
	// a given event depends on the tier range that the billing period falls into. Each
	// tier range is defined by an upper bound. For example, after $1.5M of payment
	// volume is reached, each individual payment may have a lower cap or a smaller
	// take-rate.
	//
	// “`json
	//
	//	    ...
	//	    "model_type": "bulk_bps",
	//	    "bulk_bps_config": {
	//	        "tiers": [
	//	           {
	//	                "maximum_amount": "1000000.00",
	//	                "bps": 125,
	//	                "per_unit_maximum": "19.00"
	//	           },
	//	          {
	//	                "maximum_amount": null,
	//	                "bps": 115,
	//	                "per_unit_maximum": "4.00"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Tiered BPS pricing
	//
	// Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
	// event's applicable parameter is a function of its marginal addition to the
	// period total. Similar to tiered pricing, the BPS parameters of a given event
	// depends on the tier range that it falls into, where each tier range is defined
	// by an upper and lower bound. For example, the first few payments may have a 0.8
	// BPS take-rate and all payments after a specific volume may incur a take-rate of
	// 0.5 BPS each.
	//
	// “`json
	//
	//	    ...
	//	    "model_type": "tiered_bps",
	//	    "tiered_bps_config": {
	//	        "tiers": [
	//	           {
	//	                "minimum_amount": "0",
	//	                "maximum_amount": "1000000.00",
	//	                "bps": 125,
	//	                "per_unit_maximum": "19.00"
	//	           },
	//	          {
	//	                "minimum_amount": "1000000.00",
	//	                "maximum_amount": null,
	//	                "bps": 115,
	//	                "per_unit_maximum": "4.00"
	//	            }
	//	        ]
	//	    }
	//	    ...
	//	}
	//
	// “`
	//
	// ## Matrix pricing
	//
	// Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
	// `dimensions` defines the two event property values evaluated in this pricing
	// model. In a one-dimensional matrix, the second value is `null`. Every
	// configuration has a list of `matrix_values` which give the unit prices for
	// specified property values. In a one-dimensional matrix, the matrix values will
	// have `dimension_values` where the second value of the pair is null. If an event
	// does not match any of the dimension values in the matrix, it will resort to the
	// `default_unit_amount`.
	//
	// “`json
	//
	//	{
	//	    "model_type": "matrix"
	//	    "matrix_config": {
	//	        "default_unit_amount": "3.00",
	//	        "dimensions": [
	//	            "cluster_name",
	//	            "region"
	//	        ],
	//	        "matrix_values": [
	//	            {
	//	                "dimension_values": [
	//	                    "alpha",
	//	                    "west"
	//	                ],
	//	                "unit_amount": "2.00"
	//	            },
	//	            ...
	//	        ]
	//	    }
	//	}
	//
	// “`
	//
	// ## Fixed fees
	//
	// Fixed fees are prices that are applied independent of usage quantities, and
	// follow unit pricing. They also have an additional parameter
	// `fixed_price_quantity`. If the Price represents a fixed cost, this represents
	// the quantity of units applied.
	//
	// “`json
	//
	//	{
	//	    ...
	//	    "id": "price_id",
	//	    "model_type": "unit",
	//	    "unit_config": {
	//	       "unit_amount": "2.00"
	//	    },
	//	    "fixed_price_quantity": 3.0
	//	    ...
	//	}
	//
	// “`
	Price Price `json:"price,required"`
	// The start date of the price interval. This is the date that Orb starts billing
	// for this price.
	StartDate time.Time                     `json:"start_date,required" format:"date-time"`
	JSON      subscriptionPriceIntervalJSON `json:"-"`
}

The Price Interval resource represents a period of time for which a price will bill on a subscription. A subscription’s price intervals define its billing behavior.

func (*SubscriptionPriceInterval) UnmarshalJSON

func (r *SubscriptionPriceInterval) UnmarshalJSON(data []byte) (err error)

type SubscriptionPriceIntervalsFixedFeeQuantityTransition

type SubscriptionPriceIntervalsFixedFeeQuantityTransition struct {
	EffectiveDate time.Time                                                `json:"effective_date,required" format:"date-time"`
	PriceID       string                                                   `json:"price_id,required"`
	Quantity      int64                                                    `json:"quantity,required"`
	JSON          subscriptionPriceIntervalsFixedFeeQuantityTransitionJSON `json:"-"`
}

func (*SubscriptionPriceIntervalsFixedFeeQuantityTransition) UnmarshalJSON

func (r *SubscriptionPriceIntervalsFixedFeeQuantityTransition) UnmarshalJSON(data []byte) (err error)

type SubscriptionPriceIntervalsParams

type SubscriptionPriceIntervalsParams struct {
	// A list of price intervals to add to the subscription.
	Add param.Field[[]SubscriptionPriceIntervalsParamsAdd] `json:"add"`
	// A list of price intervals to edit on the subscription.
	Edit param.Field[[]SubscriptionPriceIntervalsParamsEdit] `json:"edit"`
}

func (SubscriptionPriceIntervalsParams) MarshalJSON

func (r SubscriptionPriceIntervalsParams) MarshalJSON() (data []byte, err error)

type SubscriptionPriceIntervalsParamsAdd

type SubscriptionPriceIntervalsParamsAdd struct {
	// The start date of the price interval. This is the date that the price will start
	// billing on the subscription.
	StartDate param.Field[SubscriptionPriceIntervalsParamsAddStartDate] `json:"start_date,required" format:"date-time"`
	// A list of discounts to initialize on the price interval.
	Discounts param.Field[[]SubscriptionPriceIntervalsParamsAddDiscount] `json:"discounts"`
	// The end date of the price interval. This is the date that the price will stop
	// billing on the subscription.
	EndDate param.Field[SubscriptionPriceIntervalsParamsAddEndDate] `json:"end_date" format:"date-time"`
	// The external price id of the price to add to the subscription.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// A list of fixed fee quantity transitions to initialize on the price interval.
	FixedFeeQuantityTransitions param.Field[[]SubscriptionPriceIntervalsParamsAddFixedFeeQuantityTransition] `json:"fixed_fee_quantity_transitions"`
	// The maximum amount that will be billed for this price interval for a given
	// billing period.
	MaximumAmount param.Field[float64] `json:"maximum_amount"`
	// The minimum amount that will be billed for this price interval for a given
	// billing period.
	MinimumAmount param.Field[float64] `json:"minimum_amount"`
	// The definition of a new price to create and add to the subscription.
	Price param.Field[SubscriptionPriceIntervalsParamsAddPrice] `json:"price"`
	// The id of the price to add to the subscription.
	PriceID param.Field[string] `json:"price_id"`
}

func (SubscriptionPriceIntervalsParamsAdd) MarshalJSON

func (r SubscriptionPriceIntervalsParamsAdd) MarshalJSON() (data []byte, err error)

type SubscriptionPriceIntervalsParamsAddDiscountsAmountDiscountCreationParams

type SubscriptionPriceIntervalsParamsAddDiscountsAmountDiscountCreationParams struct {
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[float64]                                                                              `json:"amount_discount,required"`
	DiscountType   param.Field[SubscriptionPriceIntervalsParamsAddDiscountsAmountDiscountCreationParamsDiscountType] `json:"discount_type,required"`
}

func (SubscriptionPriceIntervalsParamsAddDiscountsAmountDiscountCreationParams) MarshalJSON

type SubscriptionPriceIntervalsParamsAddDiscountsAmountDiscountCreationParamsDiscountType

type SubscriptionPriceIntervalsParamsAddDiscountsAmountDiscountCreationParamsDiscountType string
const (
	SubscriptionPriceIntervalsParamsAddDiscountsAmountDiscountCreationParamsDiscountTypeAmount SubscriptionPriceIntervalsParamsAddDiscountsAmountDiscountCreationParamsDiscountType = "amount"
)

func (SubscriptionPriceIntervalsParamsAddDiscountsAmountDiscountCreationParamsDiscountType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddDiscountsPercentageDiscountCreationParams

type SubscriptionPriceIntervalsParamsAddDiscountsPercentageDiscountCreationParams struct {
	DiscountType param.Field[SubscriptionPriceIntervalsParamsAddDiscountsPercentageDiscountCreationParamsDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount,required"`
}

func (SubscriptionPriceIntervalsParamsAddDiscountsPercentageDiscountCreationParams) MarshalJSON

type SubscriptionPriceIntervalsParamsAddDiscountsPercentageDiscountCreationParamsDiscountType

type SubscriptionPriceIntervalsParamsAddDiscountsPercentageDiscountCreationParamsDiscountType string
const (
	SubscriptionPriceIntervalsParamsAddDiscountsPercentageDiscountCreationParamsDiscountTypePercentage SubscriptionPriceIntervalsParamsAddDiscountsPercentageDiscountCreationParamsDiscountType = "percentage"
)

func (SubscriptionPriceIntervalsParamsAddDiscountsPercentageDiscountCreationParamsDiscountType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddDiscountsUsageDiscountCreationParams

type SubscriptionPriceIntervalsParamsAddDiscountsUsageDiscountCreationParams struct {
	DiscountType param.Field[SubscriptionPriceIntervalsParamsAddDiscountsUsageDiscountCreationParamsDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for.
	UsageDiscount param.Field[float64] `json:"usage_discount,required"`
}

func (SubscriptionPriceIntervalsParamsAddDiscountsUsageDiscountCreationParams) MarshalJSON

type SubscriptionPriceIntervalsParamsAddDiscountsUsageDiscountCreationParamsDiscountType

type SubscriptionPriceIntervalsParamsAddDiscountsUsageDiscountCreationParamsDiscountType string
const (
	SubscriptionPriceIntervalsParamsAddDiscountsUsageDiscountCreationParamsDiscountTypeUsage SubscriptionPriceIntervalsParamsAddDiscountsUsageDiscountCreationParamsDiscountType = "usage"
)

func (SubscriptionPriceIntervalsParamsAddDiscountsUsageDiscountCreationParamsDiscountType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddEndDate

type SubscriptionPriceIntervalsParamsAddEndDate interface {
	ImplementsSubscriptionPriceIntervalsParamsAddEndDate()
}

The end date of the price interval. This is the date that the price will stop billing on the subscription.

Satisfied by shared.UnionTime, SubscriptionPriceIntervalsParamsAddEndDateString.

type SubscriptionPriceIntervalsParamsAddEndDateString

type SubscriptionPriceIntervalsParamsAddEndDateString string
const (
	SubscriptionPriceIntervalsParamsAddEndDateStringStartOfTerm SubscriptionPriceIntervalsParamsAddEndDateString = "start_of_term"
	SubscriptionPriceIntervalsParamsAddEndDateStringEndOfTerm   SubscriptionPriceIntervalsParamsAddEndDateString = "end_of_term"
)

func (SubscriptionPriceIntervalsParamsAddEndDateString) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddFixedFeeQuantityTransition

type SubscriptionPriceIntervalsParamsAddFixedFeeQuantityTransition struct {
	// The date that the fixed fee quantity transition should take effect.
	EffectiveDate param.Field[time.Time] `json:"effective_date,required" format:"date-time"`
	// The quantity of the fixed fee quantity transition.
	Quantity param.Field[int64] `json:"quantity,required"`
}

func (SubscriptionPriceIntervalsParamsAddFixedFeeQuantityTransition) MarshalJSON

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPrice added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPrice struct {
	BpsConfig param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceBpsConfig] `json:"bps_config,required"`
	// The cadence to bill for this price on.
	Cadence param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                               `json:"item_id,required"`
	ModelType param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name param.Field[string] `json:"name,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPrice) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceBpsConfig added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceBpsConfig struct {
	// Basis point take rate per event
	Bps param.Field[float64] `json:"bps,required"`
	// Optional currency amount maximum to cap spend per event
	PerUnitMaximum param.Field[string] `json:"per_unit_maximum"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceBpsConfig) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceCadence added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceCadence string

The cadence to bill for this price on.

const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceCadenceAnnual    SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceCadence = "annual"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceCadenceMonthly   SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceCadence = "monthly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceCadenceQuarterly SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceCadence = "quarterly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceCadenceOneTime   SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceCadence = "one_time"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceCadence) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceModelType added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceModelType string
const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceModelTypeBps SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceModelType = "bps"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingBpsPriceModelType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPrice added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPrice struct {
	BulkBpsConfig param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceBulkBpsConfig] `json:"bulk_bps_config,required"`
	// The cadence to bill for this price on.
	Cadence param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                                   `json:"item_id,required"`
	ModelType param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name param.Field[string] `json:"name,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPrice) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceBulkBpsConfig added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceBulkBpsConfig struct {
	// Tiers for a bulk BPS pricing model where all usage is aggregated to a single
	// tier based on total volume
	Tiers param.Field[[]SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceBulkBpsConfigTier] `json:"tiers,required"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceBulkBpsConfig) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceBulkBpsConfigTier added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceBulkBpsConfigTier struct {
	// Basis points to rate on
	Bps param.Field[float64] `json:"bps,required"`
	// Upper bound for tier
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The maximum amount to charge for any one event
	PerUnitMaximum param.Field[string] `json:"per_unit_maximum"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceBulkBpsConfigTier) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceCadence added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceCadence string

The cadence to bill for this price on.

const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceCadenceAnnual    SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceCadence = "annual"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceCadenceMonthly   SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceCadence = "monthly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceCadenceQuarterly SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceCadence = "quarterly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceCadenceOneTime   SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceCadence = "one_time"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceCadence) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceModelType added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceModelType string
const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceModelTypeBulkBps SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceModelType = "bulk_bps"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkBpsPriceModelType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPrice added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPrice struct {
	BulkConfig param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceBulkConfig] `json:"bulk_config,required"`
	// The cadence to bill for this price on.
	Cadence param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                                `json:"item_id,required"`
	ModelType param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name param.Field[string] `json:"name,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPrice) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceBulkConfig added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceBulkConfig struct {
	// Bulk tiers for rating based on total usage volume
	Tiers param.Field[[]SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceBulkConfigTier] `json:"tiers,required"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceBulkConfig) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceBulkConfigTier added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceBulkConfigTier struct {
	// Amount per unit
	UnitAmount param.Field[string] `json:"unit_amount,required"`
	// Upper bound for this tier
	MaximumUnits param.Field[float64] `json:"maximum_units"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceBulkConfigTier) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceCadence added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceCadence string

The cadence to bill for this price on.

const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceCadenceAnnual    SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceCadence = "annual"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceCadenceMonthly   SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceCadence = "monthly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceCadenceQuarterly SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceCadence = "quarterly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceCadenceOneTime   SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceCadence = "one_time"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceCadence) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceModelType added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceModelType string
const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceModelTypeBulk SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceModelType = "bulk"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingBulkPriceModelType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPrice added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID       param.Field[string]                                                                     `json:"item_id,required"`
	MatrixConfig param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceMatrixConfig] `json:"matrix_config,required"`
	ModelType    param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceModelType]    `json:"model_type,required"`
	// The name of the price.
	Name param.Field[string] `json:"name,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPrice) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceCadence added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceCadence string

The cadence to bill for this price on.

const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceCadenceAnnual    SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceCadence = "annual"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceCadenceMonthly   SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceCadence = "monthly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceCadenceQuarterly SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceCadence = "quarterly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceCadenceOneTime   SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceCadence = "one_time"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceCadence) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceMatrixConfig added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceMatrixConfig struct {
	// Default per unit rate for any usage not bucketed into a specified matrix_value
	DefaultUnitAmount param.Field[string] `json:"default_unit_amount,required"`
	// One or two event property values to evaluate matrix groups by
	Dimensions param.Field[[]string] `json:"dimensions,required"`
	// Matrix values for specified matrix grouping keys
	MatrixValues param.Field[[]SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceMatrixConfigMatrixValue] `json:"matrix_values,required"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceMatrixConfig) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceMatrixConfigMatrixValue added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceMatrixConfigMatrixValue struct {
	// One or two matrix keys to filter usage to this Matrix value by. For example,
	// ["region", "tier"] could be used to filter cloud usage by a cloud region and an
	// instance tier.
	DimensionValues param.Field[[]string] `json:"dimension_values,required"`
	// Unit price for the specified dimension_values
	UnitAmount param.Field[string] `json:"unit_amount,required"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceMatrixConfigMatrixValue) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceModelType added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceModelType string
const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceModelTypeMatrix SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceModelType = "matrix"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixPriceModelType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPrice added in v0.22.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID                     param.Field[string]                                                                                                 `json:"item_id,required"`
	MatrixWithAllocationConfig param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig] `json:"matrix_with_allocation_config,required"`
	ModelType                  param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceModelType]                  `json:"model_type,required"`
	// The name of the price.
	Name param.Field[string] `json:"name,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPrice) MarshalJSON added in v0.22.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceCadence added in v0.22.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceCadence string

The cadence to bill for this price on.

const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceCadenceAnnual    SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceCadence = "annual"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceCadenceMonthly   SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceCadence = "monthly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceCadenceQuarterly SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceCadence = "quarterly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceCadenceOneTime   SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceCadence = "one_time"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceCadence) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig added in v0.22.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig struct {
	// Allocation to be used to calculate the price
	Allocation param.Field[float64] `json:"allocation,required"`
	// Default per unit rate for any usage not bucketed into a specified matrix_value
	DefaultUnitAmount param.Field[string] `json:"default_unit_amount,required"`
	// One or two event property values to evaluate matrix groups by
	Dimensions param.Field[[]string] `json:"dimensions,required"`
	// Matrix values for specified matrix grouping keys
	MatrixValues param.Field[[]SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue] `json:"matrix_values,required"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfig) MarshalJSON added in v0.22.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue added in v0.22.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue struct {
	// One or two matrix keys to filter usage to this Matrix value by. For example,
	// ["region", "tier"] could be used to filter cloud usage by a cloud region and an
	// instance tier.
	DimensionValues param.Field[[]string] `json:"dimension_values,required"`
	// Unit price for the specified dimension_values
	UnitAmount param.Field[string] `json:"unit_amount,required"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceMatrixWithAllocationConfigMatrixValue) MarshalJSON added in v0.22.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceModelType added in v0.22.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceModelType string
const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceModelTypeMatrixWithAllocation SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceModelType = "matrix_with_allocation"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingMatrixWithAllocationPriceModelType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePrice added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                                   `json:"item_id,required"`
	ModelType param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name          param.Field[string]                                                                       `json:"name,required"`
	PackageConfig param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePricePackageConfig] `json:"package_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePrice) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceCadence added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceCadence string

The cadence to bill for this price on.

const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceCadenceAnnual    SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceCadence = "annual"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceCadenceMonthly   SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceCadence = "monthly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceCadenceQuarterly SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceCadence = "quarterly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceCadenceOneTime   SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceCadence = "one_time"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceCadence) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceModelType added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceModelType string
const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceModelTypePackage SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceModelType = "package"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePriceModelType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePricePackageConfig added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePricePackageConfig struct {
	// A currency amount to rate usage by
	PackageAmount param.Field[string] `json:"package_amount,required"`
	// An integer amount to represent package size. For example, 1000 here would divide
	// usage by 1000 before multiplying by package_amount in rating
	PackageSize param.Field[int64] `json:"package_size"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackagePricePackageConfig) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPrice added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                                                 `json:"item_id,required"`
	ModelType param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                        param.Field[string]                 `json:"name,required"`
	PackageWithAllocationConfig param.Field[map[string]interface{}] `json:"package_with_allocation_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPrice) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceCadence added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceCadence string

The cadence to bill for this price on.

const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceCadenceAnnual    SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceCadence = "annual"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceCadenceMonthly   SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceCadence = "monthly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceCadenceQuarterly SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceCadence = "quarterly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceCadenceOneTime   SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceCadence = "one_time"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceCadence) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceModelType added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceModelType string
const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceModelTypePackageWithAllocation SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceModelType = "package_with_allocation"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingPackageWithAllocationPriceModelType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPrice added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                                                `json:"item_id,required"`
	ModelType param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                       param.Field[string]                 `json:"name,required"`
	ThresholdTotalAmountConfig param.Field[map[string]interface{}] `json:"threshold_total_amount_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPrice) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceCadence added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceCadence string

The cadence to bill for this price on.

const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceCadenceAnnual    SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceCadence = "annual"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceCadenceMonthly   SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceCadence = "monthly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceCadenceQuarterly SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceCadence = "quarterly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceCadenceOneTime   SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceCadence = "one_time"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceCadence) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceModelType added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceModelType string
const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceModelTypeThresholdTotalAmount SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceModelType = "threshold_total_amount"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingThresholdTotalAmountPriceModelType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPrice added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                                     `json:"item_id,required"`
	ModelType param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name            param.Field[string]                                                                           `json:"name,required"`
	TieredBpsConfig param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceTieredBpsConfig] `json:"tiered_bps_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPrice) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceCadence added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceCadence string

The cadence to bill for this price on.

const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceCadenceAnnual    SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceCadence = "annual"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceCadenceMonthly   SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceCadence = "monthly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceCadenceQuarterly SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceCadence = "quarterly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceCadenceOneTime   SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceCadence = "one_time"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceCadence) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceModelType added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceModelType string
const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceModelTypeTieredBps SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceModelType = "tiered_bps"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceModelType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceTieredBpsConfig added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceTieredBpsConfig struct {
	// Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
	// tiers
	Tiers param.Field[[]SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceTieredBpsConfigTier] `json:"tiers,required"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceTieredBpsConfig) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceTieredBpsConfigTier added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceTieredBpsConfigTier struct {
	// Per-event basis point rate
	Bps param.Field[float64] `json:"bps,required"`
	// Inclusive tier starting value
	MinimumAmount param.Field[string] `json:"minimum_amount,required"`
	// Exclusive tier ending value
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// Per unit maximum to charge
	PerUnitMaximum param.Field[string] `json:"per_unit_maximum"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredBpsPriceTieredBpsConfigTier) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePrice added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                                         `json:"item_id,required"`
	ModelType param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                param.Field[string]                 `json:"name,required"`
	TieredPackageConfig param.Field[map[string]interface{}] `json:"tiered_package_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePrice) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceCadence added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceCadence string

The cadence to bill for this price on.

const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceCadenceAnnual    SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceCadence = "annual"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceCadenceMonthly   SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceCadence = "monthly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceCadenceQuarterly SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceCadence = "quarterly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceCadenceOneTime   SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceCadence = "one_time"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceCadence) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceModelType added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceModelType string
const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceModelTypeTieredPackage SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceModelType = "tiered_package"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackagePriceModelType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPrice added in v0.20.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                                                    `json:"item_id,required"`
	ModelType param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                           param.Field[string]                 `json:"name,required"`
	TieredPackageWithMinimumConfig param.Field[map[string]interface{}] `json:"tiered_package_with_minimum_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPrice) MarshalJSON added in v0.20.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceCadence added in v0.20.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceCadence string

The cadence to bill for this price on.

const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceCadenceAnnual    SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceCadence = "annual"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceCadenceMonthly   SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceCadence = "monthly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceCadenceQuarterly SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceCadence = "quarterly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceCadenceOneTime   SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceCadence = "one_time"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceCadence) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceModelType added in v0.20.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceModelType string
const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceModelTypeTieredPackageWithMinimum SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceModelType = "tiered_package_with_minimum"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPackageWithMinimumPriceModelType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPrice added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                                  `json:"item_id,required"`
	ModelType param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name         param.Field[string]                                                                     `json:"name,required"`
	TieredConfig param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceTieredConfig] `json:"tiered_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPrice) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceCadence added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceCadence string

The cadence to bill for this price on.

const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceCadenceAnnual    SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceCadence = "annual"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceCadenceMonthly   SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceCadence = "monthly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceCadenceQuarterly SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceCadence = "quarterly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceCadenceOneTime   SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceCadence = "one_time"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceCadence) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceModelType added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceModelType string
const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceModelTypeTiered SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceModelType = "tiered"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceModelType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceTieredConfig added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceTieredConfig struct {
	// Tiers for rating based on total usage quantities into the specified tier
	Tiers param.Field[[]SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceTieredConfigTier] `json:"tiers,required"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceTieredConfig) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceTieredConfigTier added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceTieredConfigTier struct {
	// Inclusive tier starting value
	FirstUnit param.Field[float64] `json:"first_unit,required"`
	// Amount per unit
	UnitAmount param.Field[string] `json:"unit_amount,required"`
	// Exclusive tier ending value. If null, this is treated as the last tier
	LastUnit param.Field[float64] `json:"last_unit"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredPriceTieredConfigTier) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPrice added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                                             `json:"item_id,required"`
	ModelType param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                    param.Field[string]                 `json:"name,required"`
	TieredWithMinimumConfig param.Field[map[string]interface{}] `json:"tiered_with_minimum_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPrice) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceCadence added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceCadence string

The cadence to bill for this price on.

const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceCadenceAnnual    SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceCadence = "annual"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceCadenceMonthly   SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceCadence = "monthly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceCadenceQuarterly SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceCadence = "quarterly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceCadenceOneTime   SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceCadence = "one_time"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceCadence) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceModelType added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceModelType string
const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceModelTypeTieredWithMinimum SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceModelType = "tiered_with_minimum"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingTieredWithMinimumPriceModelType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPrice added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                                `json:"item_id,required"`
	ModelType param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name       param.Field[string]                                                                 `json:"name,required"`
	UnitConfig param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceUnitConfig] `json:"unit_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPrice) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceCadence added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceCadence string

The cadence to bill for this price on.

const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceCadenceAnnual    SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceCadence = "annual"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceCadenceMonthly   SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceCadence = "monthly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceCadenceQuarterly SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceCadence = "quarterly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceCadenceOneTime   SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceCadence = "one_time"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceCadence) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceModelType added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceModelType string
const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceModelTypeUnit SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceModelType = "unit"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceModelType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceUnitConfig added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceUnitConfig struct {
	// Rate per unit of usage
	UnitAmount param.Field[string] `json:"unit_amount,required"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitPriceUnitConfig) MarshalJSON added in v0.2.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPrice added in v0.20.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPrice struct {
	// The cadence to bill for this price on.
	Cadence param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceCadence] `json:"cadence,required"`
	// An ISO 4217 currency string for which this price is billed in.
	Currency param.Field[string] `json:"currency,required"`
	// The id of the item the plan will be associated with.
	ItemID    param.Field[string]                                                                           `json:"item_id,required"`
	ModelType param.Field[SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceModelType] `json:"model_type,required"`
	// The name of the price.
	Name                  param.Field[string]                 `json:"name,required"`
	UnitWithPercentConfig param.Field[map[string]interface{}] `json:"unit_with_percent_config,required"`
	// The id of the billable metric for the price. Only needed if the price is
	// usage-based.
	BillableMetricID param.Field[string] `json:"billable_metric_id"`
	// If the Price represents a fixed cost, the price will be billed in-advance if
	// this is true, and in-arrears if this is false.
	BilledInAdvance param.Field[bool] `json:"billed_in_advance"`
	// An alias for the price.
	ExternalPriceID param.Field[string] `json:"external_price_id"`
	// If the Price represents a fixed cost, this represents the quantity of units
	// applied.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The property used to group this price on an invoice
	InvoiceGroupingKey param.Field[string] `json:"invoice_grouping_key"`
}

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPrice) MarshalJSON added in v0.20.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceCadence added in v0.20.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceCadence string

The cadence to bill for this price on.

const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceCadenceAnnual    SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceCadence = "annual"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceCadenceMonthly   SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceCadence = "monthly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceCadenceQuarterly SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceCadence = "quarterly"
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceCadenceOneTime   SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceCadence = "one_time"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceCadence) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceModelType added in v0.20.0

type SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceModelType string
const (
	SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceModelTypeUnitWithPercent SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceModelType = "unit_with_percent"
)

func (SubscriptionPriceIntervalsParamsAddPriceNewFloatingUnitWithPercentPriceModelType) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsAddStartDate

type SubscriptionPriceIntervalsParamsAddStartDate interface {
	ImplementsSubscriptionPriceIntervalsParamsAddStartDate()
}

The start date of the price interval. This is the date that the price will start billing on the subscription.

Satisfied by shared.UnionTime, SubscriptionPriceIntervalsParamsAddStartDateString.

type SubscriptionPriceIntervalsParamsAddStartDateString

type SubscriptionPriceIntervalsParamsAddStartDateString string
const (
	SubscriptionPriceIntervalsParamsAddStartDateStringStartOfTerm SubscriptionPriceIntervalsParamsAddStartDateString = "start_of_term"
	SubscriptionPriceIntervalsParamsAddStartDateStringEndOfTerm   SubscriptionPriceIntervalsParamsAddStartDateString = "end_of_term"
)

func (SubscriptionPriceIntervalsParamsAddStartDateString) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsEdit

type SubscriptionPriceIntervalsParamsEdit struct {
	// The id of the price interval to edit.
	PriceIntervalID param.Field[string] `json:"price_interval_id,required"`
	// The updated billing cycle day for this price interval. If not specified, the
	// billing cycle day will not be updated. Note that overlapping price intervals
	// must have the same billing cycle day.
	BillingCycleDay param.Field[int64] `json:"billing_cycle_day"`
	// The updated end date of this price interval. If not specified, the start date
	// will not be updated.
	EndDate param.Field[SubscriptionPriceIntervalsParamsEditEndDate] `json:"end_date" format:"date-time"`
	// A list of fixed fee quantity transitions to use for this price interval. Note
	// that this list will overwrite all existing fixed fee quantity transitions on the
	// price interval.
	FixedFeeQuantityTransitions param.Field[[]SubscriptionPriceIntervalsParamsEditFixedFeeQuantityTransition] `json:"fixed_fee_quantity_transitions"`
	// The updated start date of this price interval. If not specified, the start date
	// will not be updated.
	StartDate param.Field[SubscriptionPriceIntervalsParamsEditStartDate] `json:"start_date" format:"date-time"`
}

func (SubscriptionPriceIntervalsParamsEdit) MarshalJSON

func (r SubscriptionPriceIntervalsParamsEdit) MarshalJSON() (data []byte, err error)

type SubscriptionPriceIntervalsParamsEditEndDate

type SubscriptionPriceIntervalsParamsEditEndDate interface {
	ImplementsSubscriptionPriceIntervalsParamsEditEndDate()
}

The updated end date of this price interval. If not specified, the start date will not be updated.

Satisfied by shared.UnionTime, SubscriptionPriceIntervalsParamsEditEndDateString.

type SubscriptionPriceIntervalsParamsEditEndDateString

type SubscriptionPriceIntervalsParamsEditEndDateString string
const (
	SubscriptionPriceIntervalsParamsEditEndDateStringStartOfTerm SubscriptionPriceIntervalsParamsEditEndDateString = "start_of_term"
	SubscriptionPriceIntervalsParamsEditEndDateStringEndOfTerm   SubscriptionPriceIntervalsParamsEditEndDateString = "end_of_term"
)

func (SubscriptionPriceIntervalsParamsEditEndDateString) IsKnown added in v0.24.0

type SubscriptionPriceIntervalsParamsEditFixedFeeQuantityTransition

type SubscriptionPriceIntervalsParamsEditFixedFeeQuantityTransition struct {
	// The date that the fixed fee quantity transition should take effect.
	EffectiveDate param.Field[time.Time] `json:"effective_date,required" format:"date-time"`
	// The quantity of the fixed fee quantity transition.
	Quantity param.Field[int64] `json:"quantity,required"`
}

func (SubscriptionPriceIntervalsParamsEditFixedFeeQuantityTransition) MarshalJSON

type SubscriptionPriceIntervalsParamsEditStartDate

type SubscriptionPriceIntervalsParamsEditStartDate interface {
	ImplementsSubscriptionPriceIntervalsParamsEditStartDate()
}

The updated start date of this price interval. If not specified, the start date will not be updated.

Satisfied by shared.UnionTime, SubscriptionPriceIntervalsParamsEditStartDateString.

type SubscriptionPriceIntervalsParamsEditStartDateString

type SubscriptionPriceIntervalsParamsEditStartDateString string
const (
	SubscriptionPriceIntervalsParamsEditStartDateStringStartOfTerm SubscriptionPriceIntervalsParamsEditStartDateString = "start_of_term"
	SubscriptionPriceIntervalsParamsEditStartDateStringEndOfTerm   SubscriptionPriceIntervalsParamsEditStartDateString = "end_of_term"
)

func (SubscriptionPriceIntervalsParamsEditStartDateString) IsKnown added in v0.24.0

type SubscriptionRedeemedCoupon

type SubscriptionRedeemedCoupon struct {
	CouponID  string                         `json:"coupon_id,required"`
	EndDate   time.Time                      `json:"end_date,required,nullable" format:"date-time"`
	StartDate time.Time                      `json:"start_date,required" format:"date-time"`
	JSON      subscriptionRedeemedCouponJSON `json:"-"`
}

func (*SubscriptionRedeemedCoupon) UnmarshalJSON

func (r *SubscriptionRedeemedCoupon) UnmarshalJSON(data []byte) (err error)

type SubscriptionSchedulePlanChangeParams

type SubscriptionSchedulePlanChangeParams struct {
	ChangeOption param.Field[SubscriptionSchedulePlanChangeParamsChangeOption] `json:"change_option,required"`
	// [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be
	// aligned with the plan change’s effective date.
	AlignBillingWithPlanChangeDate param.Field[bool] `json:"align_billing_with_plan_change_date"`
	// Reset billing periods to be aligned with the plan change’s effective date or
	// start of the month. Defaults to `unchanged` which keeps subscription's existing
	// billing cycle alignment.
	BillingCycleAlignment param.Field[SubscriptionSchedulePlanChangeParamsBillingCycleAlignment] `json:"billing_cycle_alignment"`
	// The date that the plan change should take effect. This parameter can only be
	// passed if the `change_option` is `requested_date`.
	ChangeDate param.Field[string] `json:"change_date"`
	// Redemption code to be used for this subscription. If the coupon cannot be found
	// by its redemption code, or cannot be redeemed, an error response will be
	// returned and the plan change will not be scheduled.
	CouponRedemptionCode param.Field[string]  `json:"coupon_redemption_code"`
	CreditsOverageRate   param.Field[float64] `json:"credits_overage_rate"`
	// The external_plan_id of the plan that the given subscription should be switched
	// to. Note that either this property or `plan_id` must be specified.
	ExternalPlanID param.Field[string] `json:"external_plan_id"`
	// The phase of the plan to start with
	InitialPhaseOrder param.Field[int64] `json:"initial_phase_order"`
	// When this subscription's accrued usage reaches this threshold, an invoice will
	// be issued for the subscription. If not specified, invoices will only be issued
	// at the end of the billing period.
	InvoicingThreshold     param.Field[string] `json:"invoicing_threshold"`
	PerCreditOverageAmount param.Field[string] `json:"per_credit_overage_amount"`
	// The plan that the given subscription should be switched to. Note that either
	// this property or `external_plan_id` must be specified.
	PlanID param.Field[string] `json:"plan_id"`
	// Optionally provide a list of overrides for prices on the plan
	PriceOverrides param.Field[[]SubscriptionSchedulePlanChangeParamsPriceOverride] `json:"price_overrides"`
}

func (SubscriptionSchedulePlanChangeParams) MarshalJSON

func (r SubscriptionSchedulePlanChangeParams) MarshalJSON() (data []byte, err error)

type SubscriptionSchedulePlanChangeParamsBillingCycleAlignment

type SubscriptionSchedulePlanChangeParamsBillingCycleAlignment string

Reset billing periods to be aligned with the plan change’s effective date or start of the month. Defaults to `unchanged` which keeps subscription's existing billing cycle alignment.

const (
	SubscriptionSchedulePlanChangeParamsBillingCycleAlignmentUnchanged      SubscriptionSchedulePlanChangeParamsBillingCycleAlignment = "unchanged"
	SubscriptionSchedulePlanChangeParamsBillingCycleAlignmentPlanChangeDate SubscriptionSchedulePlanChangeParamsBillingCycleAlignment = "plan_change_date"
	SubscriptionSchedulePlanChangeParamsBillingCycleAlignmentStartOfMonth   SubscriptionSchedulePlanChangeParamsBillingCycleAlignment = "start_of_month"
)

func (SubscriptionSchedulePlanChangeParamsBillingCycleAlignment) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsChangeOption

type SubscriptionSchedulePlanChangeParamsChangeOption string
const (
	SubscriptionSchedulePlanChangeParamsChangeOptionRequestedDate         SubscriptionSchedulePlanChangeParamsChangeOption = "requested_date"
	SubscriptionSchedulePlanChangeParamsChangeOptionEndOfSubscriptionTerm SubscriptionSchedulePlanChangeParamsChangeOption = "end_of_subscription_term"
	SubscriptionSchedulePlanChangeParamsChangeOptionImmediate             SubscriptionSchedulePlanChangeParamsChangeOption = "immediate"
)

func (SubscriptionSchedulePlanChangeParamsChangeOption) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPrice

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPrice struct {
	ID        param.Field[string]                                                                      `json:"id,required"`
	BpsConfig param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceBpsConfig] `json:"bps_config,required"`
	ModelType param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceModelType] `json:"model_type,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPrice) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceBpsConfig

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceBpsConfig struct {
	// Basis point take rate per event
	Bps param.Field[float64] `json:"bps,required"`
	// Optional currency amount maximum to cap spend per event
	PerUnitMaximum param.Field[string] `json:"per_unit_maximum"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceBpsConfig) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceDiscount added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceDiscount struct {
	DiscountType param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceDiscountDiscountType added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceDiscountDiscountType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceDiscountDiscountTypePercentage SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceDiscountDiscountType = "percentage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceDiscountDiscountTypeTrial      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceDiscountDiscountType = "trial"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceDiscountDiscountTypeUsage      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceDiscountDiscountType = "usage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceDiscountDiscountTypeAmount     SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceDiscountDiscountType = "amount"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceModelType

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceModelType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceModelTypeBps SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceModelType = "bps"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBpsPriceModelType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPrice

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPrice struct {
	ID            param.Field[string]                                                                              `json:"id,required"`
	BulkBpsConfig param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceBulkBpsConfig] `json:"bulk_bps_config,required"`
	ModelType     param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceModelType]     `json:"model_type,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPrice) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceBulkBpsConfig

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceBulkBpsConfig struct {
	// Tiers for a bulk BPS pricing model where all usage is aggregated to a single
	// tier based on total volume
	Tiers param.Field[[]SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceBulkBpsConfigTier] `json:"tiers,required"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceBulkBpsConfig) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceBulkBpsConfigTier

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceBulkBpsConfigTier struct {
	// Basis points to rate on
	Bps param.Field[float64] `json:"bps,required"`
	// Upper bound for tier
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The maximum amount to charge for any one event
	PerUnitMaximum param.Field[string] `json:"per_unit_maximum"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceBulkBpsConfigTier) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceDiscount added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceDiscount struct {
	DiscountType param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountType added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountTypePercentage SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountType = "percentage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountTypeTrial      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountType = "trial"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountTypeUsage      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountType = "usage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountTypeAmount     SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountType = "amount"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceModelType

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceModelType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceModelTypeBulkBps SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceModelType = "bulk_bps"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkBpsPriceModelType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPrice

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPrice struct {
	ID         param.Field[string]                                                                        `json:"id,required"`
	BulkConfig param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceBulkConfig] `json:"bulk_config,required"`
	ModelType  param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceModelType]  `json:"model_type,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPrice) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceBulkConfig

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceBulkConfig struct {
	// Bulk tiers for rating based on total usage volume
	Tiers param.Field[[]SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceBulkConfigTier] `json:"tiers,required"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceBulkConfig) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceBulkConfigTier

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceBulkConfigTier struct {
	// Amount per unit
	UnitAmount param.Field[string] `json:"unit_amount,required"`
	// Upper bound for this tier
	MaximumUnits param.Field[float64] `json:"maximum_units"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceBulkConfigTier) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceDiscount added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceDiscount struct {
	DiscountType param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceDiscountDiscountType added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceDiscountDiscountType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceDiscountDiscountTypePercentage SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceDiscountDiscountType = "percentage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceDiscountDiscountTypeTrial      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceDiscountDiscountType = "trial"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceDiscountDiscountTypeUsage      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceDiscountDiscountType = "usage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceDiscountDiscountTypeAmount     SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceDiscountDiscountType = "amount"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceModelType

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceModelType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceModelTypeBulk SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceModelType = "bulk"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideBulkPriceModelType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPrice

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPrice struct {
	ID           param.Field[string]                                                                            `json:"id,required"`
	MatrixConfig param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceMatrixConfig] `json:"matrix_config,required"`
	ModelType    param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceModelType]    `json:"model_type,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPrice) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceDiscount added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceDiscount struct {
	DiscountType param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceDiscountDiscountType added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceDiscountDiscountType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceDiscountDiscountTypePercentage SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceDiscountDiscountType = "percentage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceDiscountDiscountTypeTrial      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceDiscountDiscountType = "trial"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceDiscountDiscountTypeUsage      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceDiscountDiscountType = "usage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceDiscountDiscountTypeAmount     SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceDiscountDiscountType = "amount"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceMatrixConfig

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceMatrixConfig struct {
	// Default per unit rate for any usage not bucketed into a specified matrix_value
	DefaultUnitAmount param.Field[string] `json:"default_unit_amount,required"`
	// One or two event property values to evaluate matrix groups by
	Dimensions param.Field[[]string] `json:"dimensions,required"`
	// Matrix values for specified matrix grouping keys
	MatrixValues param.Field[[]SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceMatrixConfigMatrixValue] `json:"matrix_values,required"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceMatrixConfig) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceMatrixConfigMatrixValue

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceMatrixConfigMatrixValue struct {
	// One or two matrix keys to filter usage to this Matrix value by. For example,
	// ["region", "tier"] could be used to filter cloud usage by a cloud region and an
	// instance tier.
	DimensionValues param.Field[[]string] `json:"dimension_values,required"`
	// Unit price for the specified dimension_values
	UnitAmount param.Field[string] `json:"unit_amount,required"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceMatrixConfigMatrixValue) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceModelType

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceModelType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceModelTypeMatrix SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceModelType = "matrix"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideMatrixPriceModelType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePrice

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePrice struct {
	ID            param.Field[string]                                                                              `json:"id,required"`
	ModelType     param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceModelType]     `json:"model_type,required"`
	PackageConfig param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePricePackageConfig] `json:"package_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePrice) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceDiscount added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceDiscount struct {
	DiscountType param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceDiscountDiscountType added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceDiscountDiscountType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceDiscountDiscountTypePercentage SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceDiscountDiscountType = "percentage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceDiscountDiscountTypeTrial      SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceDiscountDiscountType = "trial"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceDiscountDiscountTypeUsage      SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceDiscountDiscountType = "usage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceDiscountDiscountTypeAmount     SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceDiscountDiscountType = "amount"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceModelType

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceModelType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceModelTypePackage SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceModelType = "package"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePriceModelType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePricePackageConfig

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePricePackageConfig struct {
	// A currency amount to rate usage by
	PackageAmount param.Field[string] `json:"package_amount,required"`
	// An integer amount to represent package size. For example, 1000 here would divide
	// usage by 1000 before multiplying by package_amount in rating
	PackageSize param.Field[int64] `json:"package_size"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackagePricePackageConfig) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPrice

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPrice struct {
	ID                          param.Field[string]                                                                                        `json:"id,required"`
	ModelType                   param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceModelType] `json:"model_type,required"`
	PackageWithAllocationConfig param.Field[map[string]interface{}]                                                                        `json:"package_with_allocation_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPrice) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceDiscount added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceDiscount struct {
	DiscountType param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountType added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountTypePercentage SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountType = "percentage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountTypeTrial      SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountType = "trial"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountTypeUsage      SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountType = "usage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountTypeAmount     SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountType = "amount"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceModelType

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceModelType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceModelTypePackageWithAllocation SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceModelType = "package_with_allocation"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverridePackageWithAllocationPriceModelType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPrice

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPrice struct {
	ID                         param.Field[string]                                                                                       `json:"id,required"`
	ModelType                  param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceModelType] `json:"model_type,required"`
	ThresholdTotalAmountConfig param.Field[map[string]interface{}]                                                                       `json:"threshold_total_amount_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPrice) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscount added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscount struct {
	DiscountType param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountType added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountTypePercentage SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountType = "percentage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountTypeTrial      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountType = "trial"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountTypeUsage      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountType = "usage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountTypeAmount     SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountType = "amount"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceModelType

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceModelType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceModelTypeThresholdTotalAmount SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceModelType = "threshold_total_amount"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideThresholdTotalAmountPriceModelType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPrice

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPrice struct {
	ID              param.Field[string]                                                                                  `json:"id,required"`
	ModelType       param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceModelType]       `json:"model_type,required"`
	TieredBpsConfig param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceTieredBpsConfig] `json:"tiered_bps_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPrice) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceDiscount added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceDiscount struct {
	DiscountType param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountType added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountTypePercentage SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountType = "percentage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountTypeTrial      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountType = "trial"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountTypeUsage      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountType = "usage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountTypeAmount     SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountType = "amount"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceModelType

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceModelType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceModelTypeTieredBps SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceModelType = "tiered_bps"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceModelType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceTieredBpsConfig

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceTieredBpsConfig struct {
	// Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
	// tiers
	Tiers param.Field[[]SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceTieredBpsConfigTier] `json:"tiers,required"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceTieredBpsConfig) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceTieredBpsConfigTier

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceTieredBpsConfigTier struct {
	// Per-event basis point rate
	Bps param.Field[float64] `json:"bps,required"`
	// Inclusive tier starting value
	MinimumAmount param.Field[string] `json:"minimum_amount,required"`
	// Exclusive tier ending value
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// Per unit maximum to charge
	PerUnitMaximum param.Field[string] `json:"per_unit_maximum"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredBpsPriceTieredBpsConfigTier) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePrice

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePrice struct {
	ID                  param.Field[string]                                                                                `json:"id,required"`
	ModelType           param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceModelType] `json:"model_type,required"`
	TieredPackageConfig param.Field[map[string]interface{}]                                                                `json:"tiered_package_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePrice) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceDiscount added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceDiscount struct {
	DiscountType param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountType added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountTypePercentage SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountType = "percentage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountTypeTrial      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountType = "trial"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountTypeUsage      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountType = "usage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountTypeAmount     SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountType = "amount"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceModelType

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceModelType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceModelTypeTieredPackage SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceModelType = "tiered_package"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPackagePriceModelType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPrice

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPrice struct {
	ID           param.Field[string]                                                                            `json:"id,required"`
	ModelType    param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceModelType]    `json:"model_type,required"`
	TieredConfig param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceTieredConfig] `json:"tiered_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPrice) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceDiscount added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceDiscount struct {
	DiscountType param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceDiscountDiscountType added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceDiscountDiscountType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceDiscountDiscountTypePercentage SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceDiscountDiscountType = "percentage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceDiscountDiscountTypeTrial      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceDiscountDiscountType = "trial"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceDiscountDiscountTypeUsage      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceDiscountDiscountType = "usage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceDiscountDiscountTypeAmount     SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceDiscountDiscountType = "amount"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceModelType

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceModelType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceModelTypeTiered SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceModelType = "tiered"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceModelType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceTieredConfig

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceTieredConfig struct {
	// Tiers for rating based on total usage quantities into the specified tier
	Tiers param.Field[[]SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceTieredConfigTier] `json:"tiers,required"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceTieredConfig) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceTieredConfigTier

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceTieredConfigTier struct {
	// Inclusive tier starting value
	FirstUnit param.Field[float64] `json:"first_unit,required"`
	// Amount per unit
	UnitAmount param.Field[string] `json:"unit_amount,required"`
	// Exclusive tier ending value. If null, this is treated as the last tier
	LastUnit param.Field[float64] `json:"last_unit"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredPriceTieredConfigTier) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPrice

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPrice struct {
	ID                      param.Field[string]                                                                                    `json:"id,required"`
	ModelType               param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceModelType] `json:"model_type,required"`
	TieredWithMinimumConfig param.Field[map[string]interface{}]                                                                    `json:"tiered_with_minimum_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPrice) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceDiscount added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceDiscount struct {
	DiscountType param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountType added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountTypePercentage SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountType = "percentage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountTypeTrial      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountType = "trial"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountTypeUsage      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountType = "usage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountTypeAmount     SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountType = "amount"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceModelType

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceModelType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceModelTypeTieredWithMinimum SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceModelType = "tiered_with_minimum"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideTieredWithMinimumPriceModelType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPrice

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPrice struct {
	ID         param.Field[string]                                                                        `json:"id,required"`
	ModelType  param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceModelType]  `json:"model_type,required"`
	UnitConfig param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceUnitConfig] `json:"unit_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPrice) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceDiscount added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceDiscount struct {
	DiscountType param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceDiscount) MarshalJSON added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceDiscountDiscountType added in v0.2.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceDiscountDiscountType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceDiscountDiscountTypePercentage SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceDiscountDiscountType = "percentage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceDiscountDiscountTypeTrial      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceDiscountDiscountType = "trial"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceDiscountDiscountTypeUsage      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceDiscountDiscountType = "usage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceDiscountDiscountTypeAmount     SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceDiscountDiscountType = "amount"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceModelType

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceModelType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceModelTypeUnit SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceModelType = "unit"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceModelType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceUnitConfig

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceUnitConfig struct {
	// Rate per unit of usage
	UnitAmount param.Field[string] `json:"unit_amount,required"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitPriceUnitConfig) MarshalJSON

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPrice added in v0.20.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPrice struct {
	ID                    param.Field[string]                                                                                  `json:"id,required"`
	ModelType             param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceModelType] `json:"model_type,required"`
	UnitWithPercentConfig param.Field[map[string]interface{}]                                                                  `json:"unit_with_percent_config,required"`
	// The subscription's override discount for the plan.
	Discount param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceDiscount] `json:"discount"`
	// The starting quantity of the price, if the price is a fixed price.
	FixedPriceQuantity param.Field[float64] `json:"fixed_price_quantity"`
	// The subscription's override maximum amount for the plan.
	MaximumAmount param.Field[string] `json:"maximum_amount"`
	// The subscription's override minimum amount for the plan.
	MinimumAmount param.Field[string] `json:"minimum_amount"`
}

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPrice) MarshalJSON added in v0.20.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceDiscount added in v0.20.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceDiscount struct {
	DiscountType param.Field[SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountType] `json:"discount_type,required"`
	// Only available if discount_type is `amount`.
	AmountDiscount param.Field[string] `json:"amount_discount"`
	// List of price_ids that this discount applies to. For plan/plan phase discounts,
	// this can be a subset of prices.
	AppliesToPriceIDs param.Field[[]string] `json:"applies_to_price_ids"`
	// Only available if discount_type is `percentage`. This is a number between 0
	// and 1.
	PercentageDiscount param.Field[float64] `json:"percentage_discount"`
	// Only available if discount_type is `trial`
	TrialAmountDiscount param.Field[string] `json:"trial_amount_discount"`
	// Only available if discount_type is `usage`. Number of usage units that this
	// discount is for
	UsageDiscount param.Field[float64] `json:"usage_discount"`
}

The subscription's override discount for the plan.

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceDiscount) MarshalJSON added in v0.20.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountType added in v0.20.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountTypePercentage SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountType = "percentage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountTypeTrial      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountType = "trial"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountTypeUsage      SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountType = "usage"
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountTypeAmount     SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountType = "amount"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceDiscountDiscountType) IsKnown added in v0.24.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceModelType added in v0.20.0

type SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceModelType string
const (
	SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceModelTypeUnitWithPercent SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceModelType = "unit_with_percent"
)

func (SubscriptionSchedulePlanChangeParamsPriceOverridesOverrideUnitWithPercentPriceModelType) IsKnown added in v0.24.0

type SubscriptionService

type SubscriptionService struct {
	Options []option.RequestOption
}

SubscriptionService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSubscriptionService method instead.

func NewSubscriptionService

func NewSubscriptionService(opts ...option.RequestOption) (r *SubscriptionService)

NewSubscriptionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SubscriptionService) Cancel

func (r *SubscriptionService) Cancel(ctx context.Context, subscriptionID string, body SubscriptionCancelParams, opts ...option.RequestOption) (res *Subscription, err error)

This endpoint can be used to cancel an existing subscription. It returns the serialized subscription object with an `end_date` parameter that signifies when the subscription will transition to an ended state.

The body parameter `cancel_option` determines the cancellation behavior. Orb supports three cancellation options:

  • `end_of_subscription_term`: stops the subscription from auto-renewing. Subscriptions that have been cancelled with this option can still incur charges for the remainder of their term:

  • Issuing this cancellation request for a monthly subscription will keep the subscription active until the start of the subsequent month, and potentially issue an invoice for any usage charges incurred in the intervening period.

  • Issuing this cancellation request for a quarterly subscription will keep the subscription active until the end of the quarter and potentially issue an invoice for any usage charges incurred in the intervening period.

  • Issuing this cancellation request for a yearly subscription will keep the subscription active for the full year. For example, a yearly subscription starting on 2021-11-01 and cancelled on 2021-12-08 will remain active until 2022-11-01 and potentially issue charges in the intervening months for any recurring monthly usage charges in its plan.

  • **Note**: If a subscription's plan contains prices with difference cadences, the end of term date will be determined by the largest cadence value. For example, cancelling end of term for a subscription with a quarterly fixed fee with a monthly usage fee will result in the subscription ending at the end of the quarter.

  • `immediate`: ends the subscription immediately, setting the `end_date` to the current time:

  • Subscriptions that have been cancelled with this option will be invoiced immediately. This invoice will include any usage fees incurred in the billing period up to the cancellation, along with any prorated recurring fees for the billing period, if applicable.

  • **Note**: If the subscription has a recurring fee that was paid in-advance, the prorated amount for the remaining time period will be added to the [customer's balance](list-balance-transactions) upon immediate cancellation. However, if the customer is ineligible to use the customer balance, the subscription cannot be cancelled immediately.

  • `requested_date`: ends the subscription on a specified date, which requires a `cancellation_date` to be passed in. If no timezone is provided, the customer's timezone is used. For example, a subscription starting on January 1st with a monthly price can be set to be cancelled on the first of any month after January 1st (e.g. March 1st, April 1st, May 1st). A subscription with multiple prices with different cadences defines the "term" to be the highest cadence of the prices.

Upcoming subscriptions are only eligible for immediate cancellation, which will set the `end_date` equal to the `start_date` upon cancellation.

## Backdated cancellations

Orb allows you to cancel a subscription in the past as long as there are no paid invoices between the `requested_date` and the current time. If the cancellation is after the latest issued invoice, Orb will generate a balance refund for the current period. If the cancellation is before the most recently issued invoice, Orb will void the intervening invoice and generate a new one based on the new dates for the subscription. See the section on [cancellation behaviors](../guides/product-catalog/creating-subscriptions.md#cancellation-behaviors).

func (*SubscriptionService) Fetch

func (r *SubscriptionService) Fetch(ctx context.Context, subscriptionID string, opts ...option.RequestOption) (res *Subscription, err error)

This endpoint is used to fetch a Subscription(../guides/concepts#subscription) given an identifier.

func (*SubscriptionService) FetchCosts

This endpoint is used to fetch a day-by-day snapshot of a subscription's costs in Orb, calculated by applying pricing information to the underlying usage (see the [subscription usage endpoint](fetch-subscription-usage) to fetch usage per metric, in usage units rather than a currency).

The semantics of this endpoint exactly mirror those of [fetching a customer's costs](fetch-customer-costs). Use this endpoint to limit your analysis of costs to a specific subscription for the customer (e.g. to de-aggregate costs when a customer's subscription has started and stopped on the same day).

func (*SubscriptionService) FetchSchedule

This endpoint returns a [paginated](../reference/pagination) list of all plans associated with a subscription along with their start and end dates. This list contains the subscription's initial plan along with past and future plan changes.

func (*SubscriptionService) FetchScheduleAutoPaging

This endpoint returns a [paginated](../reference/pagination) list of all plans associated with a subscription along with their start and end dates. This list contains the subscription's initial plan along with past and future plan changes.

func (*SubscriptionService) FetchUsage

func (r *SubscriptionService) FetchUsage(ctx context.Context, subscriptionID string, query SubscriptionFetchUsageParams, opts ...option.RequestOption) (res *SubscriptionUsage, err error)

This endpoint is used to fetch a subscription's usage in Orb. Especially when combined with optional query parameters, this endpoint is a powerful way to build visualizations on top of Orb's event data and metrics.

With no query parameters specified, this endpoint returns usage for the subscription's _current billing period_ across each billable metric that participates in the subscription. Usage quantities returned are the result of evaluating the metric definition for the entirety of the customer's billing period.

### Default response shape

Orb returns a `data` array with an object corresponding to each billable metric. Nested within this object is a `usage` array which has a `quantity` value and a corresponding `timeframe_start` and `timeframe_end`. The `quantity` value represents the calculated usage value for the billable metric over the specified timeframe (inclusive of the `timeframe_start` timestamp and exclusive of the `timeframe_end` timestamp).

Orb will include _every_ window in the response starting from the beginning of the billing period, even when there were no events (and therefore no usage) in the window. This increases the size of the response but prevents the caller from filling in gaps and handling cumbersome time-based logic.

The query parameters in this endpoint serve to override this behavior and provide some key functionality, as listed below. Note that this functionality can also be used _in conjunction_ with each other, e.g. to display grouped usage on a custom timeframe.

## Custom timeframe

In order to view usage for a custom timeframe rather than the current billing period, specify a `timeframe_start` and `timeframe_end`. This will calculate quantities for usage incurred between timeframe_start (inclusive) and timeframe_end (exclusive), i.e. `[timeframe_start, timeframe_end)`.

Note:

  • These timestamps must be specified in ISO 8601 format and UTC timezone, e.g. `2022-02-01T05:00:00Z`.
  • Both parameters must be specified if either is specified.

## Grouping by custom attributes

In order to view a single metric grouped by a specific _attribute_ that each event is tagged with (e.g. `cluster`), you must additionally specify a `billable_metric_id` and a `group_by` key. The `group_by` key denotes the event property on which to group.

When returning grouped usage, only usage for `billable_metric_id` is returned, and a separate object in the `data` array is returned for each value of the `group_by` key present in your events. The `quantity` value is the result of evaluating the billable metric for events filtered to a single value of the `group_by` key.

Orb expects that events that match the billable metric will contain values in the `properties` dictionary that correspond to the `group_by` key specified. By default, Orb will not return a `null` group (i.e. events that match the metric but do not have the key set). Currently, it is only possible to view usage grouped by a single attribute at a time.

When viewing grouped usage, Orb uses pagination to limit the response size to 1000 groups by default. If there are more groups for a given subscription, pagination metadata in the response can be used to fetch all of the data.

The following example shows usage for an "API Requests" billable metric grouped by `region`. Note the extra `metric_group` dictionary in the response, which provides metadata about the group:

```json

{
    "data": [
        {
            "usage": [
                {
                    "quantity": 0.19291,
                    "timeframe_start": "2021-10-01T07:00:00Z",
                    "timeframe_end": "2021-10-02T07:00:00Z",
                },
                ...
            ],
            "metric_group": {
                "property_key": "region",
                "property_value": "asia/pacific"
            },
            "billable_metric": {
                "id": "Fe9pbpMk86xpwdGB",
                "name": "API Requests"
            },
            "view_mode": "periodic"
        },
        ...
    ]
}

```

## Windowed usage

The `granularity` parameter can be used to _window_ the usage `quantity` value into periods. When not specified, usage is returned for the entirety of the time range.

When `granularity = day` is specified with a timeframe longer than a day, Orb will return a `quantity` value for each full day between `timeframe_start` and `timeframe_end`. Note that the days are demarcated by the _customer's local midnight_.

For example, with `timeframe_start = 2022-02-01T05:00:00Z`, `timeframe_end = 2022-02-04T01:00:00Z` and `granularity=day`, the following windows will be returned for a customer in the `America/Los_Angeles` timezone since local midnight is `08:00` UTC:

- `[2022-02-01T05:00:00Z, 2022-02-01T08:00:00Z)` - `[2022-02-01T08:00:00, 2022-02-02T08:00:00Z)` - `[2022-02-02T08:00:00, 2022-02-03T08:00:00Z)` - `[2022-02-03T08:00:00, 2022-02-04T01:00:00Z)`

```json

{
    "data": [
        {
            "billable_metric": {
                "id": "Q8w89wjTtBdejXKsm",
                "name": "API Requests"
            },
            "usage": [
                {
                    "quantity": 0,
                    "timeframe_end": "2022-02-01T08:00:00+00:00",
                    "timeframe_start": "2022-02-01T05:00:00+00:00"
                },
                {

                    "quantity": 0,
                    "timeframe_end": "2022-02-02T08:00:00+00:00",
                    "timeframe_start": "2022-02-01T08:00:00+00:00"
                },
                {
                    "quantity": 0,
                    "timeframe_end": "2022-02-03T08:00:00+00:00",
                    "timeframe_start": "2022-02-02T08:00:00+00:00"
                },
                {
                    "quantity": 0,
                    "timeframe_end": "2022-02-04T01:00:00+00:00",
                    "timeframe_start": "2022-02-03T08:00:00+00:00"
                }
            ],
            "view_mode": "periodic"
        },
        ...
    ]
}

```

## Decomposable vs. non-decomposable metrics

Billable metrics fall into one of two categories: decomposable and non-decomposable. A decomposable billable metric, such as a sum or a count, can be displayed and aggregated across arbitrary timescales. On the other hand, a non-decomposable metric is not meaningful when only a slice of the billing window is considered.

As an example, if we have a billable metric that's defined to count unique users, displaying a graph of unique users for each day is not representative of the billable metric value over the month (days could have an overlapping set of 'unique' users). Instead, what's useful for any given day is the number of unique users in the billing period so far, which are the _cumulative_ unique users.

Accordingly, this endpoint returns treats these two types of metrics differently when `group_by` is specified:

  • Decomposable metrics can be grouped by any event property.
  • Non-decomposable metrics can only be grouped by the corresponding price's invoice grouping key. If no invoice grouping key is present, the metric does not support `group_by`.

## Matrix prices

When a billable metric is attached to a price that uses matrix pricing, it's important to view usage grouped by those matrix dimensions. In this case, use the query parameters `first_dimension_key`, `first_dimension_value` and `second_dimension_key`, `second_dimension_value` while filtering to a specific `billable_metric_id`.

For example, if your compute metric has a separate unit price (i.e. a matrix pricing model) per `region` and `provider`, your request might provide the following parameters:

- `first_dimension_key`: `region` - `first_dimension_value`: `us-east-1` - `second_dimension_key`: `provider` - `second_dimension_value`: `aws`

func (*SubscriptionService) List

This endpoint returns a list of all subscriptions for an account as a [paginated](../reference/pagination) list, ordered starting from the most recently created subscription. For a full discussion of the subscription resource, see Subscription(../guides/concepts#subscription).

Subscriptions can be filtered to a single customer by passing in the `customer_id` query parameter or the `external_customer_id` query parameter.

func (*SubscriptionService) ListAutoPaging

This endpoint returns a list of all subscriptions for an account as a [paginated](../reference/pagination) list, ordered starting from the most recently created subscription. For a full discussion of the subscription resource, see Subscription(../guides/concepts#subscription).

Subscriptions can be filtered to a single customer by passing in the `customer_id` query parameter or the `external_customer_id` query parameter.

func (*SubscriptionService) New

A subscription represents the purchase of a plan by a customer. The customer is identified by either the `customer_id` or the `external_customer_id`, and exactly one of these fields must be provided.

By default, subscriptions begin on the day that they're created and renew automatically for each billing cycle at the cadence that's configured in the plan definition.

The default configuration for subscriptions in Orb is **In-advance billing** and **Beginning of month alignment** (see Subscription(../guides/concepts#subscription) for more details).

In order to change the alignment behavior, Orb also supports billing subscriptions on the day of the month they are created. If `align_billing_with_subscription_start_date = true` is specified, subscriptions have billing cycles that are aligned with their `start_date`. For example, a subscription that begins on January 15th will have a billing cycle from January 15th to February 15th. Every subsequent billing cycle will continue to start and invoice on the 15th.

If the "day" value is greater than the number of days in the month, the next billing cycle will start at the end of the month. For example, if the start_date is January 31st, the next billing cycle will start on February 28th.

If a customer was created with a currency, Orb only allows subscribing the customer to a plan with a matching `invoicing_currency`. If the customer does not have a currency set, on subscription creation, we set the customer's currency to be the `invoicing_currency` of the plan.

## Price overrides

Price overrides are used to update some or all prices in a plan for the specific subscription being created. This is useful when a new customer has negotiated one or more different prices for a specific plan than the plan's default prices. Any type of price can be overridden, if the correct data is provided. The billable metric, cadence, type, and name of a price can not be overridden.

To override prices, provide a list of objects with the key `price_overrides`. The price object in the list of overrides is expected to contain the existing price id, the `model_type` and config value in the format below. The specific numerical values can be updated, but the config value and `model_type` must match the existing price that is being overridden

### Request format for price overrides

Orb supports a few different pricing models out of the box. The `model_type` field determines the key for the configuration object that is present.

### Unit pricing

With unit pricing, each unit costs a fixed amount.

```json

{
  ...
  "id": "price_id",
  "model_type": "unit",
  "unit_config": {
    "unit_amount": "0.50"
  }
  ...
}

```

### Tiered pricing

In tiered pricing, the cost of a given unit depends on the tier range that it falls into, where each tier range is defined by an upper and lower bound. For example, the first ten units may cost $0.50 each and all units thereafter may cost $0.10 each. Tiered prices can be overridden with a new number of tiers or new values for `first_unit`, `last_unit`, or `unit_amount`.

```json

{
  ...
  "id": "price_id",
  "model_type": "tiered",
  "tiered_config": {
    "tiers": [
      {
        "first_unit":"1",
        "last_unit": "10",
        "unit_amount": "0.50"
      },
      {
        "first_unit": "10",
        "last_unit": null,
        "unit_amount": "0.10"
      }
    ]
  }
  ...
}

```

### Bulk pricing

Bulk pricing applies when the number of units determine the cost of _all_ units. For example, if you've bought less than 10 units, they may each be $0.50 for a total of $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e. 101 units total would be $40.40). Bulk prices can be overridden with a new number of tiers or new values for `maximum_units`, or `unit_amount`.

```json

{
  ...
  "id": "price_id",
  "model_type": "bulk",
  "bulk_config": {
    "tiers": [
      {
        "maximum_units": "10",
        "unit_amount": "0.50"
      },
      {
        "maximum_units": "1000",
        "unit_amount": "0.40"
      }
    ]
  }
  ...
}

```

### Package pricing

Package pricing defines the size or granularity of a unit for billing purposes. For example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units will be billed at 10.

```json

{
  ...
  "id": "price_id",
  "model_type": "package",
  "package_config": {
    "package_amount": "0.80",
    "package_size": 10
  }
  ...
}

```

### BPS pricing

BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent (the number of basis points to charge), as well as a cap per event to assess. For example, this would allow you to assess a fee of 0.25% on every payment you process, with a maximum charge of $25 per payment.

```json

{
  ...
  "id": "price_id"
  "model_type": "bps",
  "bps_config": {
    "bps": 125,
    "per_event_cap": "11.00"
  }
  ...
}

```

### Bulk BPS pricing

Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total quantity across all events. Similar to bulk pricing, the BPS parameters of a given event depends on the tier range that the billing period falls into. Each tier range is defined by an upper and lower bound. For example, after $1.5M of payment volume is reached, each individual payment may have a lower cap or a smaller take-rate.

```json

{
  ...
  "id": "price_id"
  "model_type": "bulk_bps",
  "bulk_bps_config": {
    "tiers": [
      {
        "minimum_amount": "0.00",
        "maximum_amount": "1000000.00",
        "bps": 125,
        "per_event_cap": "19.00"
      },
      {
        "minimum_amount":"1000000.00",
        "maximum_amount": null,
        "bps": 115,
        "per_event_cap": "4.00"
      }
    ]
  }

... } ```

### Tiered BPS pricing

Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's applicable parameter is a function of its marginal addition to the period total. Similar to tiered pricing, the BPS parameters of a given event depends on the tier range that it falls into, where each tier range is defined by an upper and lower bound. For example, the first few payments may have a 0.8 BPS take-rate and all payments after a specific volume may incur a take-rate of 0.5 BPS each.

```json

{
  ...
  "id": "price_id"
  "model_type": "tiered_bps",
  "tiered_bps_config": {
    "tiers": [
      {
        "minimum_amount": "0.00",
        "maximum_amount": "1000000.00",
        "bps": 125,
        "per_event_cap": "19.00"
      },
      {
        "minimum_amount":"1000000",
        "maximum_amount": null,
        "bps": 115,
        "per_event_cap": "4.00"
      }
    ]
  }
  ...
}

```

### Matrix pricing

Matrix pricing defines a set of unit prices in a one or two-dimensional matrix. `dimensions` defines the two event property values evaluated in this pricing model. In a one-dimensional matrix, the second value is `null`. Every configuration has a list of `matrix_values` which give the unit prices for specified property values. In a one-dimensional matrix, the matrix values will have `dimension_values` where the second value of the pair is null. If an event does not match any of the dimension values in the matrix, it will resort to the `default_unit_amount`.

```json

{
  ...
  "model_type": "matrix",
  "matrix_config": {
    "default_unit_amount": "3.00",
    "dimensions": [
      "cluster_name",
      "region"
    ],
    "matrix_values": [
      {
        "dimension_values": [
          "alpha",
          "west"
        ],
        "unit_amount": "2.00"
      },
      ...
    ]
  }
}

```

### Fixed fees

Fixed fees follow unit pricing, and also have an additional parameter `fixed_price_quantity` that indicates how many of a fixed fee that should be applied for a subscription. This parameter defaults to 1.

```json

{
  ...
  "id": "price_id",
  "model_type": "unit",
  "unit_config": {
    "unit_amount": "2.00"
  },
  "fixed_price_quantity": 3.0
  ...
}

```

## Maximums and Minimums

Minimums and maximums, much like price overrides, can be useful when a new customer has negotiated a new or different minimum or maximum spend cap than the default for a given price. If one exists for a price and null is provided for the minimum/maximum override on creation, then there will be no minimum/maximum on the new subscription. If no value is provided, then the default price maximum or minimum is used.

To add a minimum for a specific price, add `minimum_amount` to the specific price in the `price_overrides` object.

To add a maximum for a specific price, add `maximum_amount` to the specific price in the `price_overrides` object.

### Minimum override example

Price minimum override example:

```json

{
  ...
  "id": "price_id",
  "model_type": "unit",
  "unit_config": {
    "unit_amount": "0.50"
  },
  "minimum_amount": "100.00"
  ...
}

```

Removing an existing minimum example

```json

{
  ...
  "id": "price_id",
  "model_type": "unit",
  "unit_config": {
    "unit_amount": "0.50"
  },
  "minimum_amount": null
  ...
}

```

## Discounts

Discounts, like price overrides, can be useful when a new customer has negotiated a new or different discount than the default for a price. A single price price can have at most one discount. If a discount exists for a price and a null discount is provided on creation, then there will be no discount on the new subscription.

To add a discount for a specific price, add `discount` to the price in the `price_overrides` object. Discount should be a dictionary of the format:

```ts

{
  "discount_type": "amount" | "percentage" | "usage",
  "amount_discount": string,
  "percentage_discount": string,
  "usage_discount": string
}

```

where either `amount_discount`, `percentage_discount`, or `usage_discount` is provided.

Price discount example

```json

{
  ...
  "id": "price_id",
  "model_type": "unit",
  "unit_config": {
    "unit_amount": "0.50"
  },
  "discount": {"discount_type": "amount", "amount_discount": "175"},
}

```

Removing an existing discount example

```json

{
  "customer_id": "customer_id",
  "plan_id": "plan_id",
  "discount": null,
  "price_overrides": [ ... ]
  ...
}

```

## Threshold Billing

Orb supports invoicing for a subscription when a preconfigured usage threshold is hit. To enable threshold billing, pass in an `invoicing_threshold`, which is specified in the subscription's invoicing currency, when creating a subscription. E.g. pass in `10.00` to issue an invoice when usage amounts hit $10.00 for a subscription that invoices in USD.

func (*SubscriptionService) PriceIntervals

func (r *SubscriptionService) PriceIntervals(ctx context.Context, subscriptionID string, body SubscriptionPriceIntervalsParams, opts ...option.RequestOption) (res *Subscription, err error)

This endpoint is used to add and edit subscription [price intervals](../reference/price-interval). By making modifications to a subscription’s price intervals, you can [flexibly and atomically control the billing behavior of a subscription](../guides/product-catalog/modifying-subscriptions).

## Adding price intervals

Prices can be added as price intervals to a subscription by specifying them in the `add` array. A `price_id` or `external_price_id` from an add-on price or previously removed plan price can be specified to reuse an existing price definition (however, please note that prices from other plans cannot be added to the subscription). Additionally, a new price can be specified using the `price` field — this price will be created automatically.

A `start_date` must be specified for the price interval. This is the date when the price will start billing on the subscription, so this will notably result in an immediate charge at this time for any billed in advance fixed fees. The `end_date` will default to null, resulting in a price interval that will bill on a continually recurring basis. Both of these dates can be set in the past or the future and Orb will generate or modify invoices to ensure the subscription’s invoicing behavior is correct.

Additionally, a discount, minimum, or maximum can be specified on the price interval. This will only apply to this price interval, not any other price intervals on the subscription.

## Editing price intervals

Price intervals can be adjusted by specifying edits to make in the `edit` array. A `price_interval_id` to edit must be specified — this can be retrieved from the `price_intervals` field on the subscription.

A new `start_date` or `end_date` can be specified to change the range of the price interval, which will modify past or future invoices to ensure correctness. If either of these dates are unspecified, they will default to the existing date on the price interval. To remove a price interval entirely from a subscription, set the `end_date` to be equivalent to the `start_date`.

## Fixed fee quantity transitions

The fixed fee quantity transitions for a fixed fee price interval can also be specified when adding or editing by passing an array for `fixed_fee_quantity_transitions`. A fixed fee quantity transition must have a `quantity` and an `effective_date`, which is the date after which the new quantity will be used for billing. If a fixed fee quantity transition is scheduled at a billing period boundary, the full quantity will be billed on an invoice with the other prices on the subscription. If the fixed fee quantity transition is scheduled mid-billing period, the difference between the existing quantity and quantity specified in the transition will be prorated for the rest of the billing period and billed immediately, which will generate a new invoice.

Notably, the list of fixed fee quantity transitions passed will overwrite the existing fixed fee quantity transitions on the price interval, so the entire list of transitions must be specified to add additional transitions. The existing list of transitions can be retrieved using the `fixed_fee_quantity_transitions` property on a subscription’s serialized price intervals.

func (*SubscriptionService) SchedulePlanChange

func (r *SubscriptionService) SchedulePlanChange(ctx context.Context, subscriptionID string, body SubscriptionSchedulePlanChangeParams, opts ...option.RequestOption) (res *Subscription, err error)

This endpoint can be used to change the plan on an existing subscription. It returns the serialized updated subscription object.

The body parameter `change_option` determines the timing of the plan change. Orb supports three options:

  • `end_of_subscription_term`: changes the plan at the end of the existing plan's term.
  • Issuing this plan change request for a monthly subscription will keep the existing plan active until the start of the subsequent month, and potentially issue an invoice for any usage charges incurred in the intervening period.
  • Issuing this plan change request for a yearly subscription will keep the existing plan active for the full year.
  • `immediate`: changes the plan immediately. Subscriptions that have their plan changed with this option will be invoiced immediately. This invoice will include any usage fees incurred in the billing period up to the change, along with any prorated recurring fees for the billing period, if applicable.
  • `requested_date`: changes the plan on the requested date (`change_date`). If no timezone is provided, the customer's timezone is used. The `change_date` body parameter is required if this option is chosen.

Note that one of `plan_id` or `external_plan_id` is required in the request body for this operation.

## Price overrides, maximums, and minimums

Price overrides are used to update some or all prices in the target plan. Minimums and maximums, much like price overrides, can be useful when a new customer has negotiated a new or different minimum or maximum spend cap than the default for the plan. The request format for price overrides, maximums, and minimums are the same as those in [subscription creation](create-subscription).

## Prorations for in-advance fees

By default, Orb calculates the prorated difference in any fixed fees when making a plan change, adjusting the customer balance as needed. For details on this behavior, see [Modifying subscriptions](../guides/product-catalog/modifying-subscriptions.md#prorations-for-in-advance-fees).

func (*SubscriptionService) TriggerPhase

func (r *SubscriptionService) TriggerPhase(ctx context.Context, subscriptionID string, body SubscriptionTriggerPhaseParams, opts ...option.RequestOption) (res *Subscription, err error)

Manually trigger a phase, effective the given date (or the current time, if not specified).

func (*SubscriptionService) UnscheduleCancellation

func (r *SubscriptionService) UnscheduleCancellation(ctx context.Context, subscriptionID string, opts ...option.RequestOption) (res *Subscription, err error)

This endpoint can be used to unschedule any pending cancellations for a subscription.

To be eligible, the subscription must currently be active and have a future cancellation. This operation will turn on auto-renew, ensuring that the subscription does not end at the currently scheduled cancellation time.

func (*SubscriptionService) UnscheduleFixedFeeQuantityUpdates

func (r *SubscriptionService) UnscheduleFixedFeeQuantityUpdates(ctx context.Context, subscriptionID string, body SubscriptionUnscheduleFixedFeeQuantityUpdatesParams, opts ...option.RequestOption) (res *Subscription, err error)

This endpoint can be used to clear scheduled updates to the quantity for a fixed fee.

If there are no updates scheduled, this endpoint is a no-op.

func (*SubscriptionService) UnschedulePendingPlanChanges

func (r *SubscriptionService) UnschedulePendingPlanChanges(ctx context.Context, subscriptionID string, opts ...option.RequestOption) (res *Subscription, err error)

This endpoint can be used to unschedule any pending plan changes on an existing subscription.

func (*SubscriptionService) UpdateFixedFeeQuantity

func (r *SubscriptionService) UpdateFixedFeeQuantity(ctx context.Context, subscriptionID string, body SubscriptionUpdateFixedFeeQuantityParams, opts ...option.RequestOption) (res *Subscription, err error)

This endpoint can be used to update the quantity for a fixed fee.

To be eligible, the subscription must currently be active and the price specified must be a fixed fee (not usage-based). This operation will immediately update the quantity for the fee, or if a `effective_date` is passed in, will update the quantity on the requested date at midnight in the customer's timezone.

In order to change the fixed fee quantity as of the next draft invoice for this subscription, pass `change_option=upcoming_invoice` without an `effective_date` specified.

If the fee is an in-advance fixed fee, it will also issue an immediate invoice for the difference for the remainder of the billing period.

type SubscriptionStatus

type SubscriptionStatus string
const (
	SubscriptionStatusActive   SubscriptionStatus = "active"
	SubscriptionStatusEnded    SubscriptionStatus = "ended"
	SubscriptionStatusUpcoming SubscriptionStatus = "upcoming"
)

func (SubscriptionStatus) IsKnown added in v0.24.0

func (r SubscriptionStatus) IsKnown() bool

type SubscriptionTrialInfo

type SubscriptionTrialInfo struct {
	EndDate time.Time                 `json:"end_date,required,nullable" format:"date-time"`
	JSON    subscriptionTrialInfoJSON `json:"-"`
}

func (*SubscriptionTrialInfo) UnmarshalJSON

func (r *SubscriptionTrialInfo) UnmarshalJSON(data []byte) (err error)

type SubscriptionTriggerPhaseParams

type SubscriptionTriggerPhaseParams struct {
	// The date on which the phase change should take effect. If not provided, defaults
	// to today in the customer's timezone.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date"`
}

func (SubscriptionTriggerPhaseParams) MarshalJSON

func (r SubscriptionTriggerPhaseParams) MarshalJSON() (data []byte, err error)

type SubscriptionUnscheduleFixedFeeQuantityUpdatesParams

type SubscriptionUnscheduleFixedFeeQuantityUpdatesParams struct {
	// Price for which the updates should be cleared. Must be a fixed fee.
	PriceID param.Field[string] `json:"price_id,required"`
}

func (SubscriptionUnscheduleFixedFeeQuantityUpdatesParams) MarshalJSON

func (r SubscriptionUnscheduleFixedFeeQuantityUpdatesParams) MarshalJSON() (data []byte, err error)

type SubscriptionUpdateFixedFeeQuantityParams

type SubscriptionUpdateFixedFeeQuantityParams struct {
	// Price for which the quantity should be updated. Must be a fixed fee.
	PriceID  param.Field[string]  `json:"price_id,required"`
	Quantity param.Field[float64] `json:"quantity,required"`
	// Determines when the change takes effect. Note that if `effective_date` is
	// specified, this defaults to `effective_date`. Otherwise, this defaults to
	// `immediate` unless it's explicitly set to `upcoming_invoice.
	ChangeOption param.Field[SubscriptionUpdateFixedFeeQuantityParamsChangeOption] `json:"change_option"`
	// The date that the quantity change should take effect, localized to the
	// customer's timezone. Ifthis parameter is not passed in, the quantity change is
	// effective according to `change_option`.
	EffectiveDate param.Field[time.Time] `json:"effective_date" format:"date"`
}

func (SubscriptionUpdateFixedFeeQuantityParams) MarshalJSON

func (r SubscriptionUpdateFixedFeeQuantityParams) MarshalJSON() (data []byte, err error)

type SubscriptionUpdateFixedFeeQuantityParamsChangeOption

type SubscriptionUpdateFixedFeeQuantityParamsChangeOption string

Determines when the change takes effect. Note that if `effective_date` is specified, this defaults to `effective_date`. Otherwise, this defaults to `immediate` unless it's explicitly set to `upcoming_invoice.

const (
	SubscriptionUpdateFixedFeeQuantityParamsChangeOptionImmediate       SubscriptionUpdateFixedFeeQuantityParamsChangeOption = "immediate"
	SubscriptionUpdateFixedFeeQuantityParamsChangeOptionUpcomingInvoice SubscriptionUpdateFixedFeeQuantityParamsChangeOption = "upcoming_invoice"
	SubscriptionUpdateFixedFeeQuantityParamsChangeOptionEffectiveDate   SubscriptionUpdateFixedFeeQuantityParamsChangeOption = "effective_date"
)

func (SubscriptionUpdateFixedFeeQuantityParamsChangeOption) IsKnown added in v0.24.0

type SubscriptionUsage

type SubscriptionUsage interface {
	// contains filtered or unexported methods
}

Union satisfied by SubscriptionUsageUngroupedSubscriptionUsage or SubscriptionUsageGroupedSubscriptionUsage.

type SubscriptionUsageGroupedSubscriptionUsage

type SubscriptionUsageGroupedSubscriptionUsage struct {
	Data               []SubscriptionUsageGroupedSubscriptionUsageData             `json:"data,required"`
	PaginationMetadata SubscriptionUsageGroupedSubscriptionUsagePaginationMetadata `json:"pagination_metadata,nullable"`
	JSON               subscriptionUsageGroupedSubscriptionUsageJSON               `json:"-"`
}

func (*SubscriptionUsageGroupedSubscriptionUsage) UnmarshalJSON

func (r *SubscriptionUsageGroupedSubscriptionUsage) UnmarshalJSON(data []byte) (err error)

type SubscriptionUsageGroupedSubscriptionUsageData

type SubscriptionUsageGroupedSubscriptionUsageData struct {
	BillableMetric SubscriptionUsageGroupedSubscriptionUsageDataBillableMetric `json:"billable_metric,required"`
	MetricGroup    SubscriptionUsageGroupedSubscriptionUsageDataMetricGroup    `json:"metric_group,required"`
	Usage          []SubscriptionUsageGroupedSubscriptionUsageDataUsage        `json:"usage,required"`
	ViewMode       SubscriptionUsageGroupedSubscriptionUsageDataViewMode       `json:"view_mode,required"`
	JSON           subscriptionUsageGroupedSubscriptionUsageDataJSON           `json:"-"`
}

func (*SubscriptionUsageGroupedSubscriptionUsageData) UnmarshalJSON

func (r *SubscriptionUsageGroupedSubscriptionUsageData) UnmarshalJSON(data []byte) (err error)

type SubscriptionUsageGroupedSubscriptionUsageDataBillableMetric

type SubscriptionUsageGroupedSubscriptionUsageDataBillableMetric struct {
	ID   string                                                          `json:"id,required"`
	Name string                                                          `json:"name,required"`
	JSON subscriptionUsageGroupedSubscriptionUsageDataBillableMetricJSON `json:"-"`
}

func (*SubscriptionUsageGroupedSubscriptionUsageDataBillableMetric) UnmarshalJSON

type SubscriptionUsageGroupedSubscriptionUsageDataMetricGroup

type SubscriptionUsageGroupedSubscriptionUsageDataMetricGroup struct {
	PropertyKey   string                                                       `json:"property_key,required"`
	PropertyValue string                                                       `json:"property_value,required"`
	JSON          subscriptionUsageGroupedSubscriptionUsageDataMetricGroupJSON `json:"-"`
}

func (*SubscriptionUsageGroupedSubscriptionUsageDataMetricGroup) UnmarshalJSON

type SubscriptionUsageGroupedSubscriptionUsageDataUsage

type SubscriptionUsageGroupedSubscriptionUsageDataUsage struct {
	Quantity       float64                                                `json:"quantity,required"`
	TimeframeEnd   time.Time                                              `json:"timeframe_end,required" format:"date-time"`
	TimeframeStart time.Time                                              `json:"timeframe_start,required" format:"date-time"`
	JSON           subscriptionUsageGroupedSubscriptionUsageDataUsageJSON `json:"-"`
}

func (*SubscriptionUsageGroupedSubscriptionUsageDataUsage) UnmarshalJSON

func (r *SubscriptionUsageGroupedSubscriptionUsageDataUsage) UnmarshalJSON(data []byte) (err error)

type SubscriptionUsageGroupedSubscriptionUsageDataViewMode

type SubscriptionUsageGroupedSubscriptionUsageDataViewMode string
const (
	SubscriptionUsageGroupedSubscriptionUsageDataViewModePeriodic   SubscriptionUsageGroupedSubscriptionUsageDataViewMode = "periodic"
	SubscriptionUsageGroupedSubscriptionUsageDataViewModeCumulative SubscriptionUsageGroupedSubscriptionUsageDataViewMode = "cumulative"
)

func (SubscriptionUsageGroupedSubscriptionUsageDataViewMode) IsKnown added in v0.24.0

type SubscriptionUsageGroupedSubscriptionUsagePaginationMetadata

type SubscriptionUsageGroupedSubscriptionUsagePaginationMetadata struct {
	HasMore    bool                                                            `json:"has_more,required"`
	NextCursor string                                                          `json:"next_cursor,required,nullable"`
	JSON       subscriptionUsageGroupedSubscriptionUsagePaginationMetadataJSON `json:"-"`
}

func (*SubscriptionUsageGroupedSubscriptionUsagePaginationMetadata) UnmarshalJSON

type SubscriptionUsageUngroupedSubscriptionUsage

type SubscriptionUsageUngroupedSubscriptionUsage struct {
	Data []SubscriptionUsageUngroupedSubscriptionUsageData `json:"data,required"`
	JSON subscriptionUsageUngroupedSubscriptionUsageJSON   `json:"-"`
}

func (*SubscriptionUsageUngroupedSubscriptionUsage) UnmarshalJSON

func (r *SubscriptionUsageUngroupedSubscriptionUsage) UnmarshalJSON(data []byte) (err error)

type SubscriptionUsageUngroupedSubscriptionUsageData

type SubscriptionUsageUngroupedSubscriptionUsageData struct {
	BillableMetric SubscriptionUsageUngroupedSubscriptionUsageDataBillableMetric `json:"billable_metric,required"`
	Usage          []SubscriptionUsageUngroupedSubscriptionUsageDataUsage        `json:"usage,required"`
	ViewMode       SubscriptionUsageUngroupedSubscriptionUsageDataViewMode       `json:"view_mode,required"`
	JSON           subscriptionUsageUngroupedSubscriptionUsageDataJSON           `json:"-"`
}

func (*SubscriptionUsageUngroupedSubscriptionUsageData) UnmarshalJSON

func (r *SubscriptionUsageUngroupedSubscriptionUsageData) UnmarshalJSON(data []byte) (err error)

type SubscriptionUsageUngroupedSubscriptionUsageDataBillableMetric

type SubscriptionUsageUngroupedSubscriptionUsageDataBillableMetric struct {
	ID   string                                                            `json:"id,required"`
	Name string                                                            `json:"name,required"`
	JSON subscriptionUsageUngroupedSubscriptionUsageDataBillableMetricJSON `json:"-"`
}

func (*SubscriptionUsageUngroupedSubscriptionUsageDataBillableMetric) UnmarshalJSON

type SubscriptionUsageUngroupedSubscriptionUsageDataUsage

type SubscriptionUsageUngroupedSubscriptionUsageDataUsage struct {
	Quantity       float64                                                  `json:"quantity,required"`
	TimeframeEnd   time.Time                                                `json:"timeframe_end,required" format:"date-time"`
	TimeframeStart time.Time                                                `json:"timeframe_start,required" format:"date-time"`
	JSON           subscriptionUsageUngroupedSubscriptionUsageDataUsageJSON `json:"-"`
}

func (*SubscriptionUsageUngroupedSubscriptionUsageDataUsage) UnmarshalJSON

func (r *SubscriptionUsageUngroupedSubscriptionUsageDataUsage) UnmarshalJSON(data []byte) (err error)

type SubscriptionUsageUngroupedSubscriptionUsageDataViewMode

type SubscriptionUsageUngroupedSubscriptionUsageDataViewMode string
const (
	SubscriptionUsageUngroupedSubscriptionUsageDataViewModePeriodic   SubscriptionUsageUngroupedSubscriptionUsageDataViewMode = "periodic"
	SubscriptionUsageUngroupedSubscriptionUsageDataViewModeCumulative SubscriptionUsageUngroupedSubscriptionUsageDataViewMode = "cumulative"
)

func (SubscriptionUsageUngroupedSubscriptionUsageDataViewMode) IsKnown added in v0.24.0

type Subscriptions

type Subscriptions struct {
	Data               []Subscription                  `json:"data,required"`
	PaginationMetadata SubscriptionsPaginationMetadata `json:"pagination_metadata,required"`
	JSON               subscriptionsJSON               `json:"-"`
}

func (*Subscriptions) UnmarshalJSON

func (r *Subscriptions) UnmarshalJSON(data []byte) (err error)

type SubscriptionsPaginationMetadata

type SubscriptionsPaginationMetadata struct {
	HasMore    bool                                `json:"has_more,required"`
	NextCursor string                              `json:"next_cursor,required,nullable"`
	JSON       subscriptionsPaginationMetadataJSON `json:"-"`
}

func (*SubscriptionsPaginationMetadata) UnmarshalJSON

func (r *SubscriptionsPaginationMetadata) UnmarshalJSON(data []byte) (err error)

type TopLevelPingResponse

type TopLevelPingResponse struct {
	Response string                   `json:"response,required"`
	JSON     topLevelPingResponseJSON `json:"-"`
}

func (*TopLevelPingResponse) UnmarshalJSON

func (r *TopLevelPingResponse) UnmarshalJSON(data []byte) (err error)

type TopLevelService

type TopLevelService struct {
	Options []option.RequestOption
}

TopLevelService contains methods and other services that help with interacting with the orb API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTopLevelService method instead.

func NewTopLevelService

func NewTopLevelService(opts ...option.RequestOption) (r *TopLevelService)

NewTopLevelService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*TopLevelService) Ping

func (r *TopLevelService) Ping(ctx context.Context, opts ...option.RequestOption) (res *TopLevelPingResponse, err error)

This endpoint allows you to test your connection to the Orb API and check the validity of your API key, passed in the Authorization header. This is particularly useful for checking that your environment is set up properly, and is a great choice for connectors and integrations.

This API does not have any side-effects or return any Orb resources.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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