lago

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 13 Imported by: 3

README

Lago Go Client

This is a Go wrapper for Lago API

Installation

go get github.com/getlago/lago-go-client@v1

Usage

Check the lago API reference

Development

  • Fork the repository
  • Open a Pull Request

Documentation

The Lago documentation is available at doc.getlago.com.

Contributing

The contribution documentation is available here

License

Lago Go client is distributed under MIT license.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorTypeAssert = Error{
	Err:            errors.New("type assertion failed"),
	HTTPStatusCode: http.StatusUnprocessableEntity,
	Message:        "Type assertion failed",
}

Functions

This section is empty.

Types

type AddOn

type AddOn struct {
	LagoID             uuid.UUID `json:"lago_id,omitempty"`
	Name               string    `json:"name,omitempty"`
	InvoiceDisplayName string    `json:"invoice_display_name,omitempty"`
	Code               string    `json:"code,omitempty"`
	Description        string    `json:"description,omitempty"`

	AmountCents    int      `json:"amount_cents,omitempty"`
	AmountCurrency Currency `json:"amount_currency,omitempty"`

	Taxes []Tax `json:"tax,omitempty"`

	CreatedAt time.Time `json:"created_at,omitempty"`
}

type AddOnInput

type AddOnInput struct {
	Name               string `json:"name,omitempty"`
	InvoiceDisplayName string `json:"invoice_display_name,omitempty"`
	Code               string `json:"code,omitempty"`
	Description        string `json:"description,omitempty"`

	AmountCents    int      `json:"amount_cents,omitempty"`
	AmountCurrency Currency `json:"amount_currency,omitempty"`

	TaxCodes []string `json:"tax_codes,omitempty"`
}

type AddOnListInput

type AddOnListInput struct {
	PerPage int `json:"per_page,omitempty,string"`
	Page    int `json:"page,omitempty,string"`
}

type AddOnParams

type AddOnParams struct {
	AddOn *AddOnInput `json:"add_on"`
}

type AddOnRequest

type AddOnRequest struct {
	// contains filtered or unexported fields
}

func (*AddOnRequest) Create

func (adr *AddOnRequest) Create(ctx context.Context, addOnInput *AddOnInput) (*AddOn, *Error)

func (*AddOnRequest) Delete

func (adr *AddOnRequest) Delete(ctx context.Context, addOnCode string) (*AddOn, *Error)

func (*AddOnRequest) Get

func (adr *AddOnRequest) Get(ctx context.Context, addOnCode string) (*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 AddOnResult struct {
	AddOn  *AddOn   `json:"add_on,omitempty"`
	AddOns []AddOn  `json:"add_ons,omitempty"`
	Meta   Metadata `json:"meta,omitempty"`
}

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"
	WeightedSumAggregation    AggregationType = "weighted_sum_agg"
)

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"`
	Status             AppliedCouponStatus `json:"status,omitempty"`

	CouponName     string   `json:"coupon_name,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    float64         `json:"percentage_rate,omitempty,string"`
	Frequency         CouponFrequency `json:"frequency,omitempty"`
	FrequencyDuration int             `json:"frequency_duration,omitempty"`

	AmountCentsRemaining       int `json:"amount_cents_remaining,omitempty"`
	FrequencyDurationRemaining int `json:"frequency_duration_remaining,omitempty"`

	Credits []InvoiceCredit `json:"credits,omitempty"`
}

type AppliedCouponListInput

type AppliedCouponListInput struct {
	PerPage            int                 `json:"per_page,omitempty,string"`
	Page               int                 `json:"page,omitempty,string"`
	Status             AppliedCouponStatus `json:"status,omitempty"`
	ExternalCustomerID string              `json:"external_customer_id,omitempty"`
}

type AppliedCouponRequest

type AppliedCouponRequest struct {
	// contains filtered or unexported fields
}

func (*AppliedCouponRequest) AppliedCouponDelete

func (acr *AppliedCouponRequest) AppliedCouponDelete(ctx context.Context, externalCustomerID string, appliedCouponID string) (*AppliedCoupon, *Error)

func (*AppliedCouponRequest) GetList

func (cr *AppliedCouponRequest) GetList(ctx context.Context, appliedCouponListInput *AppliedCouponListInput) (*AppliedCouponResult, *Error)

type AppliedCouponResult

type AppliedCouponResult struct {
	AppliedCoupon  *AppliedCoupon  `json:"applied_coupon,omitempty"`
	AppliedCoupons []AppliedCoupon `json:"applied_coupons,omitempty"`
	Meta           Metadata        `json:"meta,omitempty"`
}

type AppliedCouponStatus

type AppliedCouponStatus string
const (
	AppliedCouponStatusActive     AppliedCouponStatus = "active"
	AppliedCouponStatusTerminated AppliedCouponStatus = "terminated"
)

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     float64         `json:"percentage_rate,omitempty,string"`
	Frequency          CouponFrequency `json:"frequency,omitempty"`
	FrequencyDuration  int             `json:"frequency_duration,omitempty"`
}

type ApplyCouponParams

type ApplyCouponParams struct {
	AppliedCoupon *ApplyCouponInput `json:"applied_coupon"`
}

type BatchEventParams

type BatchEventParams struct {
	Events *[]EventInput `json:"events"`
}

type BatchEventResult

type BatchEventResult struct {
	Events *[]Event `json:"events"`
}

type BillableMetric

type BillableMetric struct {
	LagoID                   uuid.UUID              `json:"lago_id"`
	Name                     string                 `json:"name,omitempty"`
	Code                     string                 `json:"code,omitempty"`
	Description              string                 `json:"description,omitempty"`
	Recurring                bool                   `json:"recurring,omitempty"`
	AggregationType          AggregationType        `json:"aggregation_type,omitempty"`
	FieldName                string                 `json:"field_name"`
	CreatedAt                time.Time              `json:"created_at,omitempty"`
	WeightedInterval         *WeightedInterval      `json:"weighted_interval,omitempty"`
	Group                    map[string]interface{} `json:"group,omitempty"`
	Filters                  []BillableMetricFilter `json:"filters,omitempty"`
	ActiveSubscriptionsCount int                    `json:"active_subscriptions_count,omitempty"`
	DraftInvoicesCount       int                    `json:"draft_invoices_count,omitempty"`
	PlansCount               int                    `json:"plans_count,omitempty"`
}

type BillableMetricFilter added in v1.2.0

type BillableMetricFilter struct {
	Key    string   `json:"key,omitempty"`
	Values []string `json:"values,omitempty"`
}

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"`
	Recurring        bool                   `json:"recurring,omitempty"`
	FieldName        string                 `json:"field_name"`
	WeightedInterval WeightedInterval       `json:"weighted_interval,omitempty"`
	Group            map[string]interface{} `json:"group,omitempty"`
	Filters          []BillableMetricFilter `json:"filters,omitempty"`
}

type BillableMetricListInput

type BillableMetricListInput struct {
	PerPage int `json:"per_page,omitempty,string"`
	Page    int `json:"page,omitempty,string"`
}

type BillableMetricParams

type BillableMetricParams struct {
	BillableMetricInput *BillableMetricInput `json:"billable_metric,omitempty"`
}

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"`
	BillableMetricCode   string                 `json:"billable_metric_code,omitempty"`
	ChargeModel          ChargeModel            `json:"charge_model,omitempty"`
	CreatedAt            time.Time              `json:"created_at,omitempty"`
	PayInAdvance         bool                   `json:"pay_in_advance,omitempty"`
	Invoiceable          bool                   `json:"invoiceable,omitempty"`
	InvoiceDisplayName   string                 `json:"invoice_display_name,omitempty"`
	Prorated             bool                   `json:"prorated,omitempty"`
	MinAmountCents       int                    `json:"min_amount_cents,omitempty"`
	Properties           map[string]interface{} `json:"properties,omitempty"`
	GroupProperties      []GroupProperties      `json:"group_properties,omitempty"`
	Filters              []ChargeFilter         `json:"filters,omitempty"`

	Taxes []Tax `json:"tax,omitempty"`
}

type ChargeFilter added in v1.2.0

type ChargeFilter struct {
	InvoiceDisplayName string                 `json:"invoice_display_name,omitempty"`
	Properties         map[string]interface{} `json:"properties,omitempty"`
	Values             map[string]interface{} `json:"values,omitempty"`
}

type ChargeModel

type ChargeModel string
const (
	StandardChargeModel            ChargeModel = "standard"
	GraduatedChargeModel           ChargeModel = "graduated"
	GraduatedPercentageChargeModel ChargeModel = "graduated_percentage"
	PackageChargeModel             ChargeModel = "package"
	PercentageChargeModel          ChargeModel = "percentage"
	VolumeChargeModel              ChargeModel = "volume"
)

type ChargeOverridesInput

type ChargeOverridesInput struct {
	ID                 *uuid.UUID             `json:"id,omitempty"`
	AmountCurrency     Currency               `json:"amount_currency,omitempty"`
	InvoiceDisplayName string                 `json:"invoice_display_name,omitempty"`
	MinAmountCents     int                    `json:"min_amount_cents,omitempty"`
	Properties         map[string]interface{} `json:"properties"`
	GroupProperties    []GroupProperties      `json:"group_properties,omitempty"`
	Filters            []ChargeFilter         `json:"filters,omitempty"`
	TaxCodes           []string               `json:"tax_codes,omitempty"`
}

type Client

type Client struct {
	Debug      bool
	HttpClient *resty.Client
}

func New

func New() *Client

func (*Client) AddOn

func (c *Client) AddOn() *AddOnRequest

func (*Client) AppliedCoupon

func (c *Client) AppliedCoupon() *AppliedCouponRequest

func (*Client) BillableMetric

func (c *Client) BillableMetric() *BillableMetricRequest

func (*Client) Coupon

func (c *Client) Coupon() *CouponRequest

func (*Client) CreditNote

func (c *Client) CreditNote() *CreditNoteRequest

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) Fee

func (c *Client) Fee() *FeeRequest

func (*Client) Get

func (c *Client) Get(ctx context.Context, cr *ClientRequest) (interface{}, *Error)

