Documentation ¶
Index ¶
- type AddOn
- type AddOnInput
- type AddOnListInput
- type AddOnParams
- type AddOnRequest
- func (adr *AddOnRequest) ApplyToCustomer(applyAddOnInput *ApplyAddOnInput) (*AppliedAddOn, *Error)
- func (adr *AddOnRequest) Create(addOnInput *AddOnInput) (*AddOn, *Error)
- func (adr *AddOnRequest) Delete(addOnCode string) (*AddOn, *Error)
- func (adr *AddOnRequest) Get(addOnCode string) (*AddOn, *Error)
- func (adr *AddOnRequest) GetList(addOnListInput *AddOnListInput) (*AddOnResult, *Error)
- func (adr *AddOnRequest) Update(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(billableMetricInput *BillableMetricInput) (*BillableMetric, *Error)
- func (bmr *BillableMetricRequest) Delete(billableMetricCode string) (*BillableMetric, *Error)
- func (bmr *BillableMetricRequest) Get(billableMetricCode string) (*BillableMetric, *Error)
- func (bmr *BillableMetricRequest) GetList(billableMetricListInput *BillableMetricListInput) (*BillableMetricResult, *Error)
- func (bmr *BillableMetricRequest) Update(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(cr *ClientRequest) (interface{}, *Error)
- func (c *Client) Event() *EventRequest
- func (c *Client) Get(cr *ClientRequest) (interface{}, *Error)
- func (c *Client) Invoice() *InvoiceRequest
- func (c *Client) Organization() *OrganizationRequest
- func (c *Client) Plan() *PlanRequest
- func (c *Client) Post(cr *ClientRequest) (interface{}, *Error)
- func (c *Client) PostWithoutBody(cr *ClientRequest) (interface{}, *Error)
- func (c *Client) PostWithoutResult(cr *ClientRequest) *Error
- func (c *Client) Put(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 CouponExpiration
- type CouponInput
- type CouponListInput
- type CouponParams
- type CouponRequest
- func (cr *CouponRequest) ApplyToCustomer(applyCouponInput *ApplyCouponInput) (*AppliedCoupon, *Error)
- func (cr *CouponRequest) Create(couponInput *CouponInput) (*Coupon, *Error)
- func (cr *CouponRequest) Delete(couponCode string) (*Coupon, *Error)
- func (cr *CouponRequest) Get(couponCode string) (*Coupon, *Error)
- func (cr *CouponRequest) GetList(couponListInput *CouponListInput) (*CouponResult, *Error)
- func (cr *CouponRequest) Update(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(customerInput *CustomerInput) (*Customer, *Error)
- func (cr *CustomerRequest) CurrentUsage(externalCustomerID string) (*CustomerUsage, *Error)
- func (cr *CustomerRequest) Get(externalCustomerID string) (*Customer, *Error)
- func (cr *CustomerRequest) GetList(customerListInput *CustomerListInput) (*CustomerResult, *Error)
- func (cr *CustomerRequest) Update(customerInput *CustomerInput) (*Customer, *Error)
- type CustomerResult
- type CustomerUsage
- type CustomerUsageResult
- type Error
- type ErrorCode
- type ErrorDetail
- type EventInput
- type EventParams
- type EventRequest
- 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(invoiceID string) (*Invoice, *Error)
- func (ir *InvoiceRequest) Get(invoiceID string) (*Invoice, *Error)
- func (ir *InvoiceRequest) GetList(invoiceListInput *InvoiceListInput) (*InvoiceResult, *Error)
- func (ir *InvoiceRequest) Update(invoiceInput *InvoiceInput) (*Invoice, *Error)
- type InvoiceResult
- type InvoiceStatus
- type Metadata
- type Organization
- 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(planInput *PlanInput) (*Plan, *Error)
- func (pr *PlanRequest) Delete(planCode string) (*Plan, *Error)
- func (pr *PlanRequest) Get(planCode string) (*Plan, *Error)
- func (pr *PlanRequest) GetList(planListInput *PlanListInput) (*PlanResult, *Error)
- func (pr *PlanRequest) Update(planInput *PlanInput) (*Plan, *Error)
- type PlanResult
- type Status
- type Subscription
- type SubscriptionInput
- type SubscriptionListInput
- type SubscriptionParams
- type SubscriptionRequest
- func (sr *SubscriptionRequest) Create(subscriptionInput *SubscriptionInput) (*Subscription, *Error)
- func (sr *SubscriptionRequest) GetList(subscriptionListInput SubscriptionListInput) (*SubscriptionResult, *Error)
- func (sr *SubscriptionRequest) Terminate(externalCustomerID string) (*Subscription, *Error)
- type SubscriptionResult
- type SubscriptionStatus
- type TransactionType
- type Wallet
- type WalletInput
- type WalletListInput
- type WalletParams
- type WalletRequest
- func (bmr *WalletRequest) Create(walletInput *WalletInput) (*Wallet, *Error)
- func (bmr *WalletRequest) Delete(walletId string) (*Wallet, *Error)
- func (bmr *WalletRequest) Get(walletId string) (*Wallet, *Error)
- func (bmr *WalletRequest) GetList(walletListInput *WalletListInput) (*WalletResult, *Error)
- func (bmr *WalletRequest) Update(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(applyAddOnInput *ApplyAddOnInput) (*AppliedAddOn, *Error)
func (*AddOnRequest) Create ¶
func (adr *AddOnRequest) Create(addOnInput *AddOnInput) (*AddOn, *Error)
func (*AddOnRequest) GetList ¶
func (adr *AddOnRequest) GetList(addOnListInput *AddOnListInput) (*AddOnResult, *Error)
func (*AddOnRequest) Update ¶
func (adr *AddOnRequest) Update(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"` }
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 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"` }
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(billableMetricInput *BillableMetricInput) (*BillableMetric, *Error)
func (*BillableMetricRequest) Delete ¶
func (bmr *BillableMetricRequest) Delete(billableMetricCode string) (*BillableMetric, *Error)
func (*BillableMetricRequest) Get ¶
func (bmr *BillableMetricRequest) Get(billableMetricCode string) (*BillableMetric, *Error)
func (*BillableMetricRequest) GetList ¶
func (bmr *BillableMetricRequest) GetList(billableMetricListInput *BillableMetricListInput) (*BillableMetricResult, *Error)
func (*BillableMetricRequest) Update ¶
func (bmr *BillableMetricRequest) Update(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"` }
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(cr *ClientRequest) (interface{}, *Error)
func (*Client) Event ¶
func (c *Client) Event() *EventRequest
func (*Client) Get ¶
func (c *Client) Get(cr *ClientRequest) (interface{}, *Error)
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(cr *ClientRequest) (interface{}, *Error)
func (*Client) PostWithoutBody ¶
func (c *Client) PostWithoutBody(cr *ClientRequest) (interface{}, *Error)
func (*Client) PostWithoutResult ¶
func (c *Client) PostWithoutResult(cr *ClientRequest) *Error
func (*Client) Put ¶
func (c *Client) Put(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"` ExpirationDuration int `json:"expiration_duration,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` }
type CouponExpiration ¶
type CouponExpiration string
const ( CouponExpirationTimeLimit CouponExpiration = "time_limit" CouponExpirationNoExpiration CouponExpiration = "no_expiration" )
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"` ExpirationDuration int `json:"expiration_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(applyCouponInput *ApplyCouponInput) (*AppliedCoupon, *Error)
func (*CouponRequest) Create ¶
func (cr *CouponRequest) Create(couponInput *CouponInput) (*Coupon, *Error)
func (*CouponRequest) GetList ¶
func (cr *CouponRequest) GetList(couponListInput *CouponListInput) (*CouponResult, *Error)
func (*CouponRequest) Update ¶
func (cr *CouponRequest) Update(couponInput *CouponInput) (*Coupon, *Error)
type CouponResult ¶
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"` VatRate float32 `json:"vat_rate,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"` }
type CustomerBillingConfigurationInput ¶
type CustomerBillingConfigurationInput struct { PaymentProvider CustomerPaymentProvider `json:"payment_provider,omitempty"` ProviderCustomerID string `json:"provider_customer_id,omitempty"` Sync bool `json:"sync,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"` BillingConfiguration CustomerBillingConfigurationInput `json:"billing_configuration,omitempty"` VatRate float32 `json:"vat_rate,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(customerInput *CustomerInput) (*Customer, *Error)
func (*CustomerRequest) CurrentUsage ¶
func (cr *CustomerRequest) CurrentUsage(externalCustomerID string) (*CustomerUsage, *Error)
func (*CustomerRequest) Get ¶
func (cr *CustomerRequest) Get(externalCustomerID string) (*Customer, *Error)
func (*CustomerRequest) GetList ¶
func (cr *CustomerRequest) GetList(customerListInput *CustomerListInput) (*CustomerResult, *Error)
func (*CustomerRequest) Update ¶
func (cr *CustomerRequest) Update(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 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(eventInput *EventInput) *Error
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"` Subscription *Subscription `json:"subscription,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"` }
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) Download ¶
func (ir *InvoiceRequest) Download(invoiceID string) (*Invoice, *Error)
func (*InvoiceRequest) GetList ¶
func (ir *InvoiceRequest) GetList(invoiceListInput *InvoiceListInput) (*InvoiceResult, *Error)
func (*InvoiceRequest) Update ¶
func (ir *InvoiceRequest) Update(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"` CreatedAt time.Time `json:"created_at,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"` VatRate float32 `json:"vat_rate,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(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"` }
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(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"` PlanCode string `json:"plan_code"` Status SubscriptionStatus `json:"status"` BillingTime BillingTime `json:"billing_time"` SubscriptionDate string `json:"subscription_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"` BillingTime BillingTime `json:"billing_time,omitempty"` }
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(subscriptionInput *SubscriptionInput) (*Subscription, *Error)
func (*SubscriptionRequest) GetList ¶
func (sr *SubscriptionRequest) GetList(subscriptionListInput SubscriptionListInput) (*SubscriptionResult, *Error)
func (*SubscriptionRequest) Terminate ¶
func (sr *SubscriptionRequest) Terminate(externalCustomerID 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(walletInput *WalletInput) (*Wallet, *Error)
func (*WalletRequest) GetList ¶
func (bmr *WalletRequest) GetList(walletListInput *WalletListInput) (*WalletResult, *Error)
func (*WalletRequest) Update ¶
func (bmr *WalletRequest) Update(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(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.