forked from recurly/recurly-client-go
/
subscription_add_on_create.go
52 lines (41 loc) · 3.3 KB
/
subscription_add_on_create.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// This file is automatically created by Recurly's OpenAPI generation process
// and thus any edits you make by hand will be lost. If you wish to make a
// change to this file, please create a Github issue explaining the changes you
// need and we will usher them to the appropriate places.
package recurly
import ()
type SubscriptionAddOnCreate struct {
// If `add_on_source` is set to `plan_add_on` or left blank, then plan's add-on `code` should be used.
// If `add_on_source` is set to `item`, then the `code` from the associated item should be used.
Code *string `json:"code,omitempty"`
// Used to determine where the associated add-on data is pulled from. If this value is set to
// `plan_add_on` or left blank, then add-on data will be pulled from the plan's add-ons. If the associated
// `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then
// the associated add-on data will be pulled from the site's item catalog.
AddOnSource *string `json:"add_on_source,omitempty"`
// Quantity
Quantity *int `json:"quantity,omitempty"`
// Allows up to 2 decimal places. Optionally, override the add-on's default unit amount.
// If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` cannot be provided.
UnitAmount *float64 `json:"unit_amount,omitempty"`
// Allows up to 9 decimal places. Optionally, override the add-on's default unit amount.
// If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount_decimal` cannot be provided.
// Only supported when the plan add-on's `add_on_type` = `usage`.
// If `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
UnitAmountDecimal *string `json:"unit_amount_decimal,omitempty"`
// If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object
// must include one to many tiers with `ending_quantity` and `unit_amount`.
// There must be one tier without an `ending_quantity` value which represents the final tier.
// See our [Guide](https://recurly.com/developers/guides/item-addon-guide.html)
// for an overview of how to configure quantity-based pricing models.
Tiers []SubscriptionAddOnTierCreate `json:"tiers,omitempty"`
// If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be
// removed and replaced by the percentage tiers in the request. There must be one tier without ending_amount value
// which represents the final tier. Use only if add_on.tier_type is tiered or volume and add_on.usage_type is
// percentage. This feature is currently in development and requires approval and enablement, please contact support.
PercentageTiers []SubscriptionAddOnPercentageTierCreate `json:"percentage_tiers,omitempty"`
// The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage and `usage_type` is percentage. Must be omitted otherwise. `usage_percentage` does not support tiers. See our [Guide](https://recurly.com/developers/guides/usage-based-billing-guide.html) for an overview of how to configure usage add-ons.
UsagePercentage *float64 `json:"usage_percentage,omitempty"`
// Revenue schedule type
RevenueScheduleType *string `json:"revenue_schedule_type,omitempty"`
}