func (*Client) GrossRevenue

func (c *Client) GrossRevenue() *GrossRevenueRequest

func (*Client) Group

func (c *Client) Group() *GroupRequest

func (*Client) Invoice

func (c *Client) Invoice() *InvoiceRequest

func (*Client) InvoiceCollection

func (c *Client) InvoiceCollection() *InvoiceCollectionRequest

func (*Client) InvoicedUsage

func (c *Client) InvoicedUsage() *InvoicedUsageRequest

func (*Client) Mrr

func (c *Client) Mrr() *MrrRequest

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) SetApiKey

func (c *Client) SetApiKey(apiKey string) *Client

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(url string) *Client

func (*Client) SetDebug

func (c *Client) SetDebug(debug bool) *Client

func (*Client) Subscription

func (c *Client) Subscription() *SubscriptionRequest

func (*Client) Tax

func (c *Client) Tax() *TaxRequest

func (*Client) Wallet

func (c *Client) Wallet() *WalletRequest

func (*Client) WalletTransaction

func (c *Client) WalletTransaction() *WalletTransactionRequest

func (*Client) Webhook

func (c *Client) Webhook() *WebhookRequest

func (*Client) WebhookEndpoint

func (c *Client) WebhookEndpoint() *WebhookEndpointRequest

type ClientRequest

type ClientRequest struct {
	Path        string
	QueryParams map[string]string
	Result      interface{}
	Body        interface{}
}

type Coupon

type Coupon 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"`
	Expiration             CouponExpiration      `json:"expiration,omitempty"`
	ExpirationAt           *time.Time            `json:"expiration_at,omitempty"`
	PercentageRate         float64               `json:"percentage_rate,omitempty,string"`
	CouponType             CouponCalculationType `json:"coupon_type,omitempty"`
	Frequency              CouponFrequency       `json:"frequency,omitempty"`
	Reusable               bool                  `json:"reusable,omitempty"`
	LimitedPlans           bool                  `json:"limited_plans,omitempty"`
	PlanCodes              []string              `json:"plan_codes,omitempty"`
	LimitedBillableMetrics bool                  `json:"limited_billable_metrics,omitempty"`
	BillableMetricCodes    []string              `json:"billable_metric_codes,omitempty"`
	FrequencyDuration      int                   `json:"frequency_duration,omitempty"`
	CreatedAt              time.Time             `json:"created_at,omitempty"`
	TerminatedAt           *time.Time            `json:"terminated_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"`
	Description       string                `json:"description,omitempty"`
	AmountCents       int                   `json:"amount_cents,omitempty"`
	AmountCurrency    Currency              `json:"amount_currency,omitempty"`
	Expiration        CouponExpiration      `json:"expiration,omitempty"`
	ExpirationAt      *time.Time            `json:"expiration_at,omitempty"`
	PercentageRate    float64               `json:"percentage_rate,omitempty,string"`
	CouponType        CouponCalculationType `json:"coupon_type,omitempty"`
	Frequency         CouponFrequency       `json:"frequency,omitempty"`
	Reusable          bool                  `json:"reusable,omitempty"`
	FrequencyDuration int                   `json:"frequency_duration,omitempty"`
	AppliesTo         LimitationInput       `json:"applies_to,omitempty"`
}

type CouponListInput

type CouponListInput struct {
	PerPage int `json:"per_page,omitempty,string"`
	Page    int `json:"page,omitempty,string"`
}

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) Delete

func (cr *CouponRequest) Delete(ctx context.Context, couponCode string) (*Coupon, *Error)

func (*CouponRequest) Get

