Skip to content

Commit d5eba45

Browse files
authored
Update openapi spec (4/22/2020) (stripe#426)
* Update openapi spec * Empty commit
1 parent 5723d92 commit d5eba45

File tree

2 files changed

+153
-3
lines changed

2 files changed

+153
-3
lines changed

api/openapi-spec/spec3.sdk.json

Lines changed: 146 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,6 +2584,82 @@
25842584
"in_class": "payment_method"
25852585
}
25862586
},
2587+
"billing_portal.session": {
2588+
"description": "A Session describes the instantiation of the Self-serve Portal for\na particular customer. By visiting the Self-serve Portal's URL, the customer\ncan manage their subscriptions and view their invoice payment history. For security reasons,\nSessions are short-lived and will expire if the customer does not visit the URL.\nCreate Sessions on-demand.\n\nRelated guide: [Self-serve Portal](https://stripe.com/docs/billing/subscriptions/integrating-self-serve).",
2589+
"properties": {
2590+
"created": {
2591+
"description": "Time at which the object was created. Measured in seconds since the Unix epoch.",
2592+
"format": "unix-time",
2593+
"type": "integer"
2594+
},
2595+
"customer": {
2596+
"description": "The ID of the customer for this session.",
2597+
"maxLength": 5000,
2598+
"type": "string"
2599+
},
2600+
"id": {
2601+
"description": "Unique identifier for the object.",
2602+
"maxLength": 5000,
2603+
"type": "string"
2604+
},
2605+
"livemode": {
2606+
"description": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.",
2607+
"type": "boolean"
2608+
},
2609+
"object": {
2610+
"description": "String representing the object's type. Objects of the same type share the same value.",
2611+
"enum": [
2612+
"billing_portal.session"
2613+
],
2614+
"type": "string"
2615+
},
2616+
"return_url": {
2617+
"description": "The URL to which Stripe should send customers when they click on the link to return to your website.",
2618+
"maxLength": 5000,
2619+
"type": "string"
2620+
},
2621+
"url": {
2622+
"description": "The short-lived URL of the session giving customers access to the self-serve portal.",
2623+
"maxLength": 5000,
2624+
"type": "string"
2625+
}
2626+
},
2627+
"required": [
2628+
"created",
2629+
"customer",
2630+
"id",
2631+
"livemode",
2632+
"object",
2633+
"return_url",
2634+
"url"
2635+
],
2636+
"title": "PortalSession",
2637+
"type": "object",
2638+
"x-expandableFields": [
2639+
2640+
],
2641+
"x-resourceId": "billing_portal.session",
2642+
"x-stripeOperations": [
2643+
{
2644+
"method_name": "create",
2645+
"method_on": "class",
2646+
"method_type": "create",
2647+
"operation": "post",
2648+
"path": "/v1/billing_portal/sessions"
2649+
},
2650+
{
2651+
"method_name": "create",
2652+
"method_on": "service",
2653+
"method_type": "create",
2654+
"operation": "post",
2655+
"path": "/v1/billing_portal/sessions"
2656+
}
2657+
],
2658+
"x-stripeResource": {
2659+
"class_name": "Session",
2660+
"in_package": "BillingPortal"
2661+
}
2662+
},
25872663
"bitcoin_receiver": {
25882664
"description": "",
25892665
"properties": {
@@ -20929,10 +21005,10 @@
2092921005
}
2093021006
},
2093121007
"plan": {
20932-
"description": "Plans define the base price, currency, and billing cycle for subscriptions.\nFor example, you might have a <currency>5</currency>/month plan\nthat provides limited access to your products, and a\n<currency>15</currency>/month plan that allows full access.\n\nRelated guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and plans](https://stripe.com/docs/billing/subscriptions/products-and-plans).",
21008+
"description": "Plans define the base price, currency, and billing cycle for subscriptions.\nFor example, you might have a $5/month plan\nthat provides limited access to your products, and a\n$15/month plan that allows full access.\n\nRelated guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and plans](https://stripe.com/docs/billing/subscriptions/products-and-plans).",
2093321009
"properties": {
2093421010
"active": {
20935-
"description": "Whether the price can be used for new purchases.",
21011+
"description": "Whether the plan can be used for new purchases.",
2093621012
"type": "boolean"
2093721013
},
2093821014
"aggregate_usage": {
@@ -20958,7 +21034,7 @@
2095821034
"type": "string"
2095921035
},
2096021036
"billing_scheme": {
20961-
"description": "Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes.",
21037+
"description": "Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes.",
2096221038
"enum": [
2096321039
"per_unit",
2096421040
"tiered"
@@ -36505,6 +36581,73 @@
3650536581
}
3650636582
}
3650736583
},
36584+
"/v1/billing_portal/sessions": {
36585+
"post": {
36586+
"description": "<p>Creates a session of the Self-service Portal.</p>",
36587+
"operationId": "PostBillingPortalSessions",
36588+
"requestBody": {
36589+
"content": {
36590+
"application/x-www-form-urlencoded": {
36591+
"encoding": {
36592+
"expand": {
36593+
"explode": true,
36594+
"style": "deepObject"
36595+
}
36596+
},
36597+
"schema": {
36598+
"additionalProperties": false,
36599+
"properties": {
36600+
"customer": {
36601+
"description": "The ID of an existing customer.",
36602+
"maxLength": 5000,
36603+
"type": "string"
36604+
},
36605+
"expand": {
36606+
"description": "Specifies which fields in the response should be expanded.",
36607+
"items": {
36608+
"maxLength": 5000,
36609+
"type": "string"
36610+
},
36611+
"type": "array"
36612+
},
36613+
"return_url": {
36614+
"description": "The URL to which Stripe should send customers when they click on the link to return to your website. This field is required if a default return URL has not been configured for the portal.",
36615+
"type": "string"
36616+
}
36617+
},
36618+
"required": [
36619+
"customer"
36620+
],
36621+
"type": "object"
36622+
}
36623+
}
36624+
},
36625+
"required": true
36626+
},
36627+
"responses": {
36628+
"200": {
36629+
"content": {
36630+
"application/json": {
36631+
"schema": {
36632+
"$ref": "#/components/schemas/billing_portal.session"
36633+
}
36634+
}
36635+
},
36636+
"description": "Successful response."
36637+
},
36638+
"default": {
36639+
"content": {
36640+
"application/json": {
36641+
"schema": {
36642+
"$ref": "#/components/schemas/error"
36643+
}
36644+
}
36645+
},
36646+
"description": "Error response."
36647+
}
36648+
}
36649+
}
36650+
},
3650836651
"/v1/bitcoin/receivers": {
3650936652
"get": {
3651036653
"deprecated": true,

pkg/cmd/resources_cmds.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
func addAllResourcesCmds(rootCmd *cobra.Command) {
1414
// Namespace commands
1515
_ = resource.NewNamespaceCmd(rootCmd, "")
16+
nsBillingPortalCmd := resource.NewNamespaceCmd(rootCmd, "billing_portal")
1617
nsCheckoutCmd := resource.NewNamespaceCmd(rootCmd, "checkout")
1718
nsIssuingCmd := resource.NewNamespaceCmd(rootCmd, "issuing")
1819
nsRadarCmd := resource.NewNamespaceCmd(rootCmd, "radar")
@@ -78,6 +79,8 @@ func addAllResourcesCmds(rootCmd *cobra.Command) {
7879
rUsageRecordsCmd := resource.NewResourceCmd(rootCmd, "usage_records")
7980
rWebhookEndpointsCmd := resource.NewResourceCmd(rootCmd, "webhook_endpoints")
8081

82+
rBillingPortalSessionsCmd := resource.NewResourceCmd(nsBillingPortalCmd.Cmd, "sessions")
83+
8184
rCheckoutSessionsCmd := resource.NewResourceCmd(nsCheckoutCmd.Cmd, "sessions")
8285

8386
rIssuingAuthorizationsCmd := resource.NewResourceCmd(nsIssuingCmd.Cmd, "authorizations")
@@ -1149,6 +1152,10 @@ func addAllResourcesCmds(rootCmd *cobra.Command) {
11491152
"disabled": "boolean",
11501153
"url": "string",
11511154
}, &Config)
1155+
resource.NewOperationCmd(rBillingPortalSessionsCmd.Cmd, "create", "/v1/billing_portal/sessions", http.MethodPost, map[string]string{
1156+
"customer": "string",
1157+
"return_url": "string",
1158+
}, &Config)
11521159
resource.NewOperationCmd(rCheckoutSessionsCmd.Cmd, "create", "/v1/checkout/sessions", http.MethodPost, map[string]string{
11531160
"billing_address_collection": "string",
11541161
"cancel_url": "string",

0 commit comments

Comments
 (0)