From acbe394006e3284c37a76030b589d96ee0004218 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 12 Jul 2023 11:04:55 -0700 Subject: [PATCH] Update OpenAPI for e484958d4ad2e1926cc363268528c17ac05c7762 (#1096) Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- api/openapi-spec/spec3.sdk.json | 392 ++++++++++++++++++++++++++++++++ pkg/cmd/resources_cmds.go | 12 + pkg/proxy/events_list.go | 1 + 3 files changed, 405 insertions(+) diff --git a/api/openapi-spec/spec3.sdk.json b/api/openapi-spec/spec3.sdk.json index dd5a25f9c..1142a4358 100644 --- a/api/openapi-spec/spec3.sdk.json +++ b/api/openapi-spec/spec3.sdk.json @@ -1821,6 +1821,7 @@ "invalid_expiry_year", "invalid_number", "invalid_source_usage", + "invalid_tax_location", "invoice_no_customer_line_items", "invoice_no_payment_method_types", "invoice_no_subscription_line_items", @@ -28152,6 +28153,12 @@ "payment_method_details_afterpay_clearpay": { "description": "", "properties": { + "order_id": { + "description": "The Afterpay order ID associated with this payment intent.", + "maxLength": 5000, + "nullable": true, + "type": "string" + }, "reference": { "description": "Order identifier shown to the merchant in Afterpay’s online portal.", "maxLength": 5000, @@ -28160,6 +28167,7 @@ } }, "required": [ + "order_id", "reference" ], "title": "payment_method_details_afterpay_clearpay", @@ -44806,6 +44814,86 @@ ] } }, + "tax.settings": { + "description": "You can use Tax `Settings` to manage configurations used by Stripe Tax calculations.\n\nRelated guide: [Using the Settings API](https://stripe.com/docs/tax/settings-api)", + "properties": { + "defaults": { + "$ref": "#/components/schemas/tax_product_resource_tax_settings_defaults" + }, + "head_office": { + "anyOf": [ + { + "$ref": "#/components/schemas/tax_product_resource_tax_settings_head_office" + } + ], + "description": "The place where your business is located.", + "nullable": true + }, + "livemode": { + "description": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.", + "type": "boolean" + }, + "object": { + "description": "String representing the object's type. Objects of the same type share the same value.", + "enum": [ + "tax.settings" + ], + "type": "string" + }, + "status": { + "description": "The `active` status indicates you have all required settings to calculate tax. A status can transition out of `active` when new required settings are introduced.", + "enum": [ + "active", + "pending" + ], + "type": "string" + }, + "status_details": { + "$ref": "#/components/schemas/tax_product_resource_tax_settings_status_details" + } + }, + "required": [ + "defaults", + "head_office", + "livemode", + "object", + "status", + "status_details" + ], + "title": "TaxProductResourceTaxSettings", + "type": "object", + "x-expandableFields": [ + "defaults", + "head_office", + "status_details" + ], + "x-resourceId": "tax.settings", + "x-stripeOperations": [ + { + "method_name": "retrieve", + "method_on": "service", + "method_type": "retrieve", + "operation": "get", + "path": "/v1/tax/settings" + }, + { + "method_name": "update", + "method_on": "service", + "method_type": "update", + "operation": "post", + "path": "/v1/tax/settings" + } + ], + "x-stripeResource": { + "class_name": "Settings", + "in_package": "Tax", + "inner_classes": [ + "tax_product_resource_tax_settings_defaults", + "tax_product_resource_tax_settings_head_office", + "tax_product_resource_tax_settings_status_details" + ] + } + }, "tax.transaction": { "description": "A Tax Transaction records the tax collected from or refunded to your customer.\n\nRelated guide: [Calculate tax in your custom payment flow](https://stripe.com/docs/tax/custom#tax-transaction)", "properties": { @@ -45763,6 +45851,8 @@ "tax_type": { "description": "The tax type, such as `vat` or `sales_tax`.", "enum": [ + "amusement_tax", + "communications_tax", "gst", "hst", "igst", @@ -45981,6 +46071,8 @@ "tax_type": { "description": "The tax type, such as `vat` or `sales_tax`.", "enum": [ + "amusement_tax", + "communications_tax", "gst", "hst", "igst", @@ -46010,6 +46102,118 @@ "in_class": "tax_product_resource_tax_breakdown" } }, + "tax_product_resource_tax_settings_defaults": { + "description": "", + "properties": { + "tax_behavior": { + "description": "Default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) used to specify whether the price is considered inclusive of taxes or exclusive of taxes. If the item's price has a tax behavior set, it will take precedence over the default tax behavior.", + "enum": [ + "exclusive", + "inclusive", + "inferred_by_currency" + ], + "nullable": true, + "type": "string" + }, + "tax_code": { + "description": "Default [tax code](https://stripe.com/docs/tax/tax-categories) used to classify your products and prices.", + "maxLength": 5000, + "nullable": true, + "type": "string" + } + }, + "required": [ + "tax_behavior", + "tax_code" + ], + "title": "TaxProductResourceTaxSettingsDefaults", + "type": "object", + "x-expandableFields": [], + "x-stripeResource": { + "class_name": "Defaults", + "in_class": "tax.settings" + } + }, + "tax_product_resource_tax_settings_head_office": { + "description": "", + "properties": { + "address": { + "$ref": "#/components/schemas/address" + } + }, + "required": [ + "address" + ], + "title": "TaxProductResourceTaxSettingsHeadOffice", + "type": "object", + "x-expandableFields": [ + "address" + ], + "x-stripeResource": { + "class_name": "HeadOffice", + "in_class": "tax.settings" + } + }, + "tax_product_resource_tax_settings_status_details": { + "description": "", + "properties": { + "active": { + "$ref": "#/components/schemas/tax_product_resource_tax_settings_status_details_resource_active" + }, + "pending": { + "$ref": "#/components/schemas/tax_product_resource_tax_settings_status_details_resource_pending" + } + }, + "title": "TaxProductResourceTaxSettingsStatusDetails", + "type": "object", + "x-expandableFields": [ + "active", + "pending" + ], + "x-stripeResource": { + "class_name": "StatusDetails", + "in_class": "tax.settings", + "inner_classes": [ + "tax_product_resource_tax_settings_status_details_resource_active", + "tax_product_resource_tax_settings_status_details_resource_pending" + ] + } + }, + "tax_product_resource_tax_settings_status_details_resource_active": { + "description": "", + "properties": {}, + "title": "TaxProductResourceTaxSettingsStatusDetailsResourceActive", + "type": "object", + "x-expandableFields": [], + "x-stripeResource": { + "class_name": "Active", + "in_class": "tax_product_resource_tax_settings_status_details" + } + }, + "tax_product_resource_tax_settings_status_details_resource_pending": { + "description": "", + "properties": { + "missing_fields": { + "description": "The list of missing fields that are required to perform calculations. It includes the entry `head_office` when the status is `pending`. It is recommended to set the optional values even if they aren't listed as required for calculating taxes. Calculations can fail if missing fields aren't explicitly provided on every call.", + "items": { + "maxLength": 5000, + "type": "string" + }, + "nullable": true, + "type": "array" + } + }, + "required": [ + "missing_fields" + ], + "title": "TaxProductResourceTaxSettingsStatusDetailsResourcePending", + "type": "object", + "x-expandableFields": [], + "x-stripeResource": { + "class_name": "Pending", + "in_class": "tax_product_resource_tax_settings_status_details" + } + }, "tax_product_resource_tax_transaction_line_item_resource_reversal": { "description": "", "properties": { @@ -120315,6 +120519,192 @@ } } }, + "/v1/tax/settings": { + "get": { + "description": "

Retrieves Tax Settings for a merchant.

", + "operationId": "GetTaxSettings", + "parameters": [ + { + "description": "Specifies which fields in the response should be expanded.", + "explode": true, + "in": "query", + "name": "expand", + "required": false, + "schema": { + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + "style": "deepObject" + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "encoding": {}, + "schema": { + "additionalProperties": false, + "properties": {}, + "type": "object" + } + } + }, + "required": false + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/tax.settings" + } + } + }, + "description": "Successful response." + }, + "default": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } + } + }, + "description": "Error response." + } + } + }, + "post": { + "description": "

Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set.

", + "operationId": "PostTaxSettings", + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "encoding": { + "defaults": { + "explode": true, + "style": "deepObject" + }, + "expand": { + "explode": true, + "style": "deepObject" + }, + "head_office": { + "explode": true, + "style": "deepObject" + } + }, + "schema": { + "additionalProperties": false, + "properties": { + "defaults": { + "description": "Default configuration to be used on Stripe Tax calculations.", + "properties": { + "tax_behavior": { + "description": "Specifies the default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) to be used when the item's price has unspecified tax behavior. One of inclusive, exclusive, or inferred_by_currency. Once specified, it cannot be changed back to null.", + "enum": [ + "exclusive", + "inclusive", + "inferred_by_currency" + ], + "type": "string" + }, + "tax_code": { + "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID.", + "type": "string" + } + }, + "title": "defaults_param", + "type": "object" + }, + "expand": { + "description": "Specifies which fields in the response should be expanded.", + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + "head_office": { + "description": "The place where your business is located.", + "properties": { + "address": { + "description": "The location of the business for tax purposes.", + "properties": { + "city": { + "description": "City, district, suburb, town, or village.", + "maxLength": 5000, + "type": "string" + }, + "country": { + "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", + "maxLength": 5000, + "type": "string" + }, + "line1": { + "description": "Address line 1 (e.g., street, PO Box, or company name).", + "maxLength": 5000, + "type": "string" + }, + "line2": { + "description": "Address line 2 (e.g., apartment, suite, unit, or building).", + "maxLength": 5000, + "type": "string" + }, + "postal_code": { + "description": "ZIP or postal code.", + "maxLength": 5000, + "type": "string" + }, + "state": { + "description": "State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: \"NY\" or \"TX\".", + "maxLength": 5000, + "type": "string" + } + }, + "title": "validated_country_address", + "type": "object" + } + }, + "required": [ + "address" + ], + "title": "head_office_param", + "type": "object" + } + }, + "type": "object" + } + } + }, + "required": false + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/tax.settings" + } + } + }, + "description": "Successful response." + }, + "default": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } + } + }, + "description": "Error response." + } + } + } + }, "/v1/tax/transactions/create_from_calculation": { "post": { "description": "