func (cr *CouponRequest) Get(ctx context.Context, couponCode string) (*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 CouponResult struct {
	Coupon  *Coupon  `json:"coupon,omitempty"`
	Coupons []Coupon `json:"coupons,omitempty"`
	Meta    Metadata `json:"meta,omitempty"`
}

type CreditListInput

type CreditListInput struct {
	PerPage            int    `json:"per_page,omitempty,string"`
	Page               int    `json:"page,omitempty,string"`
	ExternalCustomerID string `json:"external_customer_id,omitempty"`
}

type CreditNote

type CreditNote struct {
	LagoID        uuid.UUID        `json:"lago_id,omitempty"`
	SequentialID  int              `json:"sequential_id,omitempty"`
	Number        string           `json:"number,omitempty"`
	LagoInvoiceID uuid.UUID        `json:"lago_invoice_id,omitempty"`
	InvoiceNumber string           `json:"invoice_number,omitempty"`
	Reason        CreditNoteReason `json:"reason,omitempty"`

	CreditStatus CreditNoteCreditStatus `json:"credit_status,omitempty"`
	RefundStatus CreditNoteRefundStatus `json:"refund_status,omitempty"`

	Currency                          Currency `json:"currency,omitempty"`
	TotalAmountCents                  int      `json:"total_amount_cents,omitempty"`
	CreditAmountCents                 int      `json:"credit_amount_cents,omitempty"`
	BalanceAmountCents                int      `json:"balance_amount_cents,omitempty"`
	RefundAmountCents                 int      `json:"refund_amount_cents,omitempty"`
	TaxesAmountCents                  int      `json:"taxes_amount_cents,omitempty"`
	TaxesRate                         float32  `json:"taxes_rate,omitempty"`
	SubTotalExcludingTaxesAmountCents int      `json:"sub_total_excluding_taxes_amount_cents,omitempty"`
	CouponsAdjustmentAmountCents      int      `json:"coupons_adjustment_amount_cents,omitempty"`

	FileURL string `json:"file_url,omitempty"`

	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	Items []CreditNoteItem `json:"items,omitempty"`

	// Deprecated: Will be removed in the future
	TotalAmountCurrency               Currency `json:"total_amount_currency,omitempty"`
	CreditAmountCurrency              Currency `json:"credit_amount_currency,omitempty"`
	BalanceAmountCurrency             Currency `json:"balance_amount_currency,omitempty"`
	RefundAmountCurrency              Currency `json:"refund_amount_currency,omitempty"`
	VatAmountCents                    int      `json:"vat_amount_cents,omitempty"`
	VatAmountCurrency                 Currency `json:"vat_amount_currency,omitempty"`
	SubTotalVatExcludedAmountCents    int      `json:"sub_total_vat_excluded_amount_cents,omitempty"`
	SubTotalVatExcludedAmountCurrency Currency `json:"sub_total_vat_excluded_amount_currency,omitempty"`
}

type CreditNoteAppliedTax

type CreditNoteAppliedTax struct {
	LagoId           uuid.UUID `json:"lago_id,omitempty"`
	LagoCreditNoteId uuid.UUID `json:"lago_credit_note_id,omitempty"`
	LagoTaxId        uuid.UUID `json:"lago_tax_id,omitempty"`
	TaxName          string    `json:"tax_name,omitempty"`
	TaxCode          string    `json:"tax_code,omitempty"`
	TaxRate          float32   `json:"tax_rate,omitempty"`
	TaxDescription   string    `json:"tax_description,omitempty"`
	AmountCents      int       `json:"amount_cents,omitempty"`
	AmountCurrency   Currency  `json:"amount_currency,omitempty"`
	BaseAmountCents  int       `json:"base_amount_cents,omitempty"`
	CreatedAt        time.Time `json:"created_at,omitempty"`
}

type CreditNoteCreditStatus

type CreditNoteCreditStatus string
const (
	CreditNoteCreditStatusAvailable CreditNoteCreditStatus = "available"
	CreditNoteCreditStatusConsumed  CreditNoteCreditStatus = "consumed"
)

type CreditNoteEstimateInput

type CreditNoteEstimateInput struct {
	LagoInvoiceID uuid.UUID             `json:"invoice_id,omitempty"`
	Items         []CreditNoteItemInput `json:"items,omitempty"`
}

type CreditNoteEstimateParams

type CreditNoteEstimateParams struct {
	CreditNote *CreditNoteEstimateInput `json:"credit_note"`
}

type CreditNoteEstimated

type CreditNoteEstimated struct {
	LagoInvoiceID uuid.UUID `json:"lago_invoice_id,omitempty"`
	InvoiceNumber string    `json:"invoice_number,omitempty"`

	Currency                          Currency `json:"currency,omitempty"`
	MaxCreditableAmountCents          int      `json:"max_creditable_amount_cents,omitempty"`
	MaxRefundableAmountCents          int      `json:"max_refundable_amount_cents,omitempty"`
	TaxesAmountCents                  int      `json:"taxes_amount_cents,omitempty"`
	TaxesRate                         float32  `json:"taxes_rate,omitempty"`
	SubTotalExcludingTaxesAmountCents int      `json:"sub_total_excluding_taxes_amount_cents,omitempty"`
	CouponsAdjustmentAmountCents      int      `json:"coupons_adjustment_amount_cents,omitempty"`

	Items []CreditNoteEstimatedItem `json:"items,omitempty"`

	AppliedTaxes []CreditNoteEstimatedAppliedTax `json:"applied_taxes,omitempty"`
}

type CreditNoteEstimatedAppliedTax

type CreditNoteEstimatedAppliedTax struct {
	LagoTaxId      uuid.UUID `json:"lago_tax_id,omitempty"`
	TaxName        string    `json:"tax_name,omitempty"`
	TaxCode        string    `json:"tax_code,omitempty"`
	TaxRate        float32   `json:"tax_rate,omitempty"`
	TaxDescription string    `json:"tax_description,omitempty"`
	AmountCents    int       `json:"amount_cents,omitempty"`
	AmountCurrency Currency  `json:"amount_currency,omitempty"`
}

type CreditNoteEstimatedItem

type CreditNoteEstimatedItem struct {
	AmountCents int       `json:"amount_cents,omitempty"`
	LagoFeeID   uuid.UUID `json:"lago_fee_id,omitempty"`
}

type CreditNoteEstimatedResult

type CreditNoteEstimatedResult struct {
	CreditNoteEstimated *CreditNoteEstimated `json:"credit_note_estimated"`
}

type CreditNoteInput

type CreditNoteInput struct {
	LagoInvoiceID     uuid.UUID             `json:"invoice_id,omitempty"`
	Reason            CreditNoteReason      `json:"reason,omitempty"`
	Items             []CreditNoteItemInput `json:"items,omitempty"`
	CreditAmountCents int                   `json:"refund_amount_cents,omitempty"`
	RefundAmountCents int                   `json:"credit_amount_cents,omitempty"`
}

type CreditNoteItem

type CreditNoteItem struct {
	LagoID         uuid.UUID `json:"lago_id,omitempty"`
	AmountCents    int       `json:"amount_cents,omitempty"`
	AmountCurrency Currency  `json:"amount_currency,omitempty"`
	Fee            Fee       `json:"fee,omitempty"`
}

type CreditNoteItemInput

type CreditNoteItemInput struct {
	LagoFeeID   uuid.UUID `json:"fee_id,omitempty"`
	AmountCents int       `json:"amount_cents,omitempty"`
}

type CreditNoteParams

type CreditNoteParams struct {
	CreditNote *CreditNoteInput `json:"credit_note"`
}

type CreditNoteReason

type CreditNoteReason string
const (
	CreditNoteReasonDuplicatedCharge      CreditNoteReason = "duplicated_charge"
	CreditNoteReasonProductUnsatisfactory CreditNoteReason = "product_unsatisfactory"
	CreditNoteReasonOrderChange           CreditNoteReason = "order_change"
	CreditNoteReasonOrderCancellation     CreditNoteReason = "order_cancellation"
	CreditNoteReasonFraudulentCharge      CreditNoteReason = "fraudulent_charge"
	CreditNoteReasonOther                 CreditNoteReason = "other"
)

type CreditNoteRefundStatus

type CreditNoteRefundStatus string
const (
	CreditNoteRefundStatusPending  CreditNoteRefundStatus = "pending"
	CreditNoteRefundStatusRefunded CreditNoteRefundStatus = "refunded"
)

type CreditNoteRequest

type CreditNoteRequest struct {
	// contains filtered or unexported fields
}

func (*CreditNoteRequest) Create

func (cr *CreditNoteRequest) Create(ctx context.Context, creditNoteInput *CreditNoteInput) (*CreditNote, *Error)

func (*CreditNoteRequest) Download

func (cr *CreditNoteRequest) Download(ctx context.Context, creditNoteID string) (*CreditNote, *Error)

func (*CreditNoteRequest) Estimate

func (cr *CreditNoteRequest) Estimate(ctx context.Context, creditNoteEstimateInput *CreditNoteEstimateInput) (*CreditNoteEstimated, *Error)

func (*CreditNoteRequest) Get

func (cr *CreditNoteRequest) Get(ctx context.Context, creditNoteID uuid.UUID) (*CreditNote, *Error)

func (*CreditNoteRequest) GetList

func (cr *CreditNoteRequest) GetList(ctx context.Context, creditNoteListInput *CreditListInput) (*CreditNoteResult, *Error)

func (*CreditNoteRequest) Update

func (cr *CreditNoteRequest) Update(ctx context.Context, creditNoteUpdateInput *CreditNoteUpdateInput) (*CreditNote, *Error)

func (*CreditNoteRequest) Void

func (cr *CreditNoteRequest) Void(ctx context.Context, creditNoteID string) (*CreditNote, *Error)

type CreditNoteResult

type CreditNoteResult struct {
	CreditNote  *CreditNote  `json:"credit_note,omitempty"`
	CreditNotes []CreditNote `json:"credit_notes,omitempty"`
	Meta        Metadata     `json:"meta,omitempty"`
}

type CreditNoteUpdateInput

type CreditNoteUpdateInput struct {
	LagoID       string                 `json:"id,omitempty"`
	RefundStatus CreditNoteRefundStatus `json:"refund_status,omitempty"`
}

type CreditNoteUpdateParams

type CreditNoteUpdateParams struct {
	CreditNote *CreditNoteUpdateInput `json:"credit_note"`
}

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"`
	NetPaymentTerm          int                          `json:"net_payment_term,omitempty"`
	TaxIdentificationNumber string                       `json:"tax_identification_number,omitempty"`
	LogoURL                 string                       `json:"logo_url,omitempty"`
	Phone                   string                       `json:"phone,omitempty"`
	URL                     string                       `json:"url,omitempty"`
	BillingConfiguration    CustomerBillingConfiguration `json:"billing_configuration,omitempty"`
	Metadata                []MetadataResponse           `json:"metadata,omitempty"`
	Currency                Currency                     `json:"currency,omitempty"`
	Timezone                string                       `json:"timezone,omitempty"`
	ApplicableTimezone      string                       `json:"applicable_timezone,omitempty"`

	Taxes []Tax `json:"taxes,omitempty"`

	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

type CustomerBillingConfiguration

type CustomerBillingConfiguration struct {
	InvoiceGracePeriod  int                     `json:"invoice_grace_period,omitempty"`
	PaymentProvider     CustomerPaymentProvider `json:"payment_provider,omitempty"`
	PaymentProviderCode string                  `json:"payment_provider_code,omitempty"`
	ProviderCustomerID  string                  `json:"provider_customer_id,omitempty"`
	SyncWithProvider    bool                    `json:"sync_with_provider,omitempty"`
	DocumentLocale      string                  `json:"document_locale,omitempty"`
}

type CustomerBillingConfigurationInput

type CustomerBillingConfigurationInput struct {
	InvoiceGracePeriod  int                     `json:"invoice_grace_period,omitempty"`
	PaymentProvider     CustomerPaymentProvider `json:"payment_provider,omitempty"`
	PaymentProviderCode string                  `json:"payment_provider_code,omitempty"`
	ProviderCustomerID  string                  `json:"provider_customer_id,omitempty"`
	Sync                bool                    `json:"sync,omitempty"`
	SyncWithProvider    bool                    `json:"sync_with_provider,omitempty"`
	DocumentLocale      string                  `json:"document_locale,omitempty"`
}

type CustomerChargeFilterUsage added in v1.2.0

type CustomerChargeFilterUsage struct {
	InvoiceDisplayName string                 `json:"invoice_display_name,omitempty"`
	Values             map[string]interface{} `json:"value,omitempty"`
	AmountCents        int                    `json:"amount_cents,omitempty"`
	EventsCount        int                    `json:"events_count,omitempty"`
	Units              string                 `json:"units,omitempty"`
}

type CustomerChargeGroupdUsage

type CustomerChargeGroupdUsage struct {
	LagoId      uuid.UUID `json:"lago_id,omitempty"`
	Key         string    `json:"key,omitempty"`
	Value       string    `json:"value,omitempty"`
	AmountCents int       `json:"amount_cents,omitempty"`
	EventsCount int       `json:"events_count,omitempty"`
	Units       string    `json:"units,omitempty"`
}

type CustomerChargeGroupedUsage

type CustomerChargeGroupedUsage struct {
	AmountCents int                         `json:"amount_cents,omitempty"`
	EventsCount int                         `json:"events_count,omitempty"`
	Units       string                      `json:"units,omitempty"`
	GroupedBy   map[string]interface{}      `json:"grouped_by,omitempty"`
	Groups      []CustomerChargeGroupdUsage `json:"groups,omitempty"`
	Filters     []CustomerChargeFilterUsage `json:"filters,omitempty"`
}

type CustomerChargeUsage

type CustomerChargeUsage struct {
	Units          string   `json:"units,omitempty"`
	EventsCount    int      `json:"events_count"`
	AmountCents    int      `json:"amount_cents,omitempty"`
	AmountCurrency Currency `json:"amount_currency,omitempty"`

	Charge         *Charge                      `json:"charge,omitempty"`
	BillableMetric *BillableMetric              `json:"billable_metric,omitempty"`
	Groups         []CustomerChargeGroupdUsage  `json:"groups,omitempty"`
	Filters        []CustomerChargeFilterUsage  `json:"filters,omitempty"`
	GroupedUsage   []CustomerChargeGroupedUsage `json:"grouped_usage,omitempty"`
}

type CustomerCheckoutUrl

type CustomerCheckoutUrl struct {
	CheckoutUrl string `json:"checkout_url,omitempty"`
}

type CustomerCheckoutUrlResult

type CustomerCheckoutUrlResult struct {
	CustomerCheckoutUrl *CustomerCheckoutUrl `json:"customer"`
}

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_line1,omitempty"`
	AddressLine2            string                            `json:"address_line2,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"`
	NetPaymentTerm          int                               `json:"net_payment_term,omitempty"`
	TaxIdentificationNumber string                            `json:"tax_identification_number,omitempty"`
	Phone                   string                            `json:"phone,omitempty"`
	URL                     string                            `json:"url,omitempty"`
	Currency                Currency                          `json:"currency,omitempty"`
	Timezone                string                            `json:"timezone,omitempty"`
	Metadata                []CustomerMetadataInput           `json:"metadata,omitempty"`
	BillingConfiguration    CustomerBillingConfigurationInput `json:"billing_configuration,omitempty"`
	TaxCodes                []string                          `json:"tax_codes,omitempty"`
}

type CustomerListInput

type CustomerListInput struct {
	PerPage int `json:"per_page,omitempty,string"`
	Page    int `json:"page,omitempty,string"`
}

type CustomerMetadataInput

type CustomerMetadataInput struct {
	LagoID           *uuid.UUID `json:"id,omitempty"`
	Key              string     `json:"key,omitempty"`
	Value            string     `json:"value,omitempty"`
	DisplayInInvoice bool       `json:"display_in_invoice,omitempty"`
}

type CustomerParams

type CustomerParams struct {
	Customer *CustomerInput `json:"customer"`
}

type CustomerPastUsageInput

type CustomerPastUsageInput struct {
	ExternalSubscriptionID string `json:"external_subscription_id"`
	BillableMetricCode     string `json:"billable_metric_code,omitempty"`
	PeriodsCount           int    `json:"periods_count,omitempty"`
}

type CustomerPastUsageResult

type CustomerPastUsageResult struct {
	UsagePeriods []CustomerUsage `json:"usage_periods"`
	Meta         Metadata        `json:"metadata"`
}

