diff --git a/embedded/openapi/spec3.json b/embedded/openapi/spec3.json index 7189deb1..e3035285 100644 --- a/embedded/openapi/spec3.json +++ b/embedded/openapi/spec3.json @@ -3226,6 +3226,81 @@ "type": "object", "x-expandableFields": [] }, + "billing.alert": { + "description": "A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests.", + "properties": { + "alert_type": { + "description": "Defines the type of the alert.", + "enum": [ + "usage_threshold" + ], + "type": "string" + }, + "filter": { + "anyOf": [ + { + "$ref": "#/components/schemas/thresholds_resource_alert_filter" + } + ], + "description": "Limits the scope of the alert to a specific [customer](https://stripe.com/docs/api/customers).", + "nullable": true + }, + "id": { + "description": "Unique identifier for the object.", + "maxLength": 5000, + "type": "string" + }, + "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": [ + "billing.alert" + ], + "type": "string" + }, + "status": { + "description": "Status of the alert. This can be active, inactive or archived.", + "enum": [ + "active", + "archived", + "inactive" + ], + "nullable": true, + "type": "string" + }, + "title": { + "description": "Title of the alert.", + "maxLength": 5000, + "type": "string" + }, + "usage_threshold_config": { + "anyOf": [ + { + "$ref": "#/components/schemas/thresholds_resource_usage_threshold_config" + } + ], + "description": "Encapsulates configuration of the alert to monitor usage on a specific [Billing Meter](https://stripe.com/docs/api/billing/meter).", + "nullable": true + } + }, + "required": [ + "alert_type", + "id", + "livemode", + "object", + "title" + ], + "title": "ThresholdsResourceAlert", + "type": "object", + "x-expandableFields": [ + "filter", + "usage_threshold_config" + ], + "x-resourceId": "billing.alert" + }, "billing.meter": { "description": "A billing meter is a resource that allows you to track usage of a particular event. For example, you might create a billing meter to track the number of API calls made by a particular user. You can then attach the billing meter to a price and attach the price to a subscription to charge the user for the number of API calls they make.", "properties": { @@ -47323,6 +47398,82 @@ "type": "object", "x-expandableFields": [] }, + "thresholds_resource_alert_filter": { + "description": "", + "properties": { + "customer": { + "anyOf": [ + { + "maxLength": 5000, + "type": "string" + }, + { + "$ref": "#/components/schemas/customer" + } + ], + "description": "Limit the scope of the alert to this customer ID", + "nullable": true, + "x-expansionResources": { + "oneOf": [ + { + "$ref": "#/components/schemas/customer" + } + ] + } + } + }, + "title": "ThresholdsResourceAlertFilter", + "type": "object", + "x-expandableFields": [ + "customer" + ] + }, + "thresholds_resource_usage_threshold_config": { + "description": "The usage threshold alert configuration enables setting up alerts for when a certain usage threshold on a specific meter is crossed.", + "properties": { + "gte": { + "description": "The value at which this alert will trigger.", + "type": "integer" + }, + "meter": { + "anyOf": [ + { + "maxLength": 5000, + "type": "string" + }, + { + "$ref": "#/components/schemas/billing.meter" + } + ], + "description": "The [Billing Meter](/api/billing/meter) ID whose usage is monitored.", + "x-expansionResources": { + "oneOf": [ + { + "$ref": "#/components/schemas/billing.meter" + } + ] + } + }, + "recurrence": { + "description": "Defines how the alert will behave.", + "enum": [ + "one_time" + ], + "type": "string", + "x-stripeBypassValidation": true + } + }, + "required": [ + "gte", + "meter", + "recurrence" + ], + "title": "ThresholdsResourceUsageThresholdConfig", + "type": "object", + "x-expandableFields": [ + "meter" + ] + }, "token": { "description": "Tokenization is the process Stripe uses to collect sensitive card or bank\naccount details, or personally identifiable information (PII), directly from\nyour customers in a secure manner. A token representing this information is\nreturned to your server to use. Use our\n[recommended payments integrations](https://stripe.com/docs/payments) to perform this process\non the client-side. This guarantees that no sensitive card data touches your server,\nand allows your integration to operate in a PCI-compliant way.\n\nIf you can't use client-side tokenization, you can also create tokens using\nthe API with either your publishable or secret API key. If\nyour integration uses this method, you're responsible for any PCI compliance\nthat it might require, and you must keep your secret API key safe. Unlike with\nclient-side tokenization, your customer's information isn't sent directly to\nStripe, so we can't determine how it's handled or stored.\n\nYou can't store or use tokens more than once. To store card or bank account\ninformation for later use, create [Customer](https://stripe.com/docs/api#customers)\nobjects or [External accounts](/api#external_accounts).\n[Radar](https://stripe.com/docs/radar), our integrated solution for automatic fraud protection,\nperforms best with integrations that use client-side tokenization.", "properties": { @@ -61598,6 +61749,538 @@ } } }, + "/v1/billing/alerts": { + "get": { + "description": "

Lists billing active and inactive alerts

", + "operationId": "GetBillingAlerts", + "parameters": [ + { + "description": "Filter results to only include this type of alert.", + "in": "query", + "name": "alert_type", + "required": false, + "schema": { + "enum": [ + "usage_threshold" + ], + "type": "string" + }, + "style": "form" + }, + { + "description": "A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.", + "in": "query", + "name": "ending_before", + "required": false, + "schema": { + "maxLength": 5000, + "type": "string" + }, + "style": "form" + }, + { + "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" + }, + { + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "type": "integer" + }, + "style": "form" + }, + { + "description": "Filter results to only include alerts with the given meter.", + "in": "query", + "name": "meter", + "required": false, + "schema": { + "maxLength": 5000, + "type": "string" + }, + "style": "form" + }, + { + "description": "A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.", + "in": "query", + "name": "starting_after", + "required": false, + "schema": { + "maxLength": 5000, + "type": "string" + }, + "style": "form" + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "encoding": {}, + "schema": { + "additionalProperties": false, + "properties": {}, + "type": "object" + } + } + }, + "required": false + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/billing.alert" + }, + "type": "array" + }, + "has_more": { + "description": "True if this list has another page of items after this one that can be fetched.", + "type": "boolean" + }, + "object": { + "description": "String representing the object's type. Objects of the same type share the same value. Always has the value `list`.", + "enum": [ + "list" + ], + "type": "string" + }, + "url": { + "description": "The URL where this list can be accessed.", + "maxLength": 5000, + "pattern": "^/v1/billing/alerts", + "type": "string" + } + }, + "required": [ + "data", + "has_more", + "object", + "url" + ], + "title": "ThresholdsResourceAlertList", + "type": "object", + "x-expandableFields": [ + "data" + ] + } + } + }, + "description": "Successful response." + }, + "default": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } + } + }, + "description": "Error response." + } + } + }, + "post": { + "description": "

Creates a billing alert

", + "operationId": "PostBillingAlerts", + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "encoding": { + "expand": { + "explode": true, + "style": "deepObject" + }, + "filter": { + "explode": true, + "style": "deepObject" + }, + "usage_threshold_config": { + "explode": true, + "style": "deepObject" + } + }, + "schema": { + "additionalProperties": false, + "properties": { + "alert_type": { + "description": "The type of alert to create.", + "enum": [ + "usage_threshold" + ], + "type": "string" + }, + "expand": { + "description": "Specifies which fields in the response should be expanded.", + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + }, + "filter": { + "description": "Filters to limit the scope of an alert.", + "properties": { + "customer": { + "maxLength": 5000, + "type": "string" + } + }, + "title": "alert_filter", + "type": "object" + }, + "title": { + "description": "The title of the alert.", + "maxLength": 256, + "type": "string" + }, + "usage_threshold_config": { + "description": "The configuration of the usage threshold.", + "properties": { + "gte": { + "type": "integer" + }, + "meter": { + "maxLength": 5000, + "type": "string" + }, + "recurrence": { + "enum": [ + "one_time" + ], + "type": "string", + "x-stripeBypassValidation": true + } + }, + "required": [ + "gte", + "recurrence" + ], + "title": "usage_threshold_config", + "type": "object" + } + }, + "required": [ + "alert_type", + "title" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/billing.alert" + } + } + }, + "description": "Successful response." + }, + "default": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } + } + }, + "description": "Error response." + } + } + } + }, + "/v1/billing/alerts/{id}": { + "get": { + "description": "

Retrieves a billing alert given an ID

", + "operationId": "GetBillingAlertsId", + "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" + }, + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "maxLength": 5000, + "type": "string" + }, + "style": "simple" + } + ], + "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/billing.alert" + } + } + }, + "description": "Successful response." + }, + "default": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } + } + }, + "description": "Error response." + } + } + } + }, + "/v1/billing/alerts/{id}/activate": { + "post": { + "description": "

Reactivates this alert, allowing it to trigger again.

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

Archives this alert, removing it from the list view and APIs. This is non-reversible.

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

Deactivates this alert, preventing it from triggering.

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

Creates a billing meter event adjustment

",