Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.46.0"
".": "1.47.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 118
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-033643979990e894363554df06218fabe4493feaa569a013dbdf9a72aa21c45f.yml
openapi_spec_hash: dd9d320ad178bafa06f1eac2977e2ca7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-7936e3f73bbe1d59d27fd7a8a226985927b38fdec1c936c77577381699fb6140.yml
openapi_spec_hash: 1d3f9ed5fbdb0e40d56d6acd9d1736e2
config_hash: e6db17547fe854b1c240407cf4c6dc9e
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.47.0 (2025-12-03)

Full Changelog: [v1.46.0...v1.47.0](https://github.com/orbcorp/orb-go/compare/v1.46.0...v1.47.0)

### Features

* **api:** api update ([ac7e445](https://github.com/orbcorp/orb-go/commit/ac7e4451aaaaf19cd95dfe07bcdfab2e3ca41208))

## 1.46.0 (2025-12-02)

Full Changelog: [v1.45.0...v1.46.0](https://github.com/orbcorp/orb-go/compare/v1.45.0...v1.46.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/orbcorp/orb-go@v1.46.0'
go get -u 'github.com/orbcorp/orb-go@v1.47.0'
```

<!-- x-release-please-end -->
Expand Down
206 changes: 205 additions & 1 deletion customer.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,10 @@ type Customer struct {
AccountingSyncConfiguration CustomerAccountingSyncConfiguration `json:"accounting_sync_configuration,nullable"`
// Whether automatic tax calculation is enabled for this customer. This field is
// nullable for backwards compatibility but will always return a boolean value.
AutomaticTaxEnabled bool `json:"automatic_tax_enabled,nullable"`
AutomaticTaxEnabled bool `json:"automatic_tax_enabled,nullable"`
// Payment configuration for the customer, applicable when using Orb Invoicing with
// a supported payment provider such as Stripe.
PaymentConfiguration CustomerPaymentConfiguration `json:"payment_configuration,nullable"`
ReportingConfiguration CustomerReportingConfiguration `json:"reporting_configuration,nullable"`
JSON customerJSON `json:"-"`
}
Expand Down Expand Up @@ -484,6 +487,7 @@ type customerJSON struct {
Timezone apijson.Field
AccountingSyncConfiguration apijson.Field
AutomaticTaxEnabled apijson.Field
PaymentConfiguration apijson.Field
ReportingConfiguration apijson.Field
raw string
ExtraFields map[string]apijson.Field
Expand Down Expand Up @@ -603,6 +607,74 @@ func (r CustomerAccountingSyncConfigurationAccountingProvidersProviderType) IsKn
return false
}

// Payment configuration for the customer, applicable when using Orb Invoicing with
// a supported payment provider such as Stripe.
type CustomerPaymentConfiguration struct {
// Provider-specific payment configuration.
PaymentProviders []CustomerPaymentConfigurationPaymentProvider `json:"payment_providers"`
JSON customerPaymentConfigurationJSON `json:"-"`
}

// customerPaymentConfigurationJSON contains the JSON metadata for the struct
// [CustomerPaymentConfiguration]
type customerPaymentConfigurationJSON struct {
PaymentProviders apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

func (r *CustomerPaymentConfiguration) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

func (r customerPaymentConfigurationJSON) RawJSON() string {
return r.raw
}

type CustomerPaymentConfigurationPaymentProvider struct {
// The payment provider to configure.
ProviderType CustomerPaymentConfigurationPaymentProvidersProviderType `json:"provider_type,required"`
// List of Stripe payment method types to exclude for this customer. Excluded
// payment methods will not be available for the customer to select during payment,
// and will not be used for auto-collection. If a customer's default payment method
// becomes excluded, Orb will attempt to use the next available compatible payment
// method for auto-collection.
ExcludedPaymentMethodTypes []string `json:"excluded_payment_method_types"`
JSON customerPaymentConfigurationPaymentProviderJSON `json:"-"`
}

// customerPaymentConfigurationPaymentProviderJSON contains the JSON metadata for
// the struct [CustomerPaymentConfigurationPaymentProvider]
type customerPaymentConfigurationPaymentProviderJSON struct {
ProviderType apijson.Field
ExcludedPaymentMethodTypes apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

func (r *CustomerPaymentConfigurationPaymentProvider) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

func (r customerPaymentConfigurationPaymentProviderJSON) RawJSON() string {
return r.raw
}

// The payment provider to configure.
type CustomerPaymentConfigurationPaymentProvidersProviderType string

const (
CustomerPaymentConfigurationPaymentProvidersProviderTypeStripe CustomerPaymentConfigurationPaymentProvidersProviderType = "stripe"
)

func (r CustomerPaymentConfigurationPaymentProvidersProviderType) IsKnown() bool {
switch r {
case CustomerPaymentConfigurationPaymentProvidersProviderTypeStripe:
return true
}
return false
}

type CustomerReportingConfiguration struct {
Exempt bool `json:"exempt,required"`
JSON customerReportingConfigurationJSON `json:"-"`
Expand Down Expand Up @@ -790,6 +862,9 @@ type CustomerNewParams struct {
// by setting the value to `null`, and the entire metadata mapping can be cleared
// by setting `metadata` to `null`.
Metadata param.Field[map[string]string] `json:"metadata"`
// Payment configuration for the customer, applicable when using Orb Invoicing with
// a supported payment provider such as Stripe.
PaymentConfiguration param.Field[CustomerNewParamsPaymentConfiguration] `json:"payment_configuration"`
// This is used for creating charges or invoices in an external system via Orb.
// When not in test mode, the connection must first be configured in the Orb
// webapp.
Expand Down Expand Up @@ -955,6 +1030,47 @@ func (r CustomerNewParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}

// Payment configuration for the customer, applicable when using Orb Invoicing with
// a supported payment provider such as Stripe.
type CustomerNewParamsPaymentConfiguration struct {
// Provider-specific payment configuration.
PaymentProviders param.Field[[]CustomerNewParamsPaymentConfigurationPaymentProvider] `json:"payment_providers"`
}

func (r CustomerNewParamsPaymentConfiguration) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}

type CustomerNewParamsPaymentConfigurationPaymentProvider struct {
// The payment provider to configure.
ProviderType param.Field[CustomerNewParamsPaymentConfigurationPaymentProvidersProviderType] `json:"provider_type,required"`
// List of Stripe payment method types to exclude for this customer. Excluded
// payment methods will not be available for the customer to select during payment,
// and will not be used for auto-collection. If a customer's default payment method
// becomes excluded, Orb will attempt to use the next available compatible payment
// method for auto-collection.
ExcludedPaymentMethodTypes param.Field[[]string] `json:"excluded_payment_method_types"`
}

func (r CustomerNewParamsPaymentConfigurationPaymentProvider) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}

// The payment provider to configure.
type CustomerNewParamsPaymentConfigurationPaymentProvidersProviderType string

const (
CustomerNewParamsPaymentConfigurationPaymentProvidersProviderTypeStripe CustomerNewParamsPaymentConfigurationPaymentProvidersProviderType = "stripe"
)

func (r CustomerNewParamsPaymentConfigurationPaymentProvidersProviderType) IsKnown() bool {
switch r {
case CustomerNewParamsPaymentConfigurationPaymentProvidersProviderTypeStripe:
return true
}
return false
}

// This is used for creating charges or invoices in an external system via Orb.
// When not in test mode, the connection must first be configured in the Orb
// webapp.
Expand Down Expand Up @@ -1143,6 +1259,9 @@ type CustomerUpdateParams struct {
Metadata param.Field[map[string]string] `json:"metadata"`
// The full name of the customer
Name param.Field[string] `json:"name"`
// Payment configuration for the customer, applicable when using Orb Invoicing with
// a supported payment provider such as Stripe.
PaymentConfiguration param.Field[CustomerUpdateParamsPaymentConfiguration] `json:"payment_configuration"`
// This is used for creating charges or invoices in an external system via Orb.
// When not in test mode:
//
Expand Down Expand Up @@ -1308,6 +1427,47 @@ func (r CustomerUpdateParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}

// Payment configuration for the customer, applicable when using Orb Invoicing with
// a supported payment provider such as Stripe.
type CustomerUpdateParamsPaymentConfiguration struct {
// Provider-specific payment configuration.
PaymentProviders param.Field[[]CustomerUpdateParamsPaymentConfigurationPaymentProvider] `json:"payment_providers"`
}

func (r CustomerUpdateParamsPaymentConfiguration) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}

type CustomerUpdateParamsPaymentConfigurationPaymentProvider struct {
// The payment provider to configure.
ProviderType param.Field[CustomerUpdateParamsPaymentConfigurationPaymentProvidersProviderType] `json:"provider_type,required"`
// List of Stripe payment method types to exclude for this customer. Excluded
// payment methods will not be available for the customer to select during payment,
// and will not be used for auto-collection. If a customer's default payment method
// becomes excluded, Orb will attempt to use the next available compatible payment
// method for auto-collection.
ExcludedPaymentMethodTypes param.Field[[]string] `json:"excluded_payment_method_types"`
}

func (r CustomerUpdateParamsPaymentConfigurationPaymentProvider) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}

// The payment provider to configure.
type CustomerUpdateParamsPaymentConfigurationPaymentProvidersProviderType string

const (
CustomerUpdateParamsPaymentConfigurationPaymentProvidersProviderTypeStripe CustomerUpdateParamsPaymentConfigurationPaymentProvidersProviderType = "stripe"
)

func (r CustomerUpdateParamsPaymentConfigurationPaymentProvidersProviderType) IsKnown() bool {
switch r {
case CustomerUpdateParamsPaymentConfigurationPaymentProvidersProviderTypeStripe:
return true
}
return false
}

// This is used for creating charges or invoices in an external system via Orb.
// When not in test mode:
//
Expand Down Expand Up @@ -1520,6 +1680,9 @@ type CustomerUpdateByExternalIDParams struct {
Metadata param.Field[map[string]string] `json:"metadata"`
// The full name of the customer
Name param.Field[string] `json:"name"`
// Payment configuration for the customer, applicable when using Orb Invoicing with
// a supported payment provider such as Stripe.
PaymentConfiguration param.Field[CustomerUpdateByExternalIDParamsPaymentConfiguration] `json:"payment_configuration"`
// This is used for creating charges or invoices in an external system via Orb.
// When not in test mode:
//
Expand Down Expand Up @@ -1685,6 +1848,47 @@ func (r CustomerUpdateByExternalIDParams) MarshalJSON() (data []byte, err error)
return apijson.MarshalRoot(r)
}

// Payment configuration for the customer, applicable when using Orb Invoicing with
// a supported payment provider such as Stripe.
type CustomerUpdateByExternalIDParamsPaymentConfiguration struct {
// Provider-specific payment configuration.
PaymentProviders param.Field[[]CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvider] `json:"payment_providers"`
}

func (r CustomerUpdateByExternalIDParamsPaymentConfiguration) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}

type CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvider struct {
// The payment provider to configure.
ProviderType param.Field[CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvidersProviderType] `json:"provider_type,required"`
// List of Stripe payment method types to exclude for this customer. Excluded
// payment methods will not be available for the customer to select during payment,
// and will not be used for auto-collection. If a customer's default payment method
// becomes excluded, Orb will attempt to use the next available compatible payment
// method for auto-collection.
ExcludedPaymentMethodTypes param.Field[[]string] `json:"excluded_payment_method_types"`
}

func (r CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvider) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}

// The payment provider to configure.
type CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvidersProviderType string

const (
CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvidersProviderTypeStripe CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvidersProviderType = "stripe"
)

func (r CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvidersProviderType) IsKnown() bool {
switch r {
case CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvidersProviderTypeStripe:
return true
}
return false
}

// This is used for creating charges or invoices in an external system via Orb.
// When not in test mode:
//
Expand Down
22 changes: 20 additions & 2 deletions customer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ func TestCustomerNewWithOptionalParams(t *testing.T) {
Metadata: orb.F(map[string]string{
"foo": "string",
}),
PaymentConfiguration: orb.F(orb.CustomerNewParamsPaymentConfiguration{
PaymentProviders: orb.F([]orb.CustomerNewParamsPaymentConfigurationPaymentProvider{{
ProviderType: orb.F(orb.CustomerNewParamsPaymentConfigurationPaymentProvidersProviderTypeStripe),
ExcludedPaymentMethodTypes: orb.F([]string{"string"}),
}}),
}),
PaymentProvider: orb.F(orb.CustomerNewParamsPaymentProviderQuickbooks),
PaymentProviderID: orb.F("payment_provider_id"),
ReportingConfiguration: orb.F(orb.NewReportingConfigurationParam{
Expand Down Expand Up @@ -138,7 +144,13 @@ func TestCustomerUpdateWithOptionalParams(t *testing.T) {
Metadata: orb.F(map[string]string{
"foo": "string",
}),
Name: orb.F("name"),
Name: orb.F("name"),
PaymentConfiguration: orb.F(orb.CustomerUpdateParamsPaymentConfiguration{
PaymentProviders: orb.F([]orb.CustomerUpdateParamsPaymentConfigurationPaymentProvider{{
ProviderType: orb.F(orb.CustomerUpdateParamsPaymentConfigurationPaymentProvidersProviderTypeStripe),
ExcludedPaymentMethodTypes: orb.F([]string{"string"}),
}}),
}),
PaymentProvider: orb.F(orb.CustomerUpdateParamsPaymentProviderQuickbooks),
PaymentProviderID: orb.F("payment_provider_id"),
ReportingConfiguration: orb.F(orb.NewReportingConfigurationParam{
Expand Down Expand Up @@ -358,7 +370,13 @@ func TestCustomerUpdateByExternalIDWithOptionalParams(t *testing.T) {
Metadata: orb.F(map[string]string{
"foo": "string",
}),
Name: orb.F("name"),
Name: orb.F("name"),
PaymentConfiguration: orb.F(orb.CustomerUpdateByExternalIDParamsPaymentConfiguration{
PaymentProviders: orb.F([]orb.CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvider{{
ProviderType: orb.F(orb.CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvidersProviderTypeStripe),
ExcludedPaymentMethodTypes: orb.F([]string{"string"}),
}}),
}),
PaymentProvider: orb.F(orb.CustomerUpdateByExternalIDParamsPaymentProviderQuickbooks),
PaymentProviderID: orb.F("payment_provider_id"),
ReportingConfiguration: orb.F(orb.NewReportingConfigurationParam{
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package internal

const PackageVersion = "1.46.0" // x-release-please-version
const PackageVersion = "1.47.0" // x-release-please-version