type CustomerPaymentProvider

type CustomerPaymentProvider string
const (
	PaymentProviderAdyen      CustomerPaymentProvider = "adyen"
	PaymentProviderStripe     CustomerPaymentProvider = "stripe"
	PaymentProviderGocardless CustomerPaymentProvider = "gocardless"
)

type CustomerPortalUrl

type CustomerPortalUrl struct {
	PortalUrl string `json:"portal_url,omitempty"`
}

type CustomerPortalUrlResult

type CustomerPortalUrlResult struct {
	CustomerPortalUrl *CustomerPortalUrl `json:"customer"`
}

type CustomerRequest

type CustomerRequest struct {
	// contains filtered or unexported fields
}

func (*CustomerRequest) CheckoutUrl

func (cr *CustomerRequest) CheckoutUrl(ctx context.Context, externalCustomerID string) (*CustomerCheckoutUrl, *Error)

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, customerUsageInput *CustomerUsageInput) (*CustomerUsage, *Error)

func (*CustomerRequest) Delete

func (cr *CustomerRequest) Delete(ctx context.Context, externalCustomerID string) (*Customer, *Error)

func (*CustomerRequest) Get

func (cr *CustomerRequest) Get(ctx context.Context, externalCustomerID string) (*Customer, *Error)

func (*CustomerRequest) GetList

func (cr *CustomerRequest) GetList(ctx context.Context, customerListInput *CustomerListInput) (*CustomerResult, *Error)

func (*CustomerRequest) PastUsage

func (cr *CustomerRequest) PastUsage(ctx context.Context, externalCustomerID string, customerPastUsageInput *CustomerPastUsageInput) (*CustomerPastUsageResult, *Error)

func (*CustomerRequest) PortalUrl

func (cr *CustomerRequest) PortalUrl(ctx context.Context, externalCustomerID string) (*CustomerPortalUrl, *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 CustomerResult struct {
	Customer  *Customer  `json:"customer"`
	Customers []Customer `json:"customers,omitempty"`
	Meta      Metadata   `json:"metadata,omitempty"`
}

type CustomerUsage

type CustomerUsage struct {
	FromDatetime     time.Time `json:"from_datetime,omitempty"`
	ToDatetime       time.Time `json:"to_datetime,omitempty"`
	IssuingDate      string    `json:"issuing_date,omitempty"`
	LagoInvoiceID    string    `json:"lago_invoice_id,omitempty"`
	Currency         Currency  `json:"currency,omitempty"`
	AmountCents      int       `json:"amount_cents,omitempty"`
	TotalAmountCents int       `json:"total_amount_cents,omitempty"`
	TaxesAmountCents int       `json:"taxes_amount_cents,omitempty"`

	ChargesUsage []CustomerChargeUsage `json:"charges_usage,omitempty"`
}

type CustomerUsageInput

type CustomerUsageInput struct {
	ExternalSubscriptionID string `json:"external_subscription_id,omitempty"`
}

type CustomerUsageResult

type CustomerUsageResult struct {
	CustomerUsage *CustomerUsage `json:"customer_usage"`
}

type Error

type Error struct {
	Err error `json:"-"`

	HTTPStatusCode int    `json:"status"`
	Message        string `json:"error"`
	ErrorCode      string `json:"code"`

	ErrorDetail map[string][]string `json:"error_details,omitempty"`
}

type ErrorCode

type ErrorCode string
const (
	ErrorCodeAlreadyExist ErrorCode = "value_already_exist"
	ErrorCodeInvalidValue
)

func (ErrorCode) Error

func (e ErrorCode) Error() string

type Event

type Event struct {
	LagoID                 uuid.UUID              `json:"lago_id"`
	TransactionID          string                 `json:"transaction_id"`
	LagoCustomerID         *uuid.UUID             `json:"lago_customer_id,omitempty"`
	ExternalCustomerID     string                 `json:"external_customer_id,omitempty"`
	Code                   string                 `json:"code,omitempty"`
	Timestamp              time.Time              `json:"timestamp"`
	Properties             map[string]interface{} `json:"properties,omitempty"`
	LagoSubscriptionID     *uuid.UUID             `json:"lago_subscription_id,omitempty"`
	ExternalSubscriptionID string                 `json:"external_subscription_id,omitempty"`
	CreatedAt              time.Time              `json:"created_at"`
}

type EventEstimateFeesInput

type EventEstimateFeesInput struct {
	ExternalCustomerID     string            `json:"external_customer_id,omitempty"`
	ExternalSubscriptionID string            `json:"external_subscription_id,omitempty"`
	Code                   string            `json:"code,omitempty"`
	Properties             map[string]string `json:"properties,omitempty"`
}

type EventEstimateFeesParams

type EventEstimateFeesParams struct {
	Event *EventEstimateFeesInput `json:"event"`
}

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              string                 `json:"timestamp,omitempty"`
	Properties             map[string]interface{} `json:"properties,omitempty"`
}

type EventParams

type EventParams struct {
	Event *EventInput `json:"event"`
}

type EventRequest

type EventRequest struct {
	// contains filtered or unexported fields
}

func (*EventRequest) Batch

func (er *EventRequest) Batch(ctx context.Context, batchInput *[]EventInput) (*[]Event, *Error)

func (*EventRequest) Create

func (er *EventRequest) Create(ctx context.Context, eventInput *EventInput) (*Event, *Error)

func (*EventRequest) EstimateFees

func (er *EventRequest) EstimateFees(ctx context.Context, estimateInput EventEstimateFeesInput) (*FeeResult, *Error)

func (*EventRequest) Get

func (er *EventRequest) Get(ctx context.Context, eventID string) (*Event, *Error)

type EventResult

type EventResult struct {
	Event *Event `json:"event"`
}

type Fee

type Fee struct {
	LagoID                 uuid.UUID `json:"lago_id,omitempty"`
	LagoGroupID            uuid.UUID `json:"lago_group_id,omitempty"`
	LagoChargeFilterID     uuid.UUID `json:"lago_charge_filter_id,omitempty"`
	LagoInvoiceID          uuid.UUID `json:"lago_invoice_id,omitempty"`
	LagoTrueUpFeeID        uuid.UUID `json:"lago_true_up_fee_id,omitempty"`
	LagoTrueUpParentFeeID  uuid.UUID `json:"lago_true_up_parent_fee_id,omitempty"`
	ExternalSubscriptionID string    `json:"external_subscription_id,omitempty"`

	AmountCents         int                    `json:"amount_cents,omitempty"`
	AmountDetails       map[string]interface{} `json:"amount_details,omitempty"`
	UnitAmountCents     int                    `json:"unit_amount_cents,omitempty"` // deprecated
	PreciseUnitAmount   string                 `json:"precise_unit_amount,omitempty"`
	AmountCurrency      string                 `json:"amount_currency,omitempty"`
	TaxesAmountCents    int                    `json:"taxes_amount_cents,omitempty"`
	TaxesRate           float32                `json:"taxes_rate,omitempty"`
	TotalAmountCents    int                    `json:"total_amount_cents,omitempty"`
	TotalAmountCurrency string                 `json:"total_amount_currency,omitempty"`
	PayInAdvance        bool                   `json:"pay_in_advance,omitempty"`
	Invoiceable         bool                   `json:"invoiceable,omitempty"`
	FromDate            string                 `json:"from_date,omitempty"`
	ToDate              string                 `json:"to_date,omitempty"`
	InvoiceDisplayName  string                 `json:"invoice_display_name,omitempty"`

	Units       string `json:"units,omitempty"`
	Description string `json:"description,omitempty"`
	EventsCount int    `json:"events_count,omitempty"`

	PaymentStatus FeePaymentStatus `json:"payment_status,omitempty"`

	CreatedAt   time.Time `json:"created_at,omitempty"`
	SucceededAt time.Time `json:"succeeded_at,omitempty"`
	FailedAt    time.Time `json:"failed_at,omitempty"`
	RefundedAt  time.Time `json:"refunded_at,omitempty"`

	Item         FeeItem         `json:"item,omitempty"`
	AppliedTaxes []FeeAppliedTax `json:"applied_taxes,omitempty"`
}

type FeeAppliedTax

type FeeAppliedTax struct {
	LagoId         uuid.UUID `json:"lago_id,omitempty"`
	LagoFeeId      uuid.UUID `json:"lago_fee_id,omitempty"`
	LagoTaxId      uuid.UUID `json:"lago_tax_id,omitempty"`
	TaxName        string    `json:"tax_name,omitempty"`
	TaxCode        string    `json:"tax_code,omitempty"`
	TaxRate        float32   `json:"tax_rate,omitempty"`
	TaxDescription string    `json:"tax_description,omitempty"`
	AmountCents    int       `json:"amount_cents,omitempty"`
	AmountCurrency Currency  `json:"amount_currency,omitempty"`
	CreatedAt      time.Time `json:"created_at,omitempty"`
}

type FeeItem

type FeeItem struct {
	Type                     FeeType                `json:"type,omitempty"`
	Code                     string                 `json:"code,omitempty"`
	Name                     string                 `json:"name,omitempty"`
	InvoiceDisplayName       string                 `json:"invoice_display_name,omitempty"`
	GroupInvoiceDisplayName  string                 `json:"group_invoice_display_name,omitempty"`
	FilterInvoiceDisplayName string                 `json:"filter_invoice_display_name,omitempty"`
	Filters                  map[string]interface{} `json:"filters,omitempty"`
	LagoItemID               uuid.UUID              `json:"lago_item_id,omitempty"`
	ItemType                 FeeItemType            `json:"item_type,omitempty"`
	GroupedBy                map[string]interface{} `json:"grouped_by,omitempty"`
}

type FeeItemType

type FeeItemType string
const (
	FeeAddOnType         FeeItemType = "AddOn"
	FeeBillableMetric    FeeItemType = "BillableMetric"
	FeeSubscription      FeeItemType = "Subscription"
	FeeWalletTransaction FeeItemType = "WalletTransaction"
)

type FeeListInput

