Documentation
¶
Index ¶
- type AddOn
- type AddOnInput
- type AddOnListInput
- type AddOnParams
- type AddOnRequest
- func (adr *AddOnRequest) ApplyToCustomer(ctx context.Context, applyAddOnInput *ApplyAddOnInput) (*AppliedAddOn, *Error)
- func (adr *AddOnRequest) Create(ctx context.Context, addOnInput *AddOnInput) (*AddOn, *Error)
- func (adr *AddOnRequest) Delete(ctx context.Context, addOnCode string) (*AddOn, *Error)
- func (adr *AddOnRequest) Get(ctx context.Context, addOnCode string) (*AddOn, *Error)
- func (adr *AddOnRequest) GetList(ctx context.Context, addOnListInput *AddOnListInput) (*AddOnResult, *Error)
- func (adr *AddOnRequest) Update(ctx context.Context, addOnInput *AddOnInput) (*AddOn, *Error)
- type AddOnResult
- type AggregationType
- type AppliedAddOn
- type AppliedAddOnResult
- type AppliedCoupon
- type AppliedCouponResult
- type ApplyAddOnInput
- type ApplyAddOnParams
- type ApplyCouponInput
- type ApplyCouponParams
- type BillableMetric
- type BillableMetricInput
- type BillableMetricListInput
- type BillableMetricParams
- type BillableMetricRequest
- func (bmr *BillableMetricRequest) Create(ctx context.Context, billableMetricInput *BillableMetricInput) (*BillableMetric, *Error)
- func (bmr *BillableMetricRequest) Delete(ctx context.Context, billableMetricCode string) (*BillableMetric, *Error)
- func (bmr *BillableMetricRequest) Get(ctx context.Context, billableMetricCode string) (*BillableMetric, *Error)
- func (bmr *BillableMetricRequest) GetList(ctx context.Context, billableMetricListInput *BillableMetricListInput) (*BillableMetricResult, *Error)
- func (bmr *BillableMetricRequest) Update(ctx context.Context, billableMetricInput *BillableMetricInput) (*BillableMetric, *Error)
- type BillableMetricResult
- type BillingTime
- type Charge
- type ChargeModel
- type Client
- func (c *Client) AddOn() *AddOnRequest
- func (c *Client) BillableMetric() *BillableMetricRequest
- func (c *Client) Coupon() *CouponRequest
- func (c *Client) Customer() *CustomerRequest
- func (c *Client) Delete(ctx context.Context, cr *ClientRequest) (interface{}, *Error)
- func (c *Client) Event() *EventRequest
- func (c *Client) Get(ctx context.Context, cr *ClientRequest) (interface{}, *Error)
- func (c *Client) Group() *GroupRequest
- func (c *Client) Invoice() *InvoiceRequest
- func (c *Client) Organization() *OrganizationRequest
- func (c *Client) Plan() *PlanRequest
- func (c *Client) Post(ctx context.Context, cr *ClientRequest) (interface{}, *Error)
- func (c *Client) PostWithoutBody(ctx context.Context, cr *ClientRequest) (interface{}, *Error)
- func (c *Client) PostWithoutResult(ctx context.Context, cr *ClientRequest) *Error
- func (c *Client) Put(ctx context.Context, cr *ClientRequest) (interface{}, *Error)
- func (c *Client) SetApiKey(apiKey string) *Client
- func (c *Client) SetBaseURL(url string) *Client
- func (c *Client) SetDebug(debug bool) *Client
- func (c *Client) Subscription() *SubscriptionRequest
- func (c *Client) Wallet() *WalletRequest
- func (c *Client) WalletTransaction() *WalletTransactionRequest
- type ClientRequest
- type Coupon
- type CouponCalculationType
- type CouponExpiration
- type CouponFrequency
- type CouponInput
- type CouponListInput
- type CouponParams
- type CouponRequest
- func (cr *CouponRequest) ApplyToCustomer(ctx context.Context, applyCouponInput *ApplyCouponInput) (*AppliedCoupon, *Error)
- func (cr *CouponRequest) Create(ctx context.Context, couponInput *CouponInput) (*Coupon, *Error)
- func (cr *CouponRequest) Delete(ctx context.Context, couponCode string) (*Coupon, *Error)
- func (cr *CouponRequest) Get(ctx context.Context, couponCode string) (*Coupon, *Error)
- func (cr *CouponRequest) GetList(ctx context.Context, couponListInput *CouponListInput) (*CouponResult, *Error)
- func (cr *CouponRequest) Update(ctx context.Context, couponInput *CouponInput) (*Coupon, *Error)
- type CouponResult
- type Currency
- type Customer
- type CustomerBillingConfiguration
- type CustomerBillingConfigurationInput
- type CustomerChargeUsage
- type CustomerInput
- type CustomerListInput
- type CustomerParams
- type CustomerPaymentProvider
- type CustomerRequest
- func (cr *CustomerRequest) Create(ctx context.Context, customerInput *CustomerInput) (*Customer, *Error)
- func (cr *CustomerRequest) CurrentUsage(ctx context.Context, externalCustomerID string) (*CustomerUsage, *Error)
- func (cr *CustomerRequest) Get(ctx context.Context, externalCustomerID string) (*Customer, *Error)
- func (cr *CustomerRequest) GetList(ctx context.Context, customerListInput *CustomerListInput) (*CustomerResult, *Error)
- func (cr *CustomerRequest) Update(ctx context.Context, customerInput *CustomerInput) (*Customer, *Error)
- type CustomerResult
- type CustomerUsage
- type CustomerUsageResult
- type Error
- type ErrorCode
- type ErrorDetail
- type EventInput
- type EventParams
- type EventRequest
- type Group
- type GroupListInput
- type GroupProperties
- type GroupRequest
- type GroupResult
- type Invoice
- type InvoiceCredit
- type InvoiceCreditItem
- type InvoiceCreditItemType
- type InvoiceFee
- type InvoiceFeeItem
- type InvoiceFeeItemType
- type InvoiceInput
- type InvoiceListInput
- type InvoiceParams
- type InvoiceRequest
- func (ir *InvoiceRequest) Download(ctx context.Context, invoiceID string) (*Invoice, *Error)
- func (ir *InvoiceRequest) Get(ctx context.Context, invoiceID string) (*Invoice, *Error)
- func (ir *InvoiceRequest) GetList(ctx context.Context, invoiceListInput *InvoiceListInput) (*InvoiceResult, *Error)
- func (ir *InvoiceRequest) Update(ctx context.Context, invoiceInput *InvoiceInput) (*Invoice, *Error)
- type InvoiceResult
- type InvoiceStatus
- type Metadata
- type Organization
- type OrganizationBillingConfiguration
- type OrganizationBillingConfigurationInput
- type OrganizationInput
- type OrganizationParams
- type OrganizationRequest
- type OrganizationResult
- type Plan
- type PlanChargeInput
- type PlanInput
- type PlanInterval
- type PlanListInput
- type PlanParams
- type PlanRequest
- func (pr *PlanRequest) Create(ctx context.Context, planInput *PlanInput) (*Plan, *Error)
- func (pr *PlanRequest) Delete(ctx context.Context, planCode string) (*Plan, *Error)
- func (pr *PlanRequest) Get(ctx context.Context, planCode string) (*Plan, *Error)
- func (pr *PlanRequest) GetList(ctx context.Context, planListInput *PlanListInput) (*PlanResult, *Error)
- func (pr *PlanRequest) Update(ctx context.Context, planInput *PlanInput) (*Plan, *Error)
- type PlanResult
- type Status
- type Subscription
- type SubscriptionInput
- type SubscriptionListInput
- type SubscriptionParams
- type SubscriptionRequest
- func (sr *SubscriptionRequest) Create(ctx context.Context, subscriptionInput *SubscriptionInput) (*Subscription, *Error)
- func (sr *SubscriptionRequest) GetList(ctx context.Context, subscriptionListInput SubscriptionListInput) (*SubscriptionResult, *Error)
- func (sr *SubscriptionRequest) Terminate(ctx context.Context, externalID string) (*Subscription, *Error)
- type SubscriptionResult
- type SubscriptionStatus
- type TransactionType
- type Wallet
- type WalletInput
- type WalletListInput
- type WalletParams
- type WalletRequest
- func (bmr *WalletRequest) Create(ctx context.Context, walletInput *WalletInput) (*Wallet, *Error)
- func (bmr *WalletRequest) Delete(ctx context.Context, walletId string) (*Wallet, *Error)
- func (bmr *WalletRequest) Get(ctx context.Context, walletId string) (*Wallet, *Error)
- func (bmr *WalletRequest) GetList(ctx context.Context, walletListInput *WalletListInput) (*WalletResult, *Error)
- func (bmr *WalletRequest) Update(ctx context.Context, walletInput *WalletInput, walletId string) (*Wallet, *Error)
- type WalletResult
- type WalletStatus
- type WalletTransaction
- type WalletTransactionInput
- type WalletTransactionParams
- type WalletTransactionRequest
- type WalletTransactionResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddOn ¶
type AddOn struct { LagoID uuid.UUID `json:"lago_id,omitempty"` Name string `json:"name,omitempty"` Code string `json:"code,omitempty"` Description string `json:"description,omitempty"` AmountCents int `json:"amount_cents,omitempty"` AmountCurrency Currency `json:"amount_currency,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` }
type AddOnInput ¶
type AddOnListInput ¶
type AddOnParams ¶
type AddOnParams struct {
AddOn *AddOnInput `json:"add_on"`
}
type AddOnRequest ¶
type AddOnRequest struct {
// contains filtered or unexported fields
}
func (*AddOnRequest) ApplyToCustomer ¶
func (adr *AddOnRequest) ApplyToCustomer(ctx context.Context, applyAddOnInput *ApplyAddOnInput) (*AppliedAddOn, *Error)
func (*AddOnRequest) Create ¶
func (adr *AddOnRequest) Create(ctx context.Context, addOnInput *AddOnInput) (*AddOn, *Error)
func (*AddOnRequest) GetList ¶
func (adr *AddOnRequest) GetList(ctx context.Context, addOnListInput *AddOnListInput) (*AddOnResult, *Error)
func (*AddOnRequest) Update ¶
func (adr *AddOnRequest) Update(ctx context.Context, addOnInput *AddOnInput) (*AddOn, *Error)
type AddOnResult ¶
type AggregationType ¶
type AggregationType string
const ( CountAggregation AggregationType = "count_agg" SumAggregation AggregationType = "sum_agg" MaxAggregation AggregationType = "max_agg" UniqueCountAggregation AggregationType = "unique_count_agg" RecurringCountAggregation AggregationType = "recurring_count_agg" )
type AppliedAddOn ¶
type AppliedAddOn struct { LagoID uuid.UUID `json:"lago_id,omitempty"` LagoAddOnID uuid.UUID `json:"lago_add_on_id,omitempty"` LagoCustomerID uuid.UUID `json:"lago_customer_id,omitempty"` ExternalCustomerID string `json:"external_customer_id,omitempty"` AddOnCode string `json:"add_on_code,omitempty"` AmountCents int `json:"amount_cents,omitempty"` AmountCurrency Currency `json:"amount_currency,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` }
type AppliedAddOnResult ¶
type AppliedAddOnResult struct {
AppliedAddOn *AppliedAddOn `json:"applied_add_on,omitempty"`
}
type AppliedCoupon ¶
type AppliedCoupon struct { LagoID uuid.UUID `json:"lago_id,omitempty"` LagoCouponID uuid.UUID `json:"lago_coupon_id,omitempty"` ExternalCustomerID string `json:"external_customer_id,omitempty"` LagoCustomerID uuid.UUID `json:"lago_customer_id,omitempty"` CouponCode string `json:"coupon_code,omitempty"` AmountCents int `json:"amount_cents,omitempty"` AmountCurrency Currency `json:"amount_currency,omitempty"` ExpirationDate string `json:"expiration_date,omitempty"` TerminatedAt time.Time `json:"terminated_at,omitempty"` PercentageRate float32 `json:"percentage_rate,omitempty"` Frequency CouponFrequency `json:"frequency,omitempty"` FrequencyDuration int `json:"frequency_duration,omitempty"` }
type AppliedCouponResult ¶
type AppliedCouponResult struct {
AppliedCoupon *AppliedCoupon `json:"applied_coupon,omitempty"`
}
type ApplyAddOnInput ¶
type ApplyAddOnParams ¶
type ApplyAddOnParams struct {
AppliedAddOn *ApplyAddOnInput `json:"applied_add_on"`
}
type ApplyCouponInput ¶
type ApplyCouponInput struct { ExternalCustomerID string `json:"external_customer_id,omitempty"` CouponCode string `json:"coupon_code,omitempty"` AmountCents int `json:"amount_cents,omitempty"` AmountCurrency Currency `json:"amount_currency,omitempty"` PercentageRate float32 `json:"percentage_rate,omitempty"` Frequency CouponFrequency `json:"frequency,omitempty"` FrequencyDuration int `json:"frequency_duration,omitempty"` }
type ApplyCouponParams ¶
type ApplyCouponParams struct {
AppliedCoupon *ApplyCouponInput `json:"applied_coupon"`
}
type BillableMetric ¶
type BillableMetricInput ¶
type BillableMetricInput struct { Name string `json:"name,omitempty"` Code string `json:"code,omitempty"` Description string `json:"description,omitempty"` AggregationType AggregationType `json:"aggregation_type,omitempty"` FieldName string `json:"field_name"` Group map[string]interface{} `json:"group,omitempty"` }
type BillableMetricListInput ¶
type BillableMetricParams ¶
type BillableMetricParams struct {
BillableMetricInput *BillableMetricInput
}
type BillableMetricRequest ¶
type BillableMetricRequest struct {
// contains filtered or unexported fields
}
func (*BillableMetricRequest) Create ¶
func (bmr *BillableMetricRequest) Create(ctx context.Context, billableMetricInput *BillableMetricInput) (*BillableMetric, *Error)
func (*BillableMetricRequest) Delete ¶
func (bmr *BillableMetricRequest) Delete(ctx context.Context, billableMetricCode string) (*BillableMetric, *Error)
func (*BillableMetricRequest) Get ¶
func (bmr *BillableMetricRequest) Get(ctx context.Context, billableMetricCode string) (*BillableMetric, *Error)
func (*BillableMetricRequest) GetList ¶
func (bmr *BillableMetricRequest) GetList(ctx context.Context, billableMetricListInput *BillableMetricListInput) (*BillableMetricResult, *Error)
func (*BillableMetricRequest) Update ¶
func (bmr *BillableMetricRequest) Update(ctx context.Context, billableMetricInput *BillableMetricInput) (*BillableMetric, *Error)
type BillableMetricResult ¶
type BillableMetricResult struct { BillableMetric *BillableMetric `json:"billable_metric,omitempty"` BillableMetrics []BillableMetric `json:"billable_metrics,omitempty"` Meta Metadata `json:"meta,omitempty"` }
type BillingTime ¶
type BillingTime string
const ( Anniversary BillingTime = "anniversary" Calendar BillingTime = "calendar" )
type Charge ¶
type Charge struct { LagoID uuid.UUID `json:"lago_id,omitempty"` LagoBillableMetricID uuid.UUID `json:"lago_billable_metric_id,omitempty"` ChargeModel ChargeModel `json:"charge_model,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` Properties map[string]interface{} `json:"properties,omitempty"` GroupProperties []GroupProperties `json:"group_properties,omitempty"` }
type ChargeModel ¶
type ChargeModel string
const ( StandardChargeModel ChargeModel = "standard" GraduatedChargeModel ChargeModel = "graduated" PackageChargeModel ChargeModel = "package" PercentageChargeModel ChargeModel = "percentage" )
type Client ¶
type Client struct { Debug bool HttpClient *resty.Client }
func (*Client) AddOn ¶
func (c *Client) AddOn() *AddOnRequest
func (*Client) BillableMetric ¶
func (c *Client) BillableMetric() *BillableMetricRequest
func (*Client) Coupon ¶
func (c *Client) Coupon() *CouponRequest
func (*Client) Customer ¶
func (c *Client) Customer() *CustomerRequest
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, cr *ClientRequest) (interface{}, *Error)
func (*Client) Event ¶
func (c *Client) Event() *EventRequest
func (*Client) Get ¶
func (c *Client) Get(ctx context.Context, cr *ClientRequest) (interface{}, *Error)
func (*Client) Group ¶
func (c *Client) Group() *GroupRequest
func (*Client) Invoice ¶
func (c *Client) Invoice() *InvoiceRequest
func (*Client) Organization ¶
func (c *Client) Organization() *OrganizationRequest
func (*Client) Plan ¶
func (c *Client) Plan() *PlanRequest
func (*Client) Post ¶
func (c *Client) Post(ctx context.Context, cr *ClientRequest) (interface{}, *Error)
func (*Client) PostWithoutBody ¶
func (c *Client) PostWithoutBody(ctx context.Context, cr *ClientRequest) (interface{}, *Error)
func (*Client) PostWithoutResult ¶
func (c *Client) PostWithoutResult(ctx context.Context, cr *ClientRequest) *Error
func (*Client) Put ¶
func (c *Client) Put(ctx context.Context, cr *ClientRequest) (interface{}, *Error)
func (*Client) SetBaseURL ¶
func (*Client) Subscription ¶
func (c *Client) Subscription() *SubscriptionRequest
func (*Client) Wallet ¶
func (c *Client) Wallet() *WalletRequest
func (*Client) WalletTransaction ¶
func (c *Client) WalletTransaction() *WalletTransactionRequest
type ClientRequest ¶
type Coupon ¶
type Coupon struct { LagoID uuid.UUID `json:"lago_id,omitempty"` Name string `json:"name,omitempty"` Code string `json:"code,omitempty"` AmountCents int `json:"amount_cents,omitempty"` AmountCurrency Currency `json:"amount_currency,omitempty"` Expiration CouponExpiration `json:"expiration,omitempty"` ExpirationDate string `json:"expiration_date,omitempty"` PercentageRate float32 `json:"percentage_rate,omitempty"` CouponType CouponCalculationType `json:"coupon_type,omitempty"` Frequency CouponFrequency `json:"frequency,omitempty"` FrequencyDuration int `json:"frequency_duration,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` }
type CouponCalculationType ¶
type CouponCalculationType string
const ( CouponTypeFixedAmount CouponCalculationType = "fixed_amount" CouponTypePercentage CouponCalculationType = "percentage" )
type CouponExpiration ¶
type CouponExpiration string
const ( CouponExpirationTimeLimit CouponExpiration = "time_limit" CouponExpirationNoExpiration CouponExpiration = "no_expiration" )
type CouponFrequency ¶
type CouponFrequency string
const ( CouponFrequencyOnce CouponFrequency = "once" CouponFrequencyRecurring CouponFrequency = "recurring" )
type CouponInput ¶
type CouponInput struct { Name string `json:"name,omitempty"` Code string `json:"code,omitempty"` AmountCents int `json:"amount_cents,omitempty"` AmountCurrency Currency `json:"amount_currency,omitempty"` Expiration CouponExpiration `json:"expiration,omitempty"` ExpirationDate string `json:"expiration_date,omitempty"` PercentageRate float32 `json:"percentage_rate,omitempty"` CouponType CouponCalculationType `json:"coupon_type,omitempty"` Frequency CouponFrequency `json:"frequency,omitempty"` FrequencyDuration int `json:"frequency_duration,omitempty"` }
type CouponListInput ¶
type CouponParams ¶
type CouponParams struct {
Coupon *CouponInput `json:"coupon"`
}
type CouponRequest ¶
type CouponRequest struct {
// contains filtered or unexported fields
}
func (*CouponRequest) ApplyToCustomer ¶
func (cr *CouponRequest) ApplyToCustomer(ctx context.Context, applyCouponInput *ApplyCouponInput) (*AppliedCoupon, *Error)
func (*CouponRequest) Create ¶
func (cr *CouponRequest) Create(ctx context.Context, couponInput *CouponInput) (*Coupon, *Error)
func (*CouponRequest) GetList ¶
func (cr *CouponRequest) GetList(ctx context.Context, couponListInput *CouponListInput) (*CouponResult, *Error)
func (*CouponRequest) Update ¶
func (cr *CouponRequest) Update(ctx context.Context, couponInput *CouponInput) (*Coupon, *Error)
type CouponResult ¶
type Currency ¶
type Currency string
const ( AED Currency = "AED" AFN Currency = "AFN" ALL Currency = "ALL" AMD Currency = "AMD" ANG Currency = "ANG" AOA Currency = "AOA" ARS Currency = "ARS" AUD Currency = "AUD" AWG Currency = "AWG" AZN Currency = "AZN" BAM Currency = "BAM" BBD Currency = "BBD" BDT Currency = "BDT" BGN Currency = "BGN" BIF Currency = "BIF" BMD Currency = "BMD" BND Currency = "BND" BOB Currency = "BOB" BRL Currency = "BRL" BSD Currency = "BSD" BWP Currency = "BWP" BYN Currency = "BYN" BZD Currency = "BZD" CAD Currency = "CAD" CDF Currency = "CDF" CHF Currency = "CHF" CLP Currency = "CLP" CNY Currency = "CNY" COP Currency = "COP" CRC Currency = "CRC" CVE Currency = "CVE" CZK Currency = "CZK" DJF Currency = "DJF" DKK Currency = "DKK" DOP Currency = "DOP" DZD Currency = "DZD" EGP Currency = "EGP" ETB Currency = "ETB" EUR Currency = "EUR" FJD Currency = "FJD" FKP Currency = "FKP" GBP Currency = "GBP" GEL Currency = "GEL" GIP Currency = "GIP" GMD Currency = "GMD" GNF Currency = "GNF" GTQ Currency = "GTQ" GYD Currency = "GYD" HKD Currency = "HKD" HNL Currency = "HNL" HRK Currency = "HRK" HTG Currency = "HTG" HUF Currency = "HUF" IDR Currency = "IDR" ILS Currency = "ILS" INR Currency = "INR" ISK Currency = "ISK" JMD Currency = "JMD" JPY Currency = "JPY" KES Currency = "KES" KGS Currency = "KGS" KHR Currency = "KHR" KMF Currency = "KMF" KRW Currency = "KRW" KYD Currency = "KYD" KZT Currency = "KZT" LAK Currency = "LAK" LBP Currency = "LBP" LKR Currency = "LKR" LRD Currency = "LRD" LSL Currency = "LSL" MAD Currency = "MAD" MDL Currency = "MDL" MGA Currency = "MGA" MKD Currency = "MKD" MMK Currency = "MMK" MNT Currency = "MNT" MOP Currency = "MOP" MRO Currency = "MRO" MUR Currency = "MUR" MVR Currency = "MVR" MWK Currency = "MWK" MXN Currency = "MXN" MYR Currency = "MYR" MZN Currency = "MZN" NAD Currency = "NAD" NGN Currency = "NGN" NIO Currency = "NIO" NOK Currency = "NOK" NPR Currency = "NPR" NZD Currency = "NZD" PAB Currency = "PAB" PEN Currency = "PEN" PGK Currency = "PGK" PHP Currency = "PHP" PKR Currency = "PKR" PLN Currency = "PLN" PYG Currency = "PYG" QAR Currency = "QAR" RON Currency = "RON" RSD Currency = "RSD" RUB Currency = "RUB" RWF Currency = "RWF" SAR Currency = "SAR" SBD Currency = "SBD" SCR Currency = "SCR" SEK Currency = "SEK" SGD Currency = "SGD" SHP Currency = "SHP" SLL Currency = "SLL" SOS Currency = "SOS" SRD Currency = "SRD" STD Currency = "STD" SZL Currency = "SZL" THB Currency = "THB" TJS Currency = "TJS" TOP Currency = "TOP" TRY Currency = "TRY" TTD Currency = "TTD" TWD Currency = "TWD" TZS Currency = "TZS" UAH Currency = "UAH" UGX Currency = "UGX" USD Currency = "USD" UYU Currency = "UYU" UZS Currency = "UZS" VND Currency = "VND" VUV Currency = "VUV" WST Currency = "WST" XAF Currency = "XAF" XCD Currency = "XCD" XOF Currency = "XOF" XPF Currency = "XPF" YER Currency = "YER" ZAR Currency = "ZAR" ZMW Currency = "ZMW" )
type Customer ¶
type Customer struct { LagoID uuid.UUID `json:"lago_id,omitempty"` SequentialID int `json:"sequential_id,omitempty"` ExternalID string `json:"external_id,omitempty"` Slug string `json:"slug,omitempty"` Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` AddressLine1 string `json:"address_line1,omitempty"` AddressLine2 string `json:"address_line2,omitempty"` City string `json:"city,omitempty"` State string `json:"state,omitempty"` Zipcode string `json:"zipcode,omitempty"` Country string `json:"country,omitempty"` LegalName string `json:"legal_name,omitempty"` LegalNumber string `json:"legal_number,omitempty"` LogoURL string `json:"logo_url,omitempty"` Phone string `json:"phone,omitempty"` URL string `json:"url,omitempty"` BillingConfiguration CustomerBillingConfiguration `json:"billing_configuration,omitempty"` Currency Currency `json:"currency,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` }
type CustomerBillingConfiguration ¶
type CustomerBillingConfiguration struct { PaymentProvider CustomerPaymentProvider `json:"payment_provider,omitempty"` ProviderCustomerID string `json:"provider_customer_id,omitempty"` Sync bool `json:"sync,omitempty"` VatRate float32 `json:"vat_rate,omitempty"` }
type CustomerBillingConfigurationInput ¶
type CustomerBillingConfigurationInput struct { PaymentProvider CustomerPaymentProvider `json:"payment_provider,omitempty"` ProviderCustomerID string `json:"provider_customer_id,omitempty"` Sync bool `json:"sync,omitempty"` VatRate float32 `json:"vat_rate,omitempty"` }
type CustomerChargeUsage ¶
type CustomerChargeUsage struct { Units string `json:"units,omitempty"` AmountCents int `json:"amount_cents,omitempty"` AmountCurrency Currency `json:"amount_currency,omitempty"` Charge *Charge `json:"charge,omitempty"` BillableMetric *BillableMetric `json:"billable_metric,omitempty"` }
type CustomerInput ¶
type CustomerInput struct { ExternalID string `json:"external_id,omitempty"` Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` AddressLine1 string `json:"address_line_1,omitempty"` AddressLine2 string `json:"address_line_2,omitempty"` City string `json:"city,omitempty"` Zipcode string `json:"zipcode,omitempty"` State string `json:"state,omitempty"` Country string `json:"country,omitempty"` LegalName string `json:"legal_name,omitempty"` LegalNumber string `json:"legal_number,omitempty"` Phone string `json:"phone,omitempty"` URL string `json:"url,omitempty"` Currency Currency `json:"currency,omitempty"` BillingConfiguration CustomerBillingConfigurationInput `json:"billing_configuration,omitempty"` }
type CustomerListInput ¶
type CustomerParams ¶
type CustomerParams struct {
Customer *CustomerInput `json:"customer"`
}
type CustomerPaymentProvider ¶
type CustomerPaymentProvider string
const (
PaymentProviderStripe CustomerPaymentProvider = "stripe"
)
type CustomerRequest ¶
type CustomerRequest struct {
// contains filtered or unexported fields
}
func (*CustomerRequest) Create ¶
func (cr *CustomerRequest) Create(ctx context.Context, customerInput *CustomerInput) (*Customer, *Error)
func (*CustomerRequest) CurrentUsage ¶
func (cr *CustomerRequest) CurrentUsage(ctx context.Context, externalCustomerID string) (*CustomerUsage, *Error)
func (*CustomerRequest) GetList ¶
func (cr *CustomerRequest) GetList(ctx context.Context, customerListInput *CustomerListInput) (*CustomerResult, *Error)
func (*CustomerRequest) Update ¶
func (cr *CustomerRequest) Update(ctx context.Context, customerInput *CustomerInput) (*Customer, *Error)
NOTE: Update endpoint does not exists, actually we use the create endpoint with the same externalID to update a customer
type CustomerResult ¶
type CustomerUsage ¶
type CustomerUsage struct { FromDate string `json:"from_date,omitempty"` ToDate string `json:"to_date,omitempty"` IssuingDate string `json:"issuing_date,omitempty"` AmountCents int `json:"amount_cents,omitempty"` AmountCurrency Currency `json:"amount_currency,omitempty"` TotalAmountCents int `json:"total_amount_cents,omitempty"` TotalAmountCurrency Currency `json:"total_amount_currency,omitempty"` VatAmountCents int `json:"vat_amount_cents,omitempty"` VatAmountCurrency Currency `json:"vat_amount_currency,omitempty"` ChargesUsage []CustomerChargeUsage `json:"charges_usage,omitempty"` }
type CustomerUsageResult ¶
type CustomerUsageResult struct {
CustomerUsage *CustomerUsage `json:"customer_usage"`
}
type Error ¶
type Error struct { Err error `json:"-"` HTTPStatusCode int `json:"status"` Msg string `json:"message"` ErrorDetail ErrorDetail `json:"error_details"` }
type ErrorDetail ¶ added in v1.5.3
type ErrorDetail struct {
ErrorCode []ErrorCode `json:"code,omitempty"`
}
type EventInput ¶
type EventInput struct { TransactionID string `json:"transaction_id,omitempty"` ExternalCustomerID string `json:"external_customer_id,omitempty"` ExternalSubscriptionID string `json:"external_subscription_id,omitempty"` Code string `json:"code,omitempty"` Timestamp int64 `json:"timestamp,omitempty"` Properties map[string]string `json:"properties,omitempty"` }
type EventParams ¶
type EventParams struct {
Event *EventInput `json:"event"`
}
type EventRequest ¶
type EventRequest struct {
// contains filtered or unexported fields
}
func (*EventRequest) Create ¶
func (er *EventRequest) Create(ctx context.Context, eventInput *EventInput) *Error
type GroupListInput ¶
type GroupProperties ¶
type GroupRequest ¶
type GroupRequest struct {
// contains filtered or unexported fields
}
func (*GroupRequest) GetList ¶
func (cr *GroupRequest) GetList(ctx context.Context, groupListInput *GroupListInput) (*GroupResult, *Error)
type GroupResult ¶
type Invoice ¶
type Invoice struct { LagoID uuid.UUID `json:"lago_id,omitempty"` SequentialID int `json:"sequential_id,omitempty"` Number string `json:"number,omitempty"` Status InvoiceStatus `json:"status,omitempty"` AmountCents int `json:"amount_cents,omitempty"` AmountCurrency Currency `json:"amount_currency,omitempty"` VatAmountCents int `json:"vat_amount_cents,omitempty"` VatAmountCurrency Currency `json:"vat_amount_currency,omitempty"` FileURL string `json:"file_url,omitempty"` FromDate string `json:"from_date,omitempty"` ToDate string `json:"to_date,omitempty"` ChargesFromDate string `json:"charges_from_date,omitempty"` IssuingDate string `json:"issuing_date,omitempty"` Customer *Customer `json:"customer,omitempty"` Subscriptions []Subscription `json:"subscriptions,omitempty"` Fees []InvoiceFee `json:"fees,omitempty"` Credits []InvoiceCredit `json:"credits,omitempty"` }
type InvoiceCredit ¶
type InvoiceCredit struct { Item InvoiceCreditItem `json:"item,omitempty"` AmountCents int `json:"amount_cents,omitempty"` AmountCurrency Currency `json:"amount_currency,omitempty"` }
type InvoiceCreditItem ¶
type InvoiceCreditItem struct { Type InvoiceCreditItemType `json:"type,omitempty"` Code string `json:"code,omitempty"` Name string `json:"name,omitempty"` }
type InvoiceCreditItemType ¶
type InvoiceCreditItemType string
const (
InvoiceCreditItemCredit InvoiceCreditItemType = "coupon"
)
type InvoiceFee ¶
type InvoiceFee struct { Item InvoiceFeeItem `json:"item,omitempty"` AmountCents int `json:"amount_cents,omitempty"` AmountCurrency Currency `json:"amount_currency,omitempty"` VatAmountCents int `json:"vat_amount_cents,omitempty"` VatAmountCurrency Currency `json:"vat_amount_currency,omitempty"` Units float32 `json:"units,omitempty,string"` EventsCount int `json:"events_count,omitempty"` }
type InvoiceFeeItem ¶
type InvoiceFeeItem struct { Type InvoiceFeeItemType `json:"type,omitempty"` Code string `json:"code,omitempty"` Name string `json:"name,omitempty"` }
type InvoiceFeeItemType ¶
type InvoiceFeeItemType string
const ( InvoiceFeeItemSubscription InvoiceFeeItemType = "subscription" InvoiceFeeItemCharge InvoiceFeeItemType = "charge" InvoiceFeeItemAddOn InvoiceFeeItemType = "add_on" )
type InvoiceInput ¶
type InvoiceInput struct { LagoID uuid.UUID `json:"lago_id,omitempty"` Status InvoiceStatus `json:"status,omitempty"` }
type InvoiceListInput ¶
type InvoiceParams ¶
type InvoiceParams struct {
Invoice *InvoiceInput `json:"invoice"`
}
type InvoiceRequest ¶
type InvoiceRequest struct {
// contains filtered or unexported fields
}
func (*InvoiceRequest) GetList ¶
func (ir *InvoiceRequest) GetList(ctx context.Context, invoiceListInput *InvoiceListInput) (*InvoiceResult, *Error)
func (*InvoiceRequest) Update ¶
func (ir *InvoiceRequest) Update(ctx context.Context, invoiceInput *InvoiceInput) (*Invoice, *Error)
type InvoiceResult ¶
type InvoiceStatus ¶
type InvoiceStatus string
const ( InvoiceStatusPending InvoiceStatus = "pending" InvoiceStatusSucceeded InvoiceStatus = "succeeded" InvoiceStatusFailed InvoiceStatus = "failed" )
type Organization ¶
type Organization struct { Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` AddressLine1 string `json:"address_line_1,omitempty"` AddressLine2 string `json:"address_line_2,omitempty"` City string `json:"city,omitempty"` Zipcode string `json:"zipcode,omitempty"` State string `json:"state,omitempty"` Country string `json:"country,omitempty"` LegalName string `json:"legal_name,omitempty"` LegalNumber string `json:"legal_number,omitempty"` BillingConfiguration OrganizationBillingConfiguration `json:"billing_configuration,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` }
type OrganizationBillingConfiguration ¶
type OrganizationBillingConfiguration struct { VatRate float32 `json:"vat_rate,omitempty"` }
type OrganizationBillingConfigurationInput ¶
type OrganizationBillingConfigurationInput struct { VatRate float32 `json:"vat_rate,omitempty"` }
type OrganizationInput ¶
type OrganizationInput struct { Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` AddressLine1 string `json:"address_line_1,omitempty"` AddressLine2 string `json:"address_line_2,omitempty"` City string `json:"city,omitempty"` Zipcode string `json:"zipcode,omitempty"` State string `json:"state,omitempty"` Country string `json:"country,omitempty"` LegalName string `json:"legal_name,omitempty"` LegalNumber string `json:"legal_number,omitempty"` WebhookURL string `json:"webhook_url,omitempty"` BillingConfiguration OrganizationBillingConfigurationInput `json:"billing_configuration,omitempty"` }
type OrganizationParams ¶
type OrganizationParams struct {
Organization *OrganizationInput `json:"organization"`
}
type OrganizationRequest ¶
type OrganizationRequest struct {
// contains filtered or unexported fields
}
func (*OrganizationRequest) Update ¶
func (or *OrganizationRequest) Update(ctx context.Context, organizationInput *OrganizationInput) (*Organization, *Error)
type OrganizationResult ¶
type OrganizationResult struct {
Organization *Organization `json:"organization,omitempty"`
}
type Plan ¶
type Plan struct { LagoID uuid.UUID `json:"lago_id"` Name string `json:"name,omitempty"` Code string `json:"code,omitempty"` Interval PlanInterval `json:"interval,omitempty"` Description string `json:"description,omitempty"` AmountCents int `json:"amount_cents,omitempty"` AmountCurrency Currency `json:"amount_currency,omitempty"` PayInAdvance bool `json:"pay_in_advance,omitempty"` BillChargeMonthly bool `json:"bill_charge_monthly,omitempty"` Charges []Charge `json:"charges,omitempty"` }
type PlanChargeInput ¶
type PlanChargeInput struct { LagoID *uuid.UUID `json:"id,omitempty"` BillableMetricID uuid.UUID `json:"billable_metric_id,omitempty"` AmountCurrency Currency `json:"amount_currency,omitempty"` ChargeModel ChargeModel `json:"charge_model,omitempty"` Properties map[string]interface{} `json:"properties"` GroupProperties []GroupProperties `json:"group_properties,omitempty"` }
type PlanInput ¶
type PlanInput struct { Name string `json:"name,omitempty"` Code string `json:"code,omitempty"` Interval PlanInterval `json:"interval,omitempty"` Description string `json:"description,omitempty"` AmountCents int `json:"amount_cents,omitempty"` AmountCurrency Currency `json:"amount_currency,omitempty"` PayInAdvance bool `json:"pay_in_advance,omitempty"` BillChargeMonthly bool `json:"bill_charge_monthly,omitempty"` Charges []PlanChargeInput `json:"charges,omitempty"` }
type PlanInterval ¶
type PlanInterval string
const ( PlanWeekly PlanInterval = "weekly" PlanMonthly PlanInterval = "monthly" PlanYearly PlanInterval = "yearly" )
type PlanListInput ¶
type PlanParams ¶
type PlanParams struct {
Plan *PlanInput `json:"plan"`
}
type PlanRequest ¶
type PlanRequest struct {
// contains filtered or unexported fields
}
func (*PlanRequest) GetList ¶
func (pr *PlanRequest) GetList(ctx context.Context, planListInput *PlanListInput) (*PlanResult, *Error)
type PlanResult ¶
type Subscription ¶
type Subscription struct { LagoID uuid.UUID `json:"lago_id"` LagoCustomerID uuid.UUID `json:"lago_customer_id"` ExternalCustomerID string `json:"external_customer_id"` ExternalID string `json:"external_id"` PlanCode string `json:"plan_code"` Name string `json:"name"` Status SubscriptionStatus `json:"status"` BillingTime BillingTime `json:"billing_time"` SubscriptionDate string `json:"subscription_date"` PreviousPlanCode string `json:"previous_plan_code"` NextPlanCode string `json:"next_plan_code"` DowngradePlanDate string `json:"downgrade_plan_date"` CreatedAt *time.Time `json:"created_at"` StartedAt *time.Time `json:"started_at"` CanceledAt *time.Time `json:"canceled_at"` TerminatedAt *time.Time `json:"terminated_at"` }
type SubscriptionInput ¶
type SubscriptionInput struct { ExternalCustomerID string `json:"external_customer_id,omitempty"` PlanCode string `json:"plan_code,omitempty"` SubscriptionDate string `json:"subscription_date,omitempty"` BillingTime BillingTime `json:"billing_time,omitempty"` ExternalID string `json:"external_id"` Name string `json:"name"` }
type SubscriptionListInput ¶
type SubscriptionParams ¶
type SubscriptionParams struct {
Subscription *SubscriptionInput `json:"subscription"`
}
type SubscriptionRequest ¶
type SubscriptionRequest struct {
// contains filtered or unexported fields
}
func (*SubscriptionRequest) Create ¶
func (sr *SubscriptionRequest) Create(ctx context.Context, subscriptionInput *SubscriptionInput) (*Subscription, *Error)
func (*SubscriptionRequest) GetList ¶
func (sr *SubscriptionRequest) GetList(ctx context.Context, subscriptionListInput SubscriptionListInput) (*SubscriptionResult, *Error)
func (*SubscriptionRequest) Terminate ¶
func (sr *SubscriptionRequest) Terminate(ctx context.Context, externalID string) (*Subscription, *Error)
type SubscriptionResult ¶
type SubscriptionResult struct { Subscription *Subscription `json:"subscription,omitempty"` Subscriptions []Subscription `json:"subscriptions,omitempty"` Meta Metadata `json:"meta,omitempty"` }
type SubscriptionStatus ¶
type SubscriptionStatus string
const ( SubscriptionStatusActive SubscriptionStatus = "active" SubscriptionStatusPending SubscriptionStatus = "pending" SubscriptionStatusTerminated SubscriptionStatus = "terminated" SubscriptionStatusCanceled SubscriptionStatus = "canceled" )
type TransactionType ¶
type TransactionType string
const ( Outbound TransactionType = "outbound" Inbound TransactionType = "inbound" )
type Wallet ¶
type Wallet struct { LagoID uuid.UUID `json:"lago_id,omitempty"` LagoCustomerID uuid.UUID `json:"lago_customer_id,omitempty"` ExternalCustomerID string `json:"external_customer_id,omitempty"` Status Status `json:"status,omitempty"` Currency string `json:"currency,omitempty"` Name string `json:"name,omitempty"` RateAmount string `json:"rate_amount,omitempty"` CreditsBalance string `json:"credits_balance,omitempty"` Balance string `json:"balance,omitempty"` ConsumedCredits string `json:"consumed_credits,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` ExpirationDate time.Time `json:"expiration_date,omitempty"` LastBalanceSyncAt time.Time `json:"last_balance_sync_at,omitempty"` LastConsumedCreditAt time.Time `json:"last_consumed_credit_at,omitempty"` TerminatedAt time.Time `json:"terminated_at,omitempty"` }
type WalletInput ¶
type WalletInput struct { RateAmount string `json:"rate_amount,omitempty"` Name string `json:"name,omitempty"` PaidCredits string `json:"paid_credits,omitempty"` GrantedCredits string `json:"granted_credits,omitempty"` ExpirationDate string `json:"expiration_date,omitempty"` ExternalCustomerId string `json:"external_customer_id,omitempty"` }
type WalletListInput ¶
type WalletParams ¶
type WalletParams struct {
WalletInput *WalletInput
}
type WalletRequest ¶
type WalletRequest struct {
// contains filtered or unexported fields
}
func (*WalletRequest) Create ¶
func (bmr *WalletRequest) Create(ctx context.Context, walletInput *WalletInput) (*Wallet, *Error)
func (*WalletRequest) GetList ¶
func (bmr *WalletRequest) GetList(ctx context.Context, walletListInput *WalletListInput) (*WalletResult, *Error)
func (*WalletRequest) Update ¶
func (bmr *WalletRequest) Update(ctx context.Context, walletInput *WalletInput, walletId string) (*Wallet, *Error)
type WalletResult ¶
type WalletStatus ¶
type WalletStatus string
const ( WalletStatusPending WalletStatus = "pending" WalletStatusSettled WalletStatus = "settled" )
type WalletTransaction ¶
type WalletTransaction struct { LagoID uuid.UUID `json:"lago_id,omitempty"` LagoWalletID uuid.UUID `json:"lago_wallet_id,omitempty"` Status WalletStatus `json:"status,omitempty"` TransactionType TransactionType `json:"transaction_type,omitempty"` Amount string `json:"amount,omitempty"` CreditAmount string ` json:"credit_amount,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` SettledAt time.Time `json:"settled_at,omitempty"` }
type WalletTransactionInput ¶
type WalletTransactionParams ¶
type WalletTransactionParams struct {
WalletTransactionInput *WalletTransactionInput
}
type WalletTransactionRequest ¶
type WalletTransactionRequest struct {
// contains filtered or unexported fields
}
func (*WalletTransactionRequest) Create ¶
func (bmr *WalletTransactionRequest) Create(ctx context.Context, walletTransactionInput *WalletTransactionInput) (*WalletTransaction, *Error)
type WalletTransactionResult ¶
type WalletTransactionResult struct {
WalletTransactions []WalletTransaction `json:"wallet_transactions,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.