diff --git a/openapi/spec3.beta.sdk.json b/openapi/spec3.beta.sdk.json index 6cc86296..2a09fceb 100644 --- a/openapi/spec3.beta.sdk.json +++ b/openapi/spec3.beta.sdk.json @@ -4362,6 +4362,199 @@ "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", + "filter", + "id", + "livemode", + "object", + "status", + "title", + "usage_threshold_config" + ], + "title": "ThresholdsResourceAlert", + "type": "object", + "x-expandableFields": [ + "filter", + "usage_threshold_config" + ], + "x-resourceId": "billing.alert", + "x-stripeOperations": [ + { + "method_name": "list", + "method_on": "service", + "method_type": "list", + "operation": "get", + "path": "/v1/billing/alerts" + }, + { + "method_name": "retrieve", + "method_on": "service", + "method_type": "retrieve", + "operation": "get", + "path": "/v1/billing/alerts/{id}" + }, + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/billing/alerts" + }, + { + "method_name": "activate", + "method_on": "service", + "method_type": "custom", + "operation": "post", + "path": "/v1/billing/alerts/{id}/activate" + }, + { + "method_name": "archive", + "method_on": "service", + "method_type": "custom", + "operation": "post", + "path": "/v1/billing/alerts/{id}/archive" + }, + { + "method_name": "deactivate", + "method_on": "service", + "method_type": "custom", + "operation": "post", + "path": "/v1/billing/alerts/{id}/deactivate" + } + ], + "x-stripeResource": { + "class_name": "Alert", + "has_collection_class": true, + "in_package": "Billing" + } + }, + "billing.alert.triggered": { + "description": "Occurs whenever your custom alert threshold is met.", + "properties": { + "object": { + "$ref": "#/components/schemas/billing.alert_triggered" + } + }, + "required": [ + "object" + ], + "type": "object", + "x-expandableFields": [], + "x-stripeEvent": { + "type": "billing.alert.triggered" + } + }, + "billing.alert_triggered": { + "description": "", + "properties": { + "alert": { + "$ref": "#/components/schemas/billing.alert" + }, + "created": { + "description": "Time at which the object was created. Measured in seconds since the Unix epoch.", + "format": "unix-time", + "type": "integer" + }, + "customer": { + "description": "ID of customer for which the alert triggered", + "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_triggered" + ], + "type": "string" + }, + "value": { + "description": "The value triggering the alert", + "type": "integer" + } + }, + "required": [ + "alert", + "created", + "customer", + "livemode", + "object", + "value" + ], + "title": "ThresholdsResourceAlert", + "type": "object", + "x-expandableFields": [ + "alert" + ], + "x-stripeResource": { + "class_name": "AlertTriggered", + "in_package": "Billing" + } + }, "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": { @@ -68072,6 +68265,85 @@ "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" + } + ] + } + } + }, + "required": [ + "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": { @@ -82973,6 +83245,542 @@ } } }, + "/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": { + "description": "Limit the scope to this alert only to this 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": { + "description": "Defines at which value the alert will fire.", + "type": "integer" + }, + "meter": { + "description": "The [Billing Meter](/api/billing/meter) ID whose usage is monitored.", + "maxLength": 5000, + "type": "string" + }, + "recurrence": { + "description": "Whether the alert should only fire only once, or once per billing cycle.", + "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/margins": { "get": { "description": "

Retrieve a list of your margins.

", diff --git a/openapi/spec3.beta.sdk.yaml b/openapi/spec3.beta.sdk.yaml index 239bd784..82788f6c 100644 --- a/openapi/spec3.beta.sdk.yaml +++ b/openapi/spec3.beta.sdk.yaml @@ -4163,6 +4163,164 @@ components: title: BankConnectionsResourceTransactionResourceStatusTransitions 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 + - filter + - id + - livemode + - object + - status + - title + - usage_threshold_config + title: ThresholdsResourceAlert + type: object + x-expandableFields: + - filter + - usage_threshold_config + x-resourceId: billing.alert + x-stripeOperations: + - method_name: list + method_on: service + method_type: list + operation: get + path: /v1/billing/alerts + - method_name: retrieve + method_on: service + method_type: retrieve + operation: get + path: '/v1/billing/alerts/{id}' + - method_name: create + method_on: service + method_type: create + operation: post + path: /v1/billing/alerts + - method_name: activate + method_on: service + method_type: custom + operation: post + path: '/v1/billing/alerts/{id}/activate' + - method_name: archive + method_on: service + method_type: custom + operation: post + path: '/v1/billing/alerts/{id}/archive' + - method_name: deactivate + method_on: service + method_type: custom + operation: post + path: '/v1/billing/alerts/{id}/deactivate' + x-stripeResource: + class_name: Alert + has_collection_class: true + in_package: Billing + billing.alert.triggered: + description: Occurs whenever your custom alert threshold is met. + properties: + object: + $ref: '#/components/schemas/billing.alert_triggered' + required: + - object + type: object + x-expandableFields: [] + x-stripeEvent: + type: billing.alert.triggered + billing.alert_triggered: + description: '' + properties: + alert: + $ref: '#/components/schemas/billing.alert' + created: + description: >- + Time at which the object was created. Measured in seconds since the + Unix epoch. + format: unix-time + type: integer + customer: + description: ID of customer for which the alert triggered + 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_triggered + type: string + value: + description: The value triggering the alert + type: integer + required: + - alert + - created + - customer + - livemode + - object + - value + title: ThresholdsResourceAlert + type: object + x-expandableFields: + - alert + x-stripeResource: + class_name: AlertTriggered + in_package: Billing billing.meter: description: >- A billing meter is a resource that allows you to track usage of a @@ -61665,6 +61823,56 @@ components: title: three_d_secure_usage 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' + required: + - 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 @@ -75546,6 +75754,389 @@ paths: schema: $ref: '#/components/schemas/error' description: Error response. + /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: + description: Limit the scope to this alert only to this 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: + description: Defines at which value the alert will fire. + type: integer + meter: + description: >- + The [Billing Meter](/api/billing/meter) ID whose usage + is monitored. + maxLength: 5000 + type: string + recurrence: + description: >- + Whether the alert should only fire only once, or once + per billing cycle. + 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/margins: get: description:

Retrieve a list of your margins.