type FeeListInput struct {
	PerPage int `json:"per_page,omitempty,string"`
	Page    int `json:"page,omitempty,string"`

	FeeType       FeeType          `json:"fee_type,omitempty"`
	PaymentStatus FeePaymentStatus `json:"payment_status,omitempty"`

	ExternalSubscriptionID string `json:"external_subscription_id,omitempty"`
	ExternalCustomerID     string `json:"external_customer_id,omitempty"`

	BillableMetricCode string `json:"billable_metric_code,omitempty"`

	Currency Currency `json:"currency"`

	CreatedAtFrom   string `json:"created_at_from,omitempty"`
	CreatedAtTo     string `json:"created_at_to,omitempty"`
	FailedAtFrom    string `json:"failed_at_from,omitempty"`
	FailedAtTo      string `json:"failed_at_to,omitempty"`
	SucceededAtFrom string `json:"succeeded_at_from,omitempty"`
	SucceededAtTo   string `json:"succeeded_at_to,omitempty"`
	RefundedAtFrom  string `json:"refunded_at_from,omitempty"`
	RefundedAtTo    string `json:"refunded_at_to,omitempty"`
}

type FeePaymentStatus

type FeePaymentStatus string
const (
	FeePaymentStatusPending   FeePaymentStatus = "pending"
	FeePaymentStatusSucceeded FeePaymentStatus = "succeeded"
	FeePaymentStatusFailed    FeePaymentStatus = "failed"
	FeePaymentStatusRefunded  FeePaymentStatus = "refunded"
)

type FeeRequest

type FeeRequest struct {
	// contains filtered or unexported fields
}

func (*FeeRequest) Get

func (fr *FeeRequest) Get(ctx context.Context, feeID string) (*Fee, *Error)

func (*FeeRequest) GetList

func (fr *FeeRequest) GetList(ctx context.Context, feeListInput *FeeListInput) (*FeeResult, *Error)

func (*FeeRequest) Update

func (fr *FeeRequest) Update(ctx context.Context, feeInput *FeeUpdateInput) (*Fee, *Error)

type FeeResult

type FeeResult struct {
	Fee  *Fee     `json:"fee,omitempty"`
	Fees []Fee    `json:"fees,omitempty"`
	Meta Metadata `json:"meta,omitempty"`
}

type FeeType

type FeeType string
const (
	FeeItemSubscription FeeType = "subscription"
	FeeItemCharge       FeeType = "charge"
	FeeItemAddOn        FeeType = "add_on"
)

type FeeUpdateInput

type FeeUpdateInput struct {
	LagoID        uuid.UUID        `json:"lago_id,omitempty"`
	PaymentStatus FeePaymentStatus `json:"payment_status,omitempty"`
}

type FeeUpdateParams

type FeeUpdateParams struct {
	Fee *FeeUpdateInput `json:"fee"`
}

type GrossRevenue

type GrossRevenue struct {
	Month          string   `json:"month,omitempty"`
	AmountCents    int      `json:"amount_cents,omitempty"`
	AmountCurrency Currency `json:"currency,omitempty"`
}

type GrossRevenueListInput

type GrossRevenueListInput struct {
	AmountCurrency     string `json:"currency,omitempty,string"`
	ExternalCustomerId string `json:"external_customer_id,omitempty,string"`
	Months             int    `json:"months,omitempty,string"`
}

type GrossRevenueRequest

type GrossRevenueRequest struct {
	// contains filtered or unexported fields
}

func (*GrossRevenueRequest) GetList

func (adr *GrossRevenueRequest) GetList(ctx context.Context, GrossRevenueListInput *GrossRevenueListInput) (*GrossRevenueResult, *Error)

type GrossRevenueResult

type GrossRevenueResult struct {
	GrossRevenue  *GrossRevenue  `json:"gross_revenue,omitempty"`
	GrossRevenues []GrossRevenue `json:"gross_revenues,omitempty"`
}

type Group

type Group struct {
	LagoID uuid.UUID `json:"lago_id,omitempty"`
	Key    string    `json:"key,omitempty"`
	Value  string    `json:"value,omitempty"`
}

type GroupListInput

type GroupListInput struct {
	PerPage int    `json:"per_page,omitempty,string"`
	Page    int    `json:"page,omitempty,string"`
	Code    string `json:"code,omitempty"`
}

type GroupProperties

type GroupProperties struct {
	GroupID            uuid.UUID              `json:"group_id"`
	Values             map[string]interface{} `json:"values"`
	InvoiceDisplayName string                 `json:"invoice_display_name,omitempty"`
}

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 GroupResult struct {
	Groups []Group  `json:"groups,omitempty"`
	Meta   Metadata `json:"meta,omitempty"`
}

type Invoice

type Invoice struct {
	LagoID       uuid.UUID `json:"lago_id,omitempty"`
	SequentialID int       `json:"sequential_id,omitempty"`
	Number       string    `json:"number,omitempty"`

	IssuingDate          string    `json:"issuing_date,omitempty"`
	PaymentDisputeLostAt time.Time `json:"payment_dispute_lost_at,omitempty"`
	PaymentDueDate       string    `json:"payment_due_date,omitempty"`

	InvoiceType   InvoiceType          `json:"invoice_type,omitempty"`
	Status        InvoiceStatus        `json:"status,omitempty"`
	PaymentStatus InvoicePaymentStatus `json:"payment_status,omitempty"`

	Currency Currency `json:"currency,omitempty"`

	FeesAmountCents                   int `json:"fees_amount_cents,omitempty"`
	TaxesAmountCents                  int `json:"taxes_amount_cents,omitempty"`
	CouponsAmountCents                int `json:"coupons_amount_cents,omitempty"`
	CreditNotesAmountCents            int `json:"credit_notes_amount_cents,omitempty"`
	SubTotalExcludingTaxesAmountCents int `json:"sub_total_excluding_taxes_amount_cents,omitempty"`
	SubTotalIncludingTaxesAmountCents int `json:"sub_total_including_taxes_amount_cents,omitempty"`
	TotalAmountCents                  int `json:"total_amount_cents,omitempty"`
	PrepaidCreditAmountCents          int `json:"prepaid_credit_amount_cents,omitempty"`
	NetPaymentTerm                    int `json:"net_payment_term,omitempty"`

	FileURL       string                    `json:"file_url,omitempty"`
	Metadata      []InvoiceMetadataResponse `json:"metadata,omitempty"`
	VersionNumber int                       `json:"version_number,omitempty"`

	Customer      *Customer      `json:"customer,omitempty"`
	Subscriptions []Subscription `json:"subscriptions,omitempty"`

	Fees         []Fee               `json:"fees,omitempty"`
	Credits      []InvoiceCredit     `json:"credits,omitempty"`
	AppliedTaxes []InvoiceAppliedTax `json:"applied_taxes,omitempty"`

	// Deprecated: Will be removed in the future
	Legacy                         bool     `json:"legacy,omitempty"`
	AmountCurrency                 Currency `json:"amount_currency,omitempty"`
	AmountCents                    int      `json:"amount_cents,omitempty"`
	CreditAmountCents              int      `json:"credit_amount_cents,omitempty"`
	CreditAmountCurrency           Currency `json:"credit_amount_currency,omitempty"`
	TotalAmountCurrency            Currency `json:"total_amount_currency,omitempty"`
	VatAmountCents                 int      `json:"vat_amount_cents,omitempty"`
	VatAmountCurrency              Currency `json:"vat_amount_currency,omitempty"`
	SubTotalVatExcludedAmountCents int      `json:"sub_total_vat_excluded_amount_cents,omitempty"`
	SubTotalVatIncludedAmountCents int      `json:"sub_total_vat_included_amount_cents,omitempty"`
}

type InvoiceAppliedTax

type InvoiceAppliedTax struct {
	LagoId          uuid.UUID `json:"lago_id,omitempty"`
	LagoInvoiceId   uuid.UUID `json:"lago_invoice_id,omitempty"`
	LagoTaxId       uuid.UUID `json:"lago_tax_id,omitempty"`
	TaxName         string    `json:"tax_name,omitempty"`
	TaxCode         string    `json:"tax_code,omitempty"`
	TaxRate         float32   `json:"tax_rate,omitempty"`
	TaxDescription  string    `json:"tax_description,omitempty"`
	AmountCents     int       `json:"amount_cents,omitempty"`
	AmountCurrency  Currency  `json:"amount_currency,omitempty"`
	FeesAmountCents int       `json:"fees_amount_cents,omitempty"`
	CreatedAt       time.Time `json:"created_at,omitempty"`
}

type InvoiceCollection

type InvoiceCollection struct {
	Month          string               `json:"month,omitempty"`
	PaymentStatus  InvoicePaymentStatus `json:"payment_status,omitempty"`
	InvoicesCount  int                  `json:"invoices_count,omitempty"`
	AmountCents    int                  `json:"amount_cents,omitempty"`
	AmountCurrency Currency             `json:"currency,omitempty"`
}

type InvoiceCollectionListInput

type InvoiceCollectionListInput struct {
	AmountCurrency string `json:"currency,omitempty,string"`
	Months         int    `json:"months,omitempty,string"`
}

type InvoiceCollectionRequest

type InvoiceCollectionRequest struct {
	// contains filtered or unexported fields
}

func (*InvoiceCollectionRequest) GetList

func (adr *InvoiceCollectionRequest) GetList(ctx context.Context, InvoiceCollectionListInput *InvoiceCollectionListInput) (*InvoiceCollectionResult, *Error)

type InvoiceCollectionResult

type InvoiceCollectionResult struct {
	InvoiceCollection  *InvoiceCollection  `json:"invoice_collection,omitempty"`
	InvoiceCollections []InvoiceCollection `json:"invoice_collections,omitempty"`
}

type InvoiceCredit

type InvoiceCredit struct {
	Item InvoiceCreditItem `json:"item,omitempty"`

	Invoice InvoiceSummary `json:"invoice,omitempty"`

	LagoID         uuid.UUID `json:"lago_id,omitempty"`
	AmountCents    int       `json:"amount_cents,omitempty"`
	AmountCurrency Currency  `json:"amount_currency,omitempty"`
	BeforeVAT      bool      `json:"before_vat,omitempty"`
}

