generated from NdoleStudio/go-http-client
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathsubscription_invoice.go
49 lines (44 loc) · 2.38 KB
/
subscription_invoice.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package lemonsqueezy
import "time"
// SubscriptionInvoiceAttributes is the invoice for a subscription
// https://docs.lemonsqueezy.com/api/subscription-invoices#the-subscription-invoice-object
type SubscriptionInvoiceAttributes struct {
StoreID int `json:"store_id"`
SubscriptionID int `json:"subscription_id"`
BillingReason string `json:"billing_reason"`
CardBrand string `json:"card_brand"`
CardLastFour string `json:"card_last_four"`
Currency string `json:"currency"`
CurrencyRate string `json:"currency_rate"`
Subtotal int `json:"subtotal"`
DiscountTotal int `json:"discount_total"`
Tax int `json:"tax"`
Total int `json:"total"`
SubtotalUsd int `json:"subtotal_usd"`
DiscountTotalUsd int `json:"discount_total_usd"`
TaxUsd int `json:"tax_usd"`
TotalUsd int `json:"total_usd"`
Status string `json:"status"`
StatusFormatted string `json:"status_formatted"`
Refunded bool `json:"refunded"`
RefundedAt *time.Time `json:"refunded_at"`
SubtotalFormatted string `json:"subtotal_formatted"`
DiscountTotalFormatted string `json:"discount_total_formatted"`
TaxFormatted string `json:"tax_formatted"`
TotalFormatted string `json:"total_formatted"`
Urls struct {
InvoiceURL string `json:"invoice_url"`
} `json:"urls"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
TestMode bool `json:"test_mode"`
}
// ApiResponseRelationshipsSubscriptionInvoice relationships of a subscription invoice
type ApiResponseRelationshipsSubscriptionInvoice struct {
Store ApiResponseLinks `json:"store"`
Subscription ApiResponseLinks `json:"subscription"`
}
// SubscriptionInvoiceApiResponse is the api response for one subscription invoice
type SubscriptionInvoiceApiResponse = ApiResponse[SubscriptionInvoiceAttributes, ApiResponseRelationshipsSubscriptionInvoice]
// SubscriptionInvoicesApiResponse is the api response for a list of subscription invoices.
type SubscriptionInvoicesApiResponse = ApiResponseList[SubscriptionInvoiceAttributes, ApiResponseRelationshipsSubscriptionInvoice]