Creates a Tax Transaction from a calculation.

", @@ -133550,6 +133940,7 @@ "subscription_schedule.expiring", "subscription_schedule.released", "subscription_schedule.updated", + "tax.settings.updated", "tax_rate.created", "tax_rate.updated", "terminal.reader.action_failed", @@ -134009,6 +134400,7 @@ "subscription_schedule.expiring", "subscription_schedule.released", "subscription_schedule.updated", + "tax.settings.updated", "tax_rate.created", "tax_rate.updated", "terminal.reader.action_failed", diff --git a/pkg/cmd/resources_cmds.go b/pkg/cmd/resources_cmds.go index 0170cf1e6..7a351880d 100644 --- a/pkg/cmd/resources_cmds.go +++ b/pkg/cmd/resources_cmds.go @@ -111,6 +111,7 @@ func addAllResourcesCmds(rootCmd *cobra.Command) { rReportingReportRunsCmd := resource.NewResourceCmd(nsReportingCmd.Cmd, "report_runs") rReportingReportTypesCmd := resource.NewResourceCmd(nsReportingCmd.Cmd, "report_types") rTaxCalculationsCmd := resource.NewResourceCmd(nsTaxCmd.Cmd, "calculations") + rTaxSettingssCmd := resource.NewResourceCmd(nsTaxCmd.Cmd, "settingss") rTaxTransactionsCmd := resource.NewResourceCmd(nsTaxCmd.Cmd, "transactions") rTerminalConfigurationsCmd := resource.NewResourceCmd(nsTerminalCmd.Cmd, "configurations") rTerminalConnectionTokensCmd := resource.NewResourceCmd(nsTerminalCmd.Cmd, "connection_tokens") @@ -3238,6 +3239,17 @@ func addAllResourcesCmds(rootCmd *cobra.Command) { "limit": "integer", "starting_after": "string", }, &Config) + resource.NewOperationCmd(rTaxSettingssCmd.Cmd, "retrieve", "/v1/tax/settings", http.MethodGet, map[string]string{}, &Config) + resource.NewOperationCmd(rTaxSettingssCmd.Cmd, "update", "/v1/tax/settings", http.MethodPost, map[string]string{ + "defaults.tax_behavior": "string", + "defaults.tax_code": "string", + "head_office.address.city": "string", + "head_office.address.country": "string", + "head_office.address.line1": "string", + "head_office.address.line2": "string", + "head_office.address.postal_code": "string", + "head_office.address.state": "string", + }, &Config) resource.NewOperationCmd(rTaxTransactionsCmd.Cmd, "create_from_calculation", "/v1/tax/transactions/create_from_calculation", http.MethodPost, map[string]string{ "calculation": "string", "reference": "string", diff --git a/pkg/proxy/events_list.go b/pkg/proxy/events_list.go index c2cc66a49..ba04ab434 100644 --- a/pkg/proxy/events_list.go +++ b/pkg/proxy/events_list.go @@ -181,6 +181,7 @@ var validEvents = map[string]bool{ "subscription_schedule.expiring": true, "subscription_schedule.released": true, "subscription_schedule.updated": true, + "tax.settings.updated": true, "tax_rate.created": true, "tax_rate.updated": true, "terminal.reader.action_failed": true,