type InvoiceCreditItem

type InvoiceCreditItem struct {
	LagoID uuid.UUID             `json:"lago_id,omitempty"`
	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 InvoiceFeesInput

type InvoiceFeesInput struct {
	AddOnCode          string   `json:"add_on_code,omitempty"`
	InvoiceDisplayName string   `json:"invoice_display_name,omitempty"`
	UnitAmountCents    int      `json:"unit_amount_cents,omitempty"`
	Description        string   `json:"description,omitempty"`
	Units              float32  `json:"units,omitempty"`
	TaxCodes           []string `json:"tax_codes,omitempty"`
}

type InvoiceInput

type InvoiceInput struct {
	LagoID        uuid.UUID              `json:"lago_id,omitempty"`
	PaymentStatus InvoicePaymentStatus   `json:"payment_status,omitempty"`
	Metadata      []InvoiceMetadataInput `json:"metadata,omitempty"`
}

type InvoiceListInput

type InvoiceListInput struct {
	PerPage int `json:"per_page,omitempty,string"`
	Page    int `json:"page,omitempty,string"`

	IssuingDateFrom string `json:"issuing_date_from,omitempty"`
	IssuingDateTo   string `json:"issuing_date_to,omitempty"`

	ExternalCustomerID string               `json:"external_customer_id,omitempty"`
	Status             InvoiceStatus        `json:"status,omitempty"`
	PaymentStatus      InvoicePaymentStatus `json:"payment_status,omitempty"`
}

type InvoiceMetadataInput

type InvoiceMetadataInput struct {
	LagoID *uuid.UUID `json:"id,omitempty"`
	Key    string     `json:"key,omitempty"`
	Value  string     `json:"value,omitempty"`
}

type InvoiceMetadataResponse

type InvoiceMetadataResponse struct {
	LagoID    uuid.UUID `json:"lago_id,omitempty"`
	Key       string    `json:"key,omitempty"`
	Value     string    `json:"value,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
}

type InvoiceOneOffInput

type InvoiceOneOffInput struct {
	ExternalCustomerId string             `json:"external_customer_id,omitempty"`
	Currency           string             `json:"currency,omitempty"`
	Fees               []InvoiceFeesInput `json:"fees,omitempty"`
}

type InvoiceOneOffParams

type InvoiceOneOffParams struct {
	Invoice *InvoiceOneOffInput `json:"invoice"`
}

type InvoiceParams

type InvoiceParams struct {
	Invoice *InvoiceInput `json:"invoice"`
}

type InvoicePaymentStatus

type InvoicePaymentStatus string
const (
	InvoicePaymentStatusPending   InvoicePaymentStatus = "pending"
	InvoicePaymentStatusSucceeded InvoicePaymentStatus = "succeeded"
	InvoicePaymentStatusFailed    InvoicePaymentStatus = "failed"
)

type InvoicePaymentUrl

type InvoicePaymentUrl struct {
	PaymentUrl string `json:"payment_url,omitempty"`
}

type InvoicePaymentUrlResult

type InvoicePaymentUrlResult struct {
	InvoicePaymentUrl *InvoicePaymentUrl `json:"invoice_payment_url"`
}

type InvoiceRequest

type InvoiceRequest struct {
	// contains filtered or unexported fields
}

func (*InvoiceRequest) Create

func (ir *InvoiceRequest) Create(ctx context.Context, oneOffInput *InvoiceOneOffInput) (*Invoice, *Error)

func (*InvoiceRequest) Download

func (ir *InvoiceRequest) Download(ctx context.Context, invoiceID string) (*Invoice, *Error)

func (*InvoiceRequest) Finalize

func (ir *InvoiceRequest) Finalize(ctx context.Context, invoiceID string) (*Invoice, *Error)

func (*InvoiceRequest) Get

func (ir *InvoiceRequest) Get(ctx context.Context, invoiceID string) (*Invoice, *Error)

func (*InvoiceRequest) GetList

func (ir *InvoiceRequest) GetList(ctx context.Context, invoiceListInput *InvoiceListInput) (*InvoiceResult, *Error)

func (*InvoiceRequest) LoseDispute added in v1.2.0

func (ir *InvoiceRequest) LoseDispute(ctx context.Context, invoiceID string) (*Invoice, *Error)

func (*InvoiceRequest) PaymentUrl

func (ir *InvoiceRequest) PaymentUrl(ctx context.Context, invoiceID string) (*InvoicePaymentUrl, *Error)

func (*InvoiceRequest) Refresh

func (ir *InvoiceRequest) Refresh(ctx context.Context, invoiceID string) (*Invoice, *Error)

func (*InvoiceRequest) RetryPayment

func (ir *InvoiceRequest) RetryPayment(ctx context.Context, invoiceID string) (*Invoice, *Error)

func (*InvoiceRequest) Update

func (ir *InvoiceRequest) Update(ctx context.Context, invoiceInput *InvoiceInput) (*Invoice, *Error)

type InvoiceResult

type InvoiceResult struct {
	Invoice  *Invoice  `json:"invoice,omitempty"`
	Invoices []Invoice `json:"invoices,omitempty"`
	Meta     Metadata  `json:"meta,omitempty"`
}

type InvoiceStatus

type InvoiceStatus string
const (
	InvoiceStatusDraft     InvoiceStatus = "draft"
	InvoiceStatusFinalized InvoiceStatus = "finalized"
)

type InvoiceSummary

type InvoiceSummary struct {
	LagoID        uuid.UUID            `json:"lago_id,omitempty"`
	PaymentStatus InvoicePaymentStatus `json:"payment_status,omitempty"`
}

type InvoiceType

type InvoiceType string
const (
	SubscriptionInvoiceType InvoiceType = "subscription"
	AddOnInvoiceType        InvoiceType = "add_on"
	CreditInvoiceType       InvoiceType = "credit"
	OneOffInvoiceType       InvoiceType = "one_off"
)

type InvoicedUsage

type InvoicedUsage struct {
	Month          string   `json:"month,omitempty"`
	Code           string   `json:"code,omitempty"`
	AmountCents    int      `json:"amount_cents,omitempty"`
	AmountCurrency Currency `json:"currency,omitempty"`
}

type InvoicedUsageListInput

type InvoicedUsageListInput struct {
	AmountCurrency string `json:"currency,omitempty,string"`
	Months         int    `json:"months,omitempty,string"`
}

type InvoicedUsageRequest

type InvoicedUsageRequest struct {
	// contains filtered or unexported fields
}

func (*InvoicedUsageRequest) GetList

func (adr *InvoicedUsageRequest) GetList(ctx context.Context, InvoicedUsageListInput *InvoicedUsageListInput) (*InvoicedUsageResult, *Error)

type InvoicedUsageResult

type InvoicedUsageResult struct {
	InvoicedUsage  *InvoicedUsage  `json:"invoiced_usage,omitempty"`
	InvoicedUsages []InvoicedUsage `json:"invoiced_usages,omitempty"`
}

type LimitationInput

type LimitationInput struct {
	PlanCodes           []string `json:"plan_codes,omitempty"`
	BillableMetricCodes []string `json:"billable_metric_codes,omitempty"`
}

type Metadata

type Metadata struct {
	CurrentPage int `json:"current_page,omitempty"`
	NextPage    int `json:"next_page,omitempty"`
	PrevPage    int `json:"prev_page,omitempty"`
	TotalPages  int `json:"total_pages,omitempty"`
	TotalCount  int `json:"total_count,omitempty"`
}

type MetadataResponse

type MetadataResponse struct {
	LagoID           uuid.UUID `json:"lago_id,omitempty"`
	Key              string    `json:"key,omitempty"`
	Value            string    `json:"value,omitempty"`
	DisplayInInvoice bool      `json:"display_in_invoice,omitempty"`
	CreatedAt        time.Time `json:"created_at,omitempty"`
}

type MinimumCommitment added in v1.1.0

type MinimumCommitment struct {
	LagoID             uuid.UUID    `json:"lago_id"`
	PlanCode           string       `json:"plan_code,omitempty"`
	InvoiceDisplayName string       `json:"invoice_display_name,omitempty"`
	AmountCents        int          `json:"amount_cents"`
	Interval           PlanInterval `json:"interval,omitempty"`
	CreatedAt          time.Time    `json:"created_at,omitempty"`
	UpdatedAt          time.Time    `json:"updated_at,omitempty"`

	Taxes []Tax `json:"tax,omitempty"`
}

type MinimumCommitmentInput added in v1.1.0

type MinimumCommitmentInput struct {
	AmountCents        int      `json:"amount_cents,omitempty"`
	InvoiceDisplayName string   `json:"invoice_display_name,omitempty"`
	TaxCodes           []string `json:"tax_codes,omitempty"`
}

type MinimumCommitmentOverridesInput added in v1.1.0

type MinimumCommitmentOverridesInput struct {
	AmountCents        int      `json:"amount_cents,omitempty"`
	InvoiceDisplayName string   `json:"invoice_display_name,omitempty"`
	TaxCodes           []string `json:"tax_codes,omitempty"`
}

type Mrr

type Mrr struct {
	Month          string   `json:"month,omitempty"`
	AmountCents    int      `json:"amount_cents,omitempty"`
	AmountCurrency Currency `json:"currency,omitempty"`
}

type MrrListInput

type MrrListInput struct {
	AmountCurrency string `json:"currency,omitempty,string"`
	Months         int    `json:"months,omitempty,string"`
}

type MrrRequest

type MrrRequest struct {
	// contains filtered or unexported fields
}

func (*MrrRequest) GetList

func (adr *MrrRequest) GetList(ctx context.Context, MrrListInput *MrrListInput) (*MrrResult, *Error)

type MrrResult

type MrrResult struct {
	Mrr  *Mrr  `json:"mrr,omitempty"`
	Mrrs []Mrr `json:"mrrs,omitempty"`
}

type Organization

type Organization struct {
	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"`
	Zipcode                 string                        `json:"zipcode,omitempty"`
	State                   string                        `json:"state,omitempty"`
	Country                 string                        `json:"country,omitempty"`
	DefaultCurrency         Currency                      `json:"default_currency,omitempty"`
	LegalName               string                        `json:"legal_name,omitempty"`
	LegalNumber             string                        `json:"legal_number,omitempty"`
	DocumentNumbering       OrganizationDocumentNumbering `json:"document_numbering,omitempty"`
	DocumentNumberPrefix    string                        `json:"document_number_prefix,omitempty"`
	NetPaymentTerm          int                           `json:"net_payment_term,omitempty"`
	TaxIdentificationNumber string                        `json:"tax_identification_number,omitempty"`
	WebhookURL              string                        `json:"webhook_url,omitempty"`
	WebhookURLs             []string                      `json:"webhook_urls,omitempty"`
	Timezone                string                        `json:"timezone,omitempty"`
	EmailSettings           []string                      `json:"email_settings,omitempty"`

	BillingConfiguration OrganizationBillingConfiguration `json:"billing_configuration,omitempty"`

	Taxes []Tax `json:"taxes,omitempty"`

	CreatedAt time.Time `json:"created_at,omitempty"`
}

type OrganizationBillingConfiguration

type OrganizationBillingConfiguration struct {
	InvoiceGracePeriod int    `json:"invoice_grace_period,omitempty"`
	InvoiceFooter      string `json:"invoice_footer,omitempty"`
	DocumentLocale     string `json:"document_locale,omitempty"`
}

type OrganizationBillingConfigurationInput

type OrganizationBillingConfigurationInput struct {
	InvoiceGracePeriod int    `json:"invoice_grace_period,omitempty"`
	InvoiceFooter      string `json:"invoice_footer,omitempty"`
	DocumentLocale     string `json:"document_locale,omitempty"`
}

type OrganizationDocumentNumbering

type OrganizationDocumentNumbering string
const (
	DocumentNumberingPerCustomer     OrganizationDocumentNumbering = "per_customer"
	DocumentNumberingPerOrganization OrganizationDocumentNumbering = "per_organization"
)

type OrganizationInput

type OrganizationInput struct {
	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"`
	Zipcode                 string                        `json:"zipcode,omitempty"`
	State                   string                        `json:"state,omitempty"`
	Country                 string                        `json:"country,omitempty"`
	DefaultCurrency         Currency                      `json:"default_currency,omitempty"`
	LegalName               string                        `json:"legal_name,omitempty"`
	LegalNumber             string                        `json:"legal_number,omitempty"`
	DocumentNumbering       OrganizationDocumentNumbering `json:"document_numbering,omitempty"`
	DocumentNumberPrefix    string                        `json:"document_number_prefix,omitempty"`
	NetPaymentTerm          int                           `json:"net_payment_term,omitempty"`
	TaxIdentificationNumber string                        `json:"tax_identification_number,omitempty"`
	WebhookURL              string                        `json:"webhook_url,omitempty"`
	Timezone                string                        `json:"timezone,omitempty"`
	EmailSettings           []string                      `json:"email_settings,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 PaymentStatus

type PaymentStatus string

type Plan

type Plan struct {
	LagoID                   uuid.UUID          `json:"lago_id"`
	Name                     string             `json:"name,omitempty"`
	InvoiceDisplayName       string             `json:"invoice_display_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"`
	ActiveSubscriptionsCount int                `json:"active_subscriptions_count,omitempty"`
	DraftInvoicesCount       int                `json:"draft_invoices_count,omitempty"`
	Charges                  []Charge           `json:"charges,omitempty"`
	MinimumCommitment        *MinimumCommitment `json:"minimum_commitment"`

	Taxes []Tax `json:"taxes,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"`
	PayInAdvance     bool                   `json:"pay_in_advance,omitempty"`
	Invoiceable      bool                   `json:"invoiceable,omitempty"`
	Prorated         bool                   `json:"prorated,omitempty"`
	MinAmountCents   int                    `json:"min_amount_cents,omitempty"`
	Properties       map[string]interface{} `json:"properties"`
	GroupProperties  []GroupProperties      `json:"group_properties,omitempty"`
	Filters          []ChargeFilter         `json:"filters,omitempty"`

	TaxCodes []string `json:"tax_codes,omitempty"`
}

type PlanInput

type PlanInput struct {
	Name               string                  `json:"name,omitempty"`
	InvoiceDisplayName string                  `json:"invoice_display_name,omitempty"`
	Code               string                  `json:"code,omitempty"`
	Interval           PlanInterval            `json:"interval,omitempty"`
	Description        string                  `json:"description,omitempty"`
	AmountCents        int                     `json:"amount_cents"`
	AmountCurrency     Currency                `json:"amount_currency,omitempty"`
	PayInAdvance       bool                    `json:"pay_in_advance"`
	BillChargeMonthly  bool                    `json:"bill_charge_monthly"`
	TrialPeriod        float32                 `json:"trial_period"`
	Charges            []PlanChargeInput       `json:"charges,omitempty"`
	MinimumCommitment  *MinimumCommitmentInput `json:"minimum_commitment,omitempty"`
	TaxCodes           []string                `json:"tax_codes,omitempty"`
}

type PlanInterval

type PlanInterval string
const (
	PlanWeekly    PlanInterval = "weekly"
	PlanMonthly   PlanInterval = "monthly"
	PlanQuarterly PlanInterval = "quarterly"
	PlanYearly    PlanInterval = "yearly"
)

type PlanListInput

type PlanListInput struct {
	PerPage int `json:"per_page,omitempty,string"`
	Page    int `json:"page,omitempty,string"`
}

type PlanOverridesInput

type PlanOverridesInput struct {
	Name               string                           `json:"name,omitempty"`
	InvoiceDisplayName string                           `json:"invoice_display_name,omitempty"`
	Code               string                           `json:"code,omitempty"`
	Description        string                           `json:"description,omitempty"`
	AmountCents        int                              `json:"amount_cents"`
	AmountCurrency     Currency                         `json:"amount_currency,omitempty"`
	TrialPeriod        float32                          `json:"trial_period"`
	Charges            []ChargeOverridesInput           `json:"charges,omitempty"`
	MinimumCommitment  *MinimumCommitmentOverridesInput `json:"minimum_commitment"`
	TaxCodes           []string                         `json:"tax_codes,omitempty"`
}

type PlanParams

type PlanParams struct {
	Plan *PlanInput `json:"plan"`
}

type PlanRequest

type PlanRequest struct {
	// contains filtered or unexported fields
}

func (*PlanRequest) Create

func (pr *PlanRequest) Create(ctx context.Context, planInput *PlanInput) (*Plan, *Error)

func (*PlanRequest) Delete

func (pr *PlanRequest) Delete(ctx context.Context, planCode string) (*Plan, *Error)

func (*PlanRequest) Get

func (pr *PlanRequest) Get(ctx context.Context, planCode string) (*Plan, *Error)

func (*PlanRequest) GetList

func (pr *PlanRequest) GetList(ctx context.Context, planListInput *PlanListInput) (*PlanResult, *Error)

func (*PlanRequest) Update

func (pr *PlanRequest) Update(ctx context.Context, planInput *PlanInput) (*Plan, *Error)

type PlanResult

type PlanResult struct {
	Plan  *Plan    `json:"plan,omitempty"`
	Plans []Plan   `json:"plans,omitempty"`
	Meta  Metadata `json:"meta,omitempty"`
}

type RecurringTransactionRuleInput

type RecurringTransactionRuleInput struct {
	LagoID           uuid.UUID `json:"lago_id,omitempty"`
	RuleType         string    `json:"rule_type,omitempty"`
	Interval         string    `json:"interval,omitempty"`
	ThresholdCredits string    `json:"threshold_credits,omitempty"`
	PaidCredits      string    `json:"paid_credits,omitempty"`
	GrantedCredits   string    `json:"granted_credits,omitempty"`
}

type RecurringTransactionRuleResponse

type RecurringTransactionRuleResponse struct {
	LagoID           uuid.UUID `json:"lago_id,omitempty"`
	RuleType         string    `json:"rule_type,omitempty"`
	Interval         string    `json:"interval,omitempty"`
	ThresholdCredits string    `json:"threshold_credits,omitempty"`
	PaidCredits      string    `json:"paid_credits,omitempty"`
	GrantedCredits   string    `json:"granted_credits,omitempty"`
	CreatedAt        time.Time `json:"created_at,omitempty"`
}

type SignatureAlgo

type SignatureAlgo string
const (
	JWT  SignatureAlgo = "jwt"
	HMac SignatureAlgo = "hmac"
)

type Status

type Status string
const (
	Active     Status = "active"
	Terminated Status = "terminated"
)

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"`
	SubscriptionAt *time.Time         `json:"subscription_at"`
	EndingAt       *time.Time         `json:"ending_at"`
	TrialEndedAt   *time.Time         `json:"trial_ended_at"`

	PreviousPlanCode  string `json:"previous_plan_code"`
	NextPlanCode      string `json:"next_plan_code"`
	DowngradePlanDate string `json:"downgrade_plan_date"`

	Plan *Plan `json:"plan,omitempty"`

	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"`
	SubscriptionAt     *time.Time          `json:"subscription_at,omitempty"`
	EndingAt           *time.Time          `json:"ending_at,omitempty"`
	BillingTime        BillingTime         `json:"billing_time,omitempty"`
	PlanOverrides      *PlanOverridesInput `json:"plan_overrides,omitempty"`
	ExternalID         string              `json:"external_id"`
	Name               string              `json:"name"`
}

type SubscriptionListInput

type SubscriptionListInput struct {
	ExternalCustomerID string   `json:"external_customer_id,omitempty"`
	PlanCode           string   `json:"plan_code,omitempty"`
	PerPage            int      `json:"per_page,omitempty,string"`
	Page               int      `json:"page,omitempty,string"`
	Status             []string `json:"status,omitempty"`
}

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) Get

