diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index dae9a81fbb..bb32051fd0 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v446 \ No newline at end of file +v457 \ No newline at end of file diff --git a/account.go b/account.go index 705ea4c424..c09ef7c5e0 100644 --- a/account.go +++ b/account.go @@ -42,6 +42,7 @@ const ( AccountCompanyStructureGovernmentInstrumentality AccountCompanyStructure = "government_instrumentality" AccountCompanyStructureGovernmentalUnit AccountCompanyStructure = "governmental_unit" AccountCompanyStructureIncorporatedNonProfit AccountCompanyStructure = "incorporated_non_profit" + AccountCompanyStructureIncorporatedPartnership AccountCompanyStructure = "incorporated_partnership" AccountCompanyStructureLimitedLiabilityPartnership AccountCompanyStructure = "limited_liability_partnership" AccountCompanyStructureLLC AccountCompanyStructure = "llc" AccountCompanyStructureMultiMemberLLC AccountCompanyStructure = "multi_member_llc" @@ -57,6 +58,7 @@ const ( AccountCompanyStructureTaxExemptGovernmentInstrumentality AccountCompanyStructure = "tax_exempt_government_instrumentality" AccountCompanyStructureUnincorporatedAssociation AccountCompanyStructure = "unincorporated_association" AccountCompanyStructureUnincorporatedNonProfit AccountCompanyStructure = "unincorporated_non_profit" + AccountCompanyStructureUnincorporatedPartnership AccountCompanyStructure = "unincorporated_partnership" ) // One of `document_corrupt`, `document_expired`, `document_failed_copy`, `document_failed_greyscale`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_not_readable`, `document_not_uploaded`, `document_type_not_supported`, or `document_too_large`. A machine-readable code specifying the verification state for this document. diff --git a/balancetransaction.go b/balancetransaction.go index 76efd8e4ae..e4000b317e 100644 --- a/balancetransaction.go +++ b/balancetransaction.go @@ -69,7 +69,7 @@ const ( BalanceTransactionStatusPending BalanceTransactionStatus = "pending" ) -// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead. +// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead. type BalanceTransactionType string // List of values that BalanceTransactionType can take @@ -90,6 +90,7 @@ const ( BalanceTransactionTypePayment BalanceTransactionType = "payment" BalanceTransactionTypePaymentFailureRefund BalanceTransactionType = "payment_failure_refund" BalanceTransactionTypePaymentRefund BalanceTransactionType = "payment_refund" + BalanceTransactionTypePaymentReversal BalanceTransactionType = "payment_reversal" BalanceTransactionTypePayout BalanceTransactionType = "payout" BalanceTransactionTypePayoutCancel BalanceTransactionType = "payout_cancel" BalanceTransactionTypePayoutFailure BalanceTransactionType = "payout_failure" @@ -125,7 +126,7 @@ type BalanceTransactionListParams struct { Payout *string `form:"payout"` // Only returns the original transaction. Source *string `form:"source"` - // Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. + // Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Type *string `form:"type"` } @@ -184,7 +185,7 @@ type BalanceTransaction struct { Source *BalanceTransactionSource `json:"source"` // If the transaction's net funds are available in the Stripe balance yet. Either `available` or `pending`. Status BalanceTransactionStatus `json:"status"` - // Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead. + // Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead. Type BalanceTransactionType `json:"type"` } type BalanceTransactionSource struct { diff --git a/billingportal_session.go b/billingportal_session.go index f478f7fa1a..976a59bb9f 100644 --- a/billingportal_session.go +++ b/billingportal_session.go @@ -112,7 +112,7 @@ type BillingPortalSessionParams struct { Customer *string `form:"customer"` // Information about a specific flow for the customer to go through. See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. FlowData *BillingPortalSessionFlowDataParams `form:"flow_data"` - // The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer's `preferred_locales` or browser's locale is used. + // The IETF language tag of the locale customer portal is displayed in. If blank or auto, the customer's `preferred_locales` or browser's locale is used. Locale *string `form:"locale"` // The `on_behalf_of` account to use for this session. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. OnBehalfOf *string `form:"on_behalf_of"` diff --git a/creditnotelineitem.go b/creditnotelineitem.go index f5b7ba4a1a..21375f3fdf 100644 --- a/creditnotelineitem.go +++ b/creditnotelineitem.go @@ -25,6 +25,7 @@ type CreditNoteLineItemDiscountAmount struct { // CreditNoteLineItem is the resource representing a Stripe credit note line item. // For more details see https://stripe.com/docs/api/credit_notes/line_item +// The credit note line item object type CreditNoteLineItem struct { // The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts. Amount int64 `json:"amount"` diff --git a/customercashbalancetransaction.go b/customercashbalancetransaction.go index 69709b9ead..afbe4b0ec5 100644 --- a/customercashbalancetransaction.go +++ b/customercashbalancetransaction.go @@ -6,6 +6,8 @@ package stripe +import "encoding/json" + // The funding method type used to fund the customer balance. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. type CustomerCashBalanceTransactionFundedBankTransferType string @@ -33,6 +35,7 @@ type CustomerCashBalanceTransactionType string // List of values that CustomerCashBalanceTransactionType can take const ( + CustomerCashBalanceTransactionTypeAdjustedForOverdraft CustomerCashBalanceTransactionType = "adjusted_for_overdraft" CustomerCashBalanceTransactionTypeAppliedToPayment CustomerCashBalanceTransactionType = "applied_to_payment" CustomerCashBalanceTransactionTypeFunded CustomerCashBalanceTransactionType = "funded" CustomerCashBalanceTransactionTypeFundingReversed CustomerCashBalanceTransactionType = "funding_reversed" @@ -53,6 +56,10 @@ type CustomerCashBalanceTransactionListParams struct { ListParams `form:"*"` Customer *string `form:"-"` // Included in URL } +type CustomerCashBalanceTransactionAdjustedForOverdraft struct { + // The [Cash Balance Transaction](https://stripe.com/docs/api/cash_balance_transactions/object) that brought the customer balance negative, triggering the clawback of funds. + LinkedTransaction *CustomerCashBalanceTransaction `json:"linked_transaction"` +} type CustomerCashBalanceTransactionAppliedToPayment struct { // The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were applied to. PaymentIntent *PaymentIntent `json:"payment_intent"` @@ -115,7 +122,8 @@ type CustomerCashBalanceTransactionUnappliedFromPayment struct { // to payments, and refunds to the customer. type CustomerCashBalanceTransaction struct { APIResource - AppliedToPayment *CustomerCashBalanceTransactionAppliedToPayment `json:"applied_to_payment"` + AdjustedForOverdraft *CustomerCashBalanceTransactionAdjustedForOverdraft `json:"adjusted_for_overdraft"` + AppliedToPayment *CustomerCashBalanceTransactionAppliedToPayment `json:"applied_to_payment"` // Time at which the object was created. Measured in seconds since the Unix epoch. Created int64 `json:"created"` // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). @@ -145,3 +153,22 @@ type CustomerCashBalanceTransactionList struct { ListMeta Data []*CustomerCashBalanceTransaction `json:"data"` } + +// UnmarshalJSON handles deserialization of a CustomerCashBalanceTransaction. +// This custom unmarshaling is needed because the resulting +// property may be an id or the full struct if it was expanded. +func (c *CustomerCashBalanceTransaction) UnmarshalJSON(data []byte) error { + if id, ok := ParseID(data); ok { + c.ID = id + return nil + } + + type customerCashBalanceTransaction CustomerCashBalanceTransaction + var v customerCashBalanceTransaction + if err := json.Unmarshal(data, &v); err != nil { + return err + } + + *c = CustomerCashBalanceTransaction(v) + return nil +} diff --git a/taxrate.go b/taxrate.go index 780011d520..f5b7b53007 100644 --- a/taxrate.go +++ b/taxrate.go @@ -79,7 +79,9 @@ type TaxRate struct { Description string `json:"description"` // The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. DisplayName string `json:"display_name"` - // Actual/effective tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage does not include the statutory tax rate of non-taxable jurisdictions. + // Actual/effective tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, + // this percentage reflects the rate actually used to calculate tax based on the product's taxability + // and whether the user is registered to collect taxes in the corresponding jurisdiction. EffectivePercentage float64 `json:"effective_percentage"` // Unique identifier for the object. ID string `json:"id"`