func (sr *SubscriptionRequest) Get(ctx context.Context, subscriptionExternalId string) (*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, subscriptionTerminateInput SubscriptionTerminateInput) (*Subscription, *Error)

func (*SubscriptionRequest) Update added in v1.1.1

func (sr *SubscriptionRequest) Update(ctx context.Context, subscriptionInput *SubscriptionInput) (*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 SubscriptionTerminateInput

type SubscriptionTerminateInput struct {
	ExternalID string `json:"external_id,omitempty"`
	Status     string `json:"status,omitempty"`
}

type Tax

type Tax struct {
	LagoID                uuid.UUID `json:"lago_id,omitempty"`
	Name                  string    `json:"name,omitempty"`
	Code                  string    `json:"code,omitempty"`
	Rate                  float32   `json:"rate,omitempty"`
	Description           string    `json:"description,omitempty"`
	AddOnsCount           int       `json:"add_ons_count,omitempty"`
	CustomersCount        int       `json:"customers_count,omitempty"`
	PlansCount            int       `json:"plans_count,omitempty"`
	ChargesCount          int       `json:"charges_count,omitempty"`
	AppliedToOrganization bool      `json:"applied_to_organization,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
}

type TaxInput

type TaxInput struct {
	Name                  string   `json:"name,omitempty"`
	Code                  string   `json:"code,omitempty"`
	Rate                  *float32 `json:"rate,omitempty"`
	Description           string   `json:"description,omitempty"`
	AppliedToOrganization bool     `json:"applied_to_organization,omitempty"`

	CreatedAt time.Time `json:"created_at,omitempty"`
}

type TaxListInput

type TaxListInput struct {
	PerPage int `json:"per_page,omitempty,string"`
	Page    int `json:"page,omitempty,string"`
}

type TaxParams

type TaxParams struct {
	Tax *TaxInput `json:"tax"`
}

type TaxRequest

type TaxRequest struct {
	// contains filtered or unexported fields
}

func (*TaxRequest) Create

func (adr *TaxRequest) Create(ctx context.Context, taxInput *TaxInput) (*Tax, *Error)

func (*TaxRequest) Delete

func (adr *TaxRequest) Delete(ctx context.Context, taxCode string) (*Tax, *Error)

func (*TaxRequest) Get

func (adr *TaxRequest) Get(ctx context.Context, taxCode string) (*Tax, *Error)

func (*TaxRequest) GetList

func (adr *TaxRequest) GetList(ctx context.Context, taxListInput *TaxListInput) (*TaxResult, *Error)

func (*TaxRequest) Update

func (adr *TaxRequest) Update(ctx context.Context, taxInput *TaxInput) (*Tax, *Error)

type TaxResult

type TaxResult struct {
	Tax   *Tax     `json:"tax,omitempty"`
	Taxes []Tax    `json:"taxes,omitempty"`
	Meta  Metadata `json:"meta,omitempty"`
}

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                   Currency                           `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"` // NOTE(legacy)
	BalanceCents               int                                `json:"balance_cents,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"`
	RecurringTransactionRules  []RecurringTransactionRuleResponse `json:"recurring_transaction_rules,omitempty"`
	OngoingBalanceCents        int                                `json:"ongoing_balance_cents,omitempty"`
	OngoingUsageBalanceCents   int                                `json:"ongoing_usage_balance_cents,omitempty"`
	CreditsOngoingBalance      string                             `json:"credits_ongoing_balance,omitempty"`
	CreditsOngoingUsageBalance string                             `json:"credits_ongoing_usage_balance,omitempty"`
}

type WalletInput

type WalletInput struct {
	RateAmount                string                          `json:"rate_amount,omitempty"`
	Currency                  Currency                        `json:"currency,omitempty"`
	Name                      string                          `json:"name,omitempty"`
	PaidCredits               string                          `json:"paid_credits,omitempty"`
	GrantedCredits            string                          `json:"granted_credits,omitempty"`
	ExpirationAt              *time.Time                      `json:"expiration_at,omitempty"`
	ExternalCustomerID        string                          `json:"external_customer_id,omitempty"`
	RecurringTransactionRules []RecurringTransactionRuleInput `json:"recurring_transaction_rules,omitempty"`
}

type WalletListInput

type WalletListInput struct {
	PerPage            int `json:"per_page,omitempty,string"`
	Page               int `json:"page,omitempty,string"`
	ExternalCustomerID int `json:"external_customer_id,omitempty,string"`
}

type WalletParams

type WalletParams struct {
	WalletInput *WalletInput `json:"wallet"`
}

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) Delete

func (bmr *WalletRequest) Delete(ctx context.Context, walletID string) (*Wallet, *Error)

func (*WalletRequest) Get

func (bmr *WalletRequest) Get(ctx context.Context, walletID string) (*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 WalletResult struct {
	Wallet  *Wallet  `json:"wallet,omitempty"`
	Wallets []Wallet `json:"wallets,omitempty"`
	Meta    Metadata `json:"meta,omitempty"`
}

type WalletTransaction

type WalletTransaction struct {
	LagoID          uuid.UUID               `json:"lago_id,omitempty"`
	LagoWalletID    uuid.UUID               `json:"lago_wallet_id,omitempty"`
	Status          WalletTransactionStatus `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 WalletTransactionInput struct {
	WalletID       string `json:"wallet_id,omitempty"`
	PaidCredits    string `json:"paid_credits,omitempty"`
	GrantedCredits string `json:"granted_credits,omitempty"`
}

type WalletTransactionListInput

type WalletTransactionListInput struct {
	PerPage         int                     `json:"per_page,omitempty,string"`
	Page            int                     `json:"page,omitempty,string"`
	WalletID        string                  `json:"wallet_id,omitempty"`
	Status          WalletTransactionStatus `json:"status,omitempty"`
	TransactionType TransactionType         `json:"transaction_type,omitempty"`
}

type WalletTransactionParams

type WalletTransactionParams struct {
	WalletTransactionInput *WalletTransactionInput `json:"wallet_transaction"`
}

type WalletTransactionRequest

type WalletTransactionRequest struct {
	// contains filtered or unexported fields
}

func (*WalletTransactionRequest) Create

func (wtr *WalletTransactionRequest) Create(ctx context.Context, walletTransactionInput *WalletTransactionInput) (*WalletTransactionResult, *Error)

func (*WalletTransactionRequest) GetList

func (wtr *WalletTransactionRequest) GetList(ctx context.Context, walletTransactionListInput *WalletTransactionListInput) (*WalletTransactionResult, *Error)

type WalletTransactionResult

type WalletTransactionResult struct {
	WalletTransactions []WalletTransaction `json:"wallet_transactions,omitempty"`
	Meta               Metadata            `json:"meta,omitempty"`
}

type WalletTransactionStatus

type WalletTransactionStatus string
const (
	WalletTransactionStatusPending WalletTransactionStatus = "pending"
	WalletTransactionStatusSettled WalletTransactionStatus = "settled"
)

type WebhookEndpoint

type WebhookEndpoint struct {
	LagoID             uuid.UUID     `json:"lago_id,omitempty"`
	LagoOrganizationID uuid.UUID     `json:"lago_organization_id,omitempty"`
	WebhookURL         string        `json:"webhook_url,omitempty"`
	SignatureAlgo      SignatureAlgo `json:"signature_algo,omitempty"`
	CreatedAt          time.Time     `json:"created_at,omitempty"`
}

type WebhookEndpointInput

type WebhookEndpointInput struct {
	WebhookURL    string        `json:"webhook_url,omitempty"`
	SignatureAlgo SignatureAlgo `json:"signature_algo,omitempty"`
}

type WebhookEndpointListInput

type WebhookEndpointListInput struct {
	PerPage int `json:"per_page,omitempty,string"`
	Page    int `json:"page,omitempty,string"`
}

type WebhookEndpointParams

type WebhookEndpointParams struct {
	WebhookEndpointInput *WebhookEndpointInput `json:"webhook_endpoint"`
}

type WebhookEndpointRequest

type WebhookEndpointRequest struct {
	// contains filtered or unexported fields
}

func (*WebhookEndpointRequest) Create

func (wer *WebhookEndpointRequest) Create(ctx context.Context, webhookEndpointInput *WebhookEndpointInput) (*WebhookEndpoint, *Error)

func (*WebhookEndpointRequest) Delete

func (wer *WebhookEndpointRequest) Delete(ctx context.Context, webhookEndpointID string) (*WebhookEndpoint, *Error)

func (*WebhookEndpointRequest) Get

func (wer *WebhookEndpointRequest) Get(ctx context.Context, webhookEndpointID string) (*WebhookEndpoint, *Error)

func (*WebhookEndpointRequest) GetList

func (wer *WebhookEndpointRequest) GetList(ctx context.Context, webhookEndpointListInput *WebhookEndpointListInput) (*WebhookEndpointResult, *Error)

func (*WebhookEndpointRequest) Update

func (wer *WebhookEndpointRequest) Update(ctx context.Context, webhookEndpointInput *WebhookEndpointInput, webhookEndpointID string) (*WebhookEndpoint, *Error)

type WebhookEndpointResult

type WebhookEndpointResult struct {
	WebhookEndpoint  *WebhookEndpoint  `json:"webhook_endpoint,omitempty"`
	WebhookEndpoints []WebhookEndpoint `json:"webhook_endpoints,omitempty"`
	Meta             Metadata          `json:"meta,omitempty"`
}

type WebhookRequest

type WebhookRequest struct {
	// contains filtered or unexported fields
}

func (*WebhookRequest) GetPublicKey

func (wr *WebhookRequest) GetPublicKey(ctx context.Context) (*rsa.PublicKey, *Error)

func (*WebhookRequest) ValidateBody

func (wr *WebhookRequest) ValidateBody(ctx context.Context, signature string, body string) (bool, *Error)

func (*WebhookRequest) ValidateSignature

func (wr *WebhookRequest) ValidateSignature(ctx context.Context, signature string) (bool, *Error)

type WeightedInterval

type WeightedInterval string
const (
	SecondsInterval WeightedInterval = "seconds"
)

Jump to

Keyboard shortcuts

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