Retrieves the details of an account.
", - "operationId": "GetAccount", - "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/account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/account_links": { - "post": { - "description": "Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow.
", - "operationId": "PostAccountLinks", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "account": { - "description": "The identifier of the account to create an account link for.", - "maxLength": 5000, - "type": "string" - }, - "collect": { - "description": "Which information the platform needs to collect from the user. One of `currently_due` or `eventually_due`. Default is `currently_due`.", - "enum": [ - "currently_due", - "eventually_due" - ], - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "refresh_url": { - "description": "The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. If a new account link cannot be generated or the redirect fails you should display a useful error to the user.", - "type": "string" - }, - "return_url": { - "description": "The URL that the user will be redirected to upon leaving or completing the linked flow.", - "type": "string" - }, - "type": { - "description": "The type of account link the user is requesting. Possible values are `account_onboarding` or `account_update`.", - "enum": [ - "account_onboarding", - "account_update" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "required": [ - "account", - "type" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/account_link" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/accounts": { - "get": { - "description": "Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is empty.
", - "operationId": "GetAccounts", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": { - "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": "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": { - "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/account" - }, - "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/accounts", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "AccountList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "With Connect, you can create Stripe accounts for your users.\nTo do this, you’ll first need to register your platform.
", - "operationId": "PostAccounts", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "bank_account": { - "explode": true, - "style": "deepObject" - }, - "business_profile": { - "explode": true, - "style": "deepObject" - }, - "capabilities": { - "explode": true, - "style": "deepObject" - }, - "company": { - "explode": true, - "style": "deepObject" - }, - "documents": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "individual": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "settings": { - "explode": true, - "style": "deepObject" - }, - "tos_acceptance": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "account_token": { - "description": "An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account.", - "maxLength": 5000, - "type": "string" - }, - "bank_account": { - "anyOf": [ - { - "properties": { - "account_holder_name": { - "maxLength": 5000, - "type": "string" - }, - "account_holder_type": { - "enum": [ - "company", - "individual" - ], - "maxLength": 5000, - "type": "string" - }, - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "account_type": { - "enum": [ - "checking", - "futsu", - "savings", - "toza" - ], - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "currency": { - "type": "string" - }, - "object": { - "enum": [ - "bank_account" - ], - "maxLength": 5000, - "type": "string" - }, - "routing_number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "account_number", - "country" - ], - "title": "external_account_payout_bank_account", - "type": "object" - }, - { - "maxLength": 5000, - "type": "string" - } - ], - "description": "Either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details." - }, - "business_profile": { - "description": "Business information about the account.", - "properties": { - "mcc": { - "maxLength": 4, - "type": "string" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "product_description": { - "maxLength": 40000, - "type": "string" - }, - "support_address": { - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "support_email": { - "type": "string" - }, - "support_phone": { - "maxLength": 5000, - "type": "string" - }, - "support_url": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "url": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "business_profile_specs", - "type": "object" - }, - "business_type": { - "description": "The business type.", - "enum": [ - "company", - "government_entity", - "individual", - "non_profit" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "capabilities": { - "description": "Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive.", - "properties": { - "acss_debit_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "affirm_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "afterpay_clearpay_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "au_becs_debit_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "bacs_debit_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "bancontact_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "bank_transfer_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "blik_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "boleto_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "card_issuing": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "card_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "cartes_bancaires_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "eps_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "fpx_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "giropay_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "grabpay_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "ideal_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "india_international_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "jcb_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "klarna_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "konbini_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "legacy_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "link_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "oxxo_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "p24_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "paynow_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "promptpay_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "sepa_debit_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "sofort_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "tax_reporting_us_1099_k": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "tax_reporting_us_1099_misc": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "transfers": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "treasury": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "us_bank_account_ach_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - } - }, - "title": "capabilities_param", - "type": "object" - }, - "company": { - "description": "Information about the company or business. This field is available for any `business_type`.", - "properties": { - "address": { - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "address_kana": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kana_specs", - "type": "object" - }, - "address_kanji": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kanji_specs", - "type": "object" - }, - "directors_provided": { - "type": "boolean" - }, - "executives_provided": { - "type": "boolean" - }, - "name": { - "maxLength": 100, - "type": "string" - }, - "name_kana": { - "maxLength": 100, - "type": "string" - }, - "name_kanji": { - "maxLength": 100, - "type": "string" - }, - "owners_provided": { - "type": "boolean" - }, - "ownership_declaration": { - "properties": { - "date": { - "format": "unix-time", - "type": "integer" - }, - "ip": { - "type": "string" - }, - "user_agent": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "company_ownership_declaration", - "type": "object" - }, - "phone": { - "maxLength": 5000, - "type": "string" - }, - "registration_number": { - "maxLength": 5000, - "type": "string" - }, - "structure": { - "enum": [ - "", - "free_zone_establishment", - "free_zone_llc", - "government_instrumentality", - "governmental_unit", - "incorporated_non_profit", - "limited_liability_partnership", - "llc", - "multi_member_llc", - "private_company", - "private_corporation", - "private_partnership", - "public_company", - "public_corporation", - "public_partnership", - "single_member_llc", - "sole_establishment", - "sole_proprietorship", - "tax_exempt_government_instrumentality", - "unincorporated_association", - "unincorporated_non_profit" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "tax_id": { - "maxLength": 5000, - "type": "string" - }, - "tax_id_registrar": { - "maxLength": 5000, - "type": "string" - }, - "vat_id": { - "maxLength": 5000, - "type": "string" - }, - "verification": { - "properties": { - "document": { - "properties": { - "back": { - "maxLength": 500, - "type": "string" - }, - "front": { - "maxLength": 500, - "type": "string" - } - }, - "title": "verification_document_specs", - "type": "object" - } - }, - "title": "verification_specs", - "type": "object" - } - }, - "title": "company_specs", - "type": "object" - }, - "country": { - "description": "The country in which the account holder resides, or in which the business is legally established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported.", - "maxLength": 5000, - "type": "string" - }, - "default_currency": { - "description": "Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts).", - "type": "string" - }, - "documents": { - "description": "Documents that may be submitted to satisfy various informational requests.", - "properties": { - "bank_account_ownership_verification": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "company_license": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "company_memorandum_of_association": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "company_ministerial_decree": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "company_registration_verification": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "company_tax_id_verification": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "proof_of_registration": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - } - }, - "title": "documents_specs", - "type": "object" - }, - "email": { - "description": "The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent.", - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "external_account": { - "description": "A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won’t be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation.With Connect, you can delete accounts you manage.
\n\nAccounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero.
\n\nIf you want to delete your own account, use the account information tab in your account settings instead.
", - "operationId": "DeleteAccountsAccount", - "parameters": [ - { - "in": "path", - "name": "account", - "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/deleted_account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "Retrieves the details of an account.
", - "operationId": "GetAccountsAccount", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates a connected account by setting the values of the parameters passed. Any parameters not provided are left unchanged. Most parameters can be changed only for Custom accounts. (These are marked Custom Only below.) Parameters marked Custom and Express are not supported for Standard accounts.
\n\nTo update your own account, use the Dashboard. Refer to our Connect documentation to learn more about updating accounts.
", - "operationId": "PostAccountsAccount", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "business_profile": { - "explode": true, - "style": "deepObject" - }, - "capabilities": { - "explode": true, - "style": "deepObject" - }, - "company": { - "explode": true, - "style": "deepObject" - }, - "documents": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "individual": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "settings": { - "explode": true, - "style": "deepObject" - }, - "tos_acceptance": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "account_token": { - "description": "An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account.", - "maxLength": 5000, - "type": "string" - }, - "business_profile": { - "description": "Business information about the account.", - "properties": { - "mcc": { - "maxLength": 4, - "type": "string" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "product_description": { - "maxLength": 40000, - "type": "string" - }, - "support_address": { - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "support_email": { - "type": "string" - }, - "support_phone": { - "maxLength": 5000, - "type": "string" - }, - "support_url": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "url": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "business_profile_specs", - "type": "object" - }, - "business_type": { - "description": "The business type.", - "enum": [ - "company", - "government_entity", - "individual", - "non_profit" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "capabilities": { - "description": "Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive.", - "properties": { - "acss_debit_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "affirm_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "afterpay_clearpay_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "au_becs_debit_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "bacs_debit_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "bancontact_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "bank_transfer_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "blik_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "boleto_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "card_issuing": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "card_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "cartes_bancaires_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "eps_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "fpx_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "giropay_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "grabpay_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "ideal_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "india_international_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "jcb_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "klarna_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "konbini_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "legacy_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "link_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "oxxo_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "p24_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "paynow_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "promptpay_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "sepa_debit_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "sofort_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "tax_reporting_us_1099_k": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "tax_reporting_us_1099_misc": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "transfers": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "treasury": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - }, - "us_bank_account_ach_payments": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "title": "capability_param", - "type": "object" - } - }, - "title": "capabilities_param", - "type": "object" - }, - "company": { - "description": "Information about the company or business. This field is available for any `business_type`.", - "properties": { - "address": { - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "address_kana": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kana_specs", - "type": "object" - }, - "address_kanji": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kanji_specs", - "type": "object" - }, - "directors_provided": { - "type": "boolean" - }, - "executives_provided": { - "type": "boolean" - }, - "name": { - "maxLength": 100, - "type": "string" - }, - "name_kana": { - "maxLength": 100, - "type": "string" - }, - "name_kanji": { - "maxLength": 100, - "type": "string" - }, - "owners_provided": { - "type": "boolean" - }, - "ownership_declaration": { - "properties": { - "date": { - "format": "unix-time", - "type": "integer" - }, - "ip": { - "type": "string" - }, - "user_agent": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "company_ownership_declaration", - "type": "object" - }, - "phone": { - "maxLength": 5000, - "type": "string" - }, - "registration_number": { - "maxLength": 5000, - "type": "string" - }, - "structure": { - "enum": [ - "", - "free_zone_establishment", - "free_zone_llc", - "government_instrumentality", - "governmental_unit", - "incorporated_non_profit", - "limited_liability_partnership", - "llc", - "multi_member_llc", - "private_company", - "private_corporation", - "private_partnership", - "public_company", - "public_corporation", - "public_partnership", - "single_member_llc", - "sole_establishment", - "sole_proprietorship", - "tax_exempt_government_instrumentality", - "unincorporated_association", - "unincorporated_non_profit" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "tax_id": { - "maxLength": 5000, - "type": "string" - }, - "tax_id_registrar": { - "maxLength": 5000, - "type": "string" - }, - "vat_id": { - "maxLength": 5000, - "type": "string" - }, - "verification": { - "properties": { - "document": { - "properties": { - "back": { - "maxLength": 500, - "type": "string" - }, - "front": { - "maxLength": 500, - "type": "string" - } - }, - "title": "verification_document_specs", - "type": "object" - } - }, - "title": "verification_specs", - "type": "object" - } - }, - "title": "company_specs", - "type": "object" - }, - "default_currency": { - "description": "Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts).", - "type": "string" - }, - "documents": { - "description": "Documents that may be submitted to satisfy various informational requests.", - "properties": { - "bank_account_ownership_verification": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "company_license": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "company_memorandum_of_association": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "company_ministerial_decree": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "company_registration_verification": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "company_tax_id_verification": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "proof_of_registration": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - } - }, - "title": "documents_specs", - "type": "object" - }, - "email": { - "description": "The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent.", - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "external_account": { - "description": "A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won’t be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation.Create an external account for a given account.
", - "operationId": "PostAccountsAccountBankAccounts", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "bank_account": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "bank_account": { - "anyOf": [ - { - "properties": { - "account_holder_name": { - "maxLength": 5000, - "type": "string" - }, - "account_holder_type": { - "enum": [ - "company", - "individual" - ], - "maxLength": 5000, - "type": "string" - }, - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "account_type": { - "enum": [ - "checking", - "futsu", - "savings", - "toza" - ], - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "currency": { - "type": "string" - }, - "object": { - "enum": [ - "bank_account" - ], - "maxLength": 5000, - "type": "string" - }, - "routing_number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "account_number", - "country" - ], - "title": "external_account_payout_bank_account", - "type": "object" - }, - { - "maxLength": 5000, - "type": "string" - } - ], - "description": "Either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details." - }, - "default_for_currency": { - "description": "When set to true, or if this is the first external account added in this currency, this account becomes the default external account for its currency.", - "type": "boolean" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "external_account": { - "description": "Please refer to full [documentation](https://stripe.com/docs/api) instead.", - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/external_account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/accounts/{account}/bank_accounts/{id}": { - "delete": { - "description": "Delete a specified external account for a given account.
", - "operationId": "DeleteAccountsAccountBankAccountsId", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "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/deleted_external_account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "Retrieve a specified external account for a given account.
", - "operationId": "GetAccountsAccountBankAccountsId", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": { - "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/external_account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the metadata, account holder name, account holder type of a bank account belonging to a Custom account, and optionally sets it as the default for its currency. Other bank account details are not editable by design.
\n\nYou can re-enable a disabled bank account by performing an update call without providing any arguments or changes.
", - "operationId": "PostAccountsAccountBankAccountsId", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "account_holder_name": { - "description": "The name of the person or business that owns the bank account.", - "maxLength": 5000, - "type": "string" - }, - "account_holder_type": { - "description": "The type of entity that holds the account. This can be either `individual` or `company`.", - "enum": [ - "", - "company", - "individual" - ], - "maxLength": 5000, - "type": "string" - }, - "account_type": { - "description": "The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`.", - "enum": [ - "checking", - "futsu", - "savings", - "toza" - ], - "maxLength": 5000, - "type": "string" - }, - "address_city": { - "description": "City/District/Suburb/Town/Village.", - "maxLength": 5000, - "type": "string" - }, - "address_country": { - "description": "Billing address country, if provided when creating card.", - "maxLength": 5000, - "type": "string" - }, - "address_line1": { - "description": "Address line 1 (Street address/PO Box/Company name).", - "maxLength": 5000, - "type": "string" - }, - "address_line2": { - "description": "Address line 2 (Apartment/Suite/Unit/Building).", - "maxLength": 5000, - "type": "string" - }, - "address_state": { - "description": "State/County/Province/Region.", - "maxLength": 5000, - "type": "string" - }, - "address_zip": { - "description": "ZIP or postal code.", - "maxLength": 5000, - "type": "string" - }, - "default_for_currency": { - "description": "When set to true, this becomes the default external account for its currency.", - "type": "boolean" - }, - "exp_month": { - "description": "Two digit number representing the card’s expiration month.", - "maxLength": 5000, - "type": "string" - }, - "exp_year": { - "description": "Four digit number representing the card’s expiration year.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "name": { - "description": "Cardholder name.", - "maxLength": 5000, - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/external_account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/accounts/{account}/capabilities": { - "get": { - "description": "Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first.
", - "operationId": "GetAccountsAccountCapabilities", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": { - "description": "", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/capability" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "ListAccountCapability", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/accounts/{account}/capabilities/{capability}": { - "get": { - "description": "Retrieves information about the specified Account Capability.
", - "operationId": "GetAccountsAccountCapabilitiesCapability", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "capability", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - { - "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/capability" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates an existing Account Capability.
", - "operationId": "PostAccountsAccountCapabilitiesCapability", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "capability", - "required": true, - "schema": { - "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" - }, - "requested": { - "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", - "type": "boolean" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/capability" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/accounts/{account}/external_accounts": { - "get": { - "description": "List external accounts for an account.
", - "operationId": "GetAccountsAccountExternalAccounts", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": { - "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": "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": { - "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": { - "description": "The list contains all external accounts that have been attached to the Stripe account. These may be bank accounts or cards.", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/bank_account" - }, - { - "$ref": "#/components/schemas/card" - } - ], - "title": "Polymorphic", - "x-stripeBypassValidation": true - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "ExternalAccountList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Create an external account for a given account.
", - "operationId": "PostAccountsAccountExternalAccounts", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "bank_account": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "bank_account": { - "anyOf": [ - { - "properties": { - "account_holder_name": { - "maxLength": 5000, - "type": "string" - }, - "account_holder_type": { - "enum": [ - "company", - "individual" - ], - "maxLength": 5000, - "type": "string" - }, - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "account_type": { - "enum": [ - "checking", - "futsu", - "savings", - "toza" - ], - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "currency": { - "type": "string" - }, - "object": { - "enum": [ - "bank_account" - ], - "maxLength": 5000, - "type": "string" - }, - "routing_number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "account_number", - "country" - ], - "title": "external_account_payout_bank_account", - "type": "object" - }, - { - "maxLength": 5000, - "type": "string" - } - ], - "description": "Either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details." - }, - "default_for_currency": { - "description": "When set to true, or if this is the first external account added in this currency, this account becomes the default external account for its currency.", - "type": "boolean" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "external_account": { - "description": "Please refer to full [documentation](https://stripe.com/docs/api) instead.", - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/external_account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/accounts/{account}/external_accounts/{id}": { - "delete": { - "description": "Delete a specified external account for a given account.
", - "operationId": "DeleteAccountsAccountExternalAccountsId", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "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/deleted_external_account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "Retrieve a specified external account for a given account.
", - "operationId": "GetAccountsAccountExternalAccountsId", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": { - "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/external_account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the metadata, account holder name, account holder type of a bank account belonging to a Custom account, and optionally sets it as the default for its currency. Other bank account details are not editable by design.
\n\nYou can re-enable a disabled bank account by performing an update call without providing any arguments or changes.
", - "operationId": "PostAccountsAccountExternalAccountsId", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "account_holder_name": { - "description": "The name of the person or business that owns the bank account.", - "maxLength": 5000, - "type": "string" - }, - "account_holder_type": { - "description": "The type of entity that holds the account. This can be either `individual` or `company`.", - "enum": [ - "", - "company", - "individual" - ], - "maxLength": 5000, - "type": "string" - }, - "account_type": { - "description": "The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`.", - "enum": [ - "checking", - "futsu", - "savings", - "toza" - ], - "maxLength": 5000, - "type": "string" - }, - "address_city": { - "description": "City/District/Suburb/Town/Village.", - "maxLength": 5000, - "type": "string" - }, - "address_country": { - "description": "Billing address country, if provided when creating card.", - "maxLength": 5000, - "type": "string" - }, - "address_line1": { - "description": "Address line 1 (Street address/PO Box/Company name).", - "maxLength": 5000, - "type": "string" - }, - "address_line2": { - "description": "Address line 2 (Apartment/Suite/Unit/Building).", - "maxLength": 5000, - "type": "string" - }, - "address_state": { - "description": "State/County/Province/Region.", - "maxLength": 5000, - "type": "string" - }, - "address_zip": { - "description": "ZIP or postal code.", - "maxLength": 5000, - "type": "string" - }, - "default_for_currency": { - "description": "When set to true, this becomes the default external account for its currency.", - "type": "boolean" - }, - "exp_month": { - "description": "Two digit number representing the card’s expiration month.", - "maxLength": 5000, - "type": "string" - }, - "exp_year": { - "description": "Four digit number representing the card’s expiration year.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "name": { - "description": "Cardholder name.", - "maxLength": 5000, - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/external_account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/accounts/{account}/login_links": { - "post": { - "description": "Creates a single-use login link for an Express account to access their Stripe dashboard.
\n\nYou may only create login links for Express accounts connected to your platform.
", - "operationId": "PostAccountsAccountLoginLinks", - "parameters": [ - { - "in": "path", - "name": "account", - "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/login_link" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/accounts/{account}/people": { - "get": { - "description": "Returns a list of people associated with the account’s legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
", - "operationId": "GetAccountsAccountPeople", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": "Filters on the list of people returned based on the person's relationship to the account's company.", - "explode": true, - "in": "query", - "name": "relationship", - "required": false, - "schema": { - "properties": { - "director": { - "type": "boolean" - }, - "executive": { - "type": "boolean" - }, - "owner": { - "type": "boolean" - }, - "representative": { - "type": "boolean" - } - }, - "title": "all_people_relationship_specs", - "type": "object" - }, - "style": "deepObject" - }, - { - "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/person" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "PersonList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a new person.
", - "operationId": "PostAccountsAccountPeople", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "address": { - "explode": true, - "style": "deepObject" - }, - "address_kana": { - "explode": true, - "style": "deepObject" - }, - "address_kanji": { - "explode": true, - "style": "deepObject" - }, - "dob": { - "explode": true, - "style": "deepObject" - }, - "documents": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "full_name_aliases": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "registered_address": { - "explode": true, - "style": "deepObject" - }, - "relationship": { - "explode": true, - "style": "deepObject" - }, - "verification": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "address": { - "description": "The person's address.", - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "address_kana": { - "description": "The Kana variation of the person's address (Japan only).", - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kana_specs", - "type": "object" - }, - "address_kanji": { - "description": "The Kanji variation of the person's address (Japan only).", - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kanji_specs", - "type": "object" - }, - "dob": { - "anyOf": [ - { - "properties": { - "day": { - "type": "integer" - }, - "month": { - "type": "integer" - }, - "year": { - "type": "integer" - } - }, - "required": [ - "day", - "month", - "year" - ], - "title": "date_of_birth_specs", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The person's date of birth." - }, - "documents": { - "description": "Documents that may be submitted to satisfy various informational requests.", - "properties": { - "company_authorization": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "passport": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "visa": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - } - }, - "title": "person_documents_specs", - "type": "object" - }, - "email": { - "description": "The person's email address.", - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "first_name": { - "description": "The person's first name.", - "maxLength": 5000, - "type": "string" - }, - "first_name_kana": { - "description": "The Kana variation of the person's first name (Japan only).", - "maxLength": 5000, - "type": "string" - }, - "first_name_kanji": { - "description": "The Kanji variation of the person's first name (Japan only).", - "maxLength": 5000, - "type": "string" - }, - "full_name_aliases": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "A list of alternate names or aliases that the person is known by." - }, - "gender": { - "description": "The person's gender (International regulations require either \"male\" or \"female\").", - "type": "string" - }, - "id_number": { - "description": "The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", - "maxLength": 5000, - "type": "string" - }, - "id_number_secondary": { - "description": "The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", - "maxLength": 5000, - "type": "string" - }, - "last_name": { - "description": "The person's last name.", - "maxLength": 5000, - "type": "string" - }, - "last_name_kana": { - "description": "The Kana variation of the person's last name (Japan only).", - "maxLength": 5000, - "type": "string" - }, - "last_name_kanji": { - "description": "The Kanji variation of the person's last name (Japan only).", - "maxLength": 5000, - "type": "string" - }, - "maiden_name": { - "description": "The person's maiden name.", - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "nationality": { - "description": "The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or \"XX\" if unavailable.", - "maxLength": 5000, - "type": "string" - }, - "person_token": { - "description": "A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person.", - "maxLength": 5000, - "type": "string" - }, - "phone": { - "description": "The person's phone number.", - "type": "string" - }, - "political_exposure": { - "description": "Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.", - "maxLength": 5000, - "type": "string" - }, - "registered_address": { - "description": "The person's registered address.", - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "relationship": { - "description": "The relationship that this person has with the account's legal entity.", - "properties": { - "director": { - "type": "boolean" - }, - "executive": { - "type": "boolean" - }, - "owner": { - "type": "boolean" - }, - "percent_ownership": { - "anyOf": [ - { - "type": "number" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "representative": { - "type": "boolean" - }, - "title": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "relationship_specs", - "type": "object" - }, - "ssn_last_4": { - "description": "The last four digits of the person's Social Security number (U.S. only).", - "type": "string" - }, - "verification": { - "description": "The person's verification status.", - "properties": { - "additional_document": { - "properties": { - "back": { - "maxLength": 500, - "type": "string" - }, - "front": { - "maxLength": 500, - "type": "string" - } - }, - "title": "person_verification_document_specs", - "type": "object" - }, - "document": { - "properties": { - "back": { - "maxLength": 500, - "type": "string" - }, - "front": { - "maxLength": 500, - "type": "string" - } - }, - "title": "person_verification_document_specs", - "type": "object" - } - }, - "title": "person_verification_specs", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/person" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/accounts/{account}/people/{person}": { - "delete": { - "description": "Deletes an existing person’s relationship to the account’s legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener
. If your integration is using the executive
parameter, you cannot delete the only verified executive
on file.
Retrieves an existing person.
", - "operationId": "GetAccountsAccountPeoplePerson", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": "person", - "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/person" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates an existing person.
", - "operationId": "PostAccountsAccountPeoplePerson", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "person", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "address": { - "explode": true, - "style": "deepObject" - }, - "address_kana": { - "explode": true, - "style": "deepObject" - }, - "address_kanji": { - "explode": true, - "style": "deepObject" - }, - "dob": { - "explode": true, - "style": "deepObject" - }, - "documents": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "full_name_aliases": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "registered_address": { - "explode": true, - "style": "deepObject" - }, - "relationship": { - "explode": true, - "style": "deepObject" - }, - "verification": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "address": { - "description": "The person's address.", - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "address_kana": { - "description": "The Kana variation of the person's address (Japan only).", - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kana_specs", - "type": "object" - }, - "address_kanji": { - "description": "The Kanji variation of the person's address (Japan only).", - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kanji_specs", - "type": "object" - }, - "dob": { - "anyOf": [ - { - "properties": { - "day": { - "type": "integer" - }, - "month": { - "type": "integer" - }, - "year": { - "type": "integer" - } - }, - "required": [ - "day", - "month", - "year" - ], - "title": "date_of_birth_specs", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The person's date of birth." - }, - "documents": { - "description": "Documents that may be submitted to satisfy various informational requests.", - "properties": { - "company_authorization": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "passport": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "visa": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - } - }, - "title": "person_documents_specs", - "type": "object" - }, - "email": { - "description": "The person's email address.", - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "first_name": { - "description": "The person's first name.", - "maxLength": 5000, - "type": "string" - }, - "first_name_kana": { - "description": "The Kana variation of the person's first name (Japan only).", - "maxLength": 5000, - "type": "string" - }, - "first_name_kanji": { - "description": "The Kanji variation of the person's first name (Japan only).", - "maxLength": 5000, - "type": "string" - }, - "full_name_aliases": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "A list of alternate names or aliases that the person is known by." - }, - "gender": { - "description": "The person's gender (International regulations require either \"male\" or \"female\").", - "type": "string" - }, - "id_number": { - "description": "The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", - "maxLength": 5000, - "type": "string" - }, - "id_number_secondary": { - "description": "The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", - "maxLength": 5000, - "type": "string" - }, - "last_name": { - "description": "The person's last name.", - "maxLength": 5000, - "type": "string" - }, - "last_name_kana": { - "description": "The Kana variation of the person's last name (Japan only).", - "maxLength": 5000, - "type": "string" - }, - "last_name_kanji": { - "description": "The Kanji variation of the person's last name (Japan only).", - "maxLength": 5000, - "type": "string" - }, - "maiden_name": { - "description": "The person's maiden name.", - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "nationality": { - "description": "The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or \"XX\" if unavailable.", - "maxLength": 5000, - "type": "string" - }, - "person_token": { - "description": "A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person.", - "maxLength": 5000, - "type": "string" - }, - "phone": { - "description": "The person's phone number.", - "type": "string" - }, - "political_exposure": { - "description": "Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.", - "maxLength": 5000, - "type": "string" - }, - "registered_address": { - "description": "The person's registered address.", - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "relationship": { - "description": "The relationship that this person has with the account's legal entity.", - "properties": { - "director": { - "type": "boolean" - }, - "executive": { - "type": "boolean" - }, - "owner": { - "type": "boolean" - }, - "percent_ownership": { - "anyOf": [ - { - "type": "number" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "representative": { - "type": "boolean" - }, - "title": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "relationship_specs", - "type": "object" - }, - "ssn_last_4": { - "description": "The last four digits of the person's Social Security number (U.S. only).", - "type": "string" - }, - "verification": { - "description": "The person's verification status.", - "properties": { - "additional_document": { - "properties": { - "back": { - "maxLength": 500, - "type": "string" - }, - "front": { - "maxLength": 500, - "type": "string" - } - }, - "title": "person_verification_document_specs", - "type": "object" - }, - "document": { - "properties": { - "back": { - "maxLength": 500, - "type": "string" - }, - "front": { - "maxLength": 500, - "type": "string" - } - }, - "title": "person_verification_document_specs", - "type": "object" - } - }, - "title": "person_verification_specs", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/person" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/accounts/{account}/persons": { - "get": { - "description": "Returns a list of people associated with the account’s legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
", - "operationId": "GetAccountsAccountPersons", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": "Filters on the list of people returned based on the person's relationship to the account's company.", - "explode": true, - "in": "query", - "name": "relationship", - "required": false, - "schema": { - "properties": { - "director": { - "type": "boolean" - }, - "executive": { - "type": "boolean" - }, - "owner": { - "type": "boolean" - }, - "representative": { - "type": "boolean" - } - }, - "title": "all_people_relationship_specs", - "type": "object" - }, - "style": "deepObject" - }, - { - "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/person" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "PersonList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a new person.
", - "operationId": "PostAccountsAccountPersons", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "address": { - "explode": true, - "style": "deepObject" - }, - "address_kana": { - "explode": true, - "style": "deepObject" - }, - "address_kanji": { - "explode": true, - "style": "deepObject" - }, - "dob": { - "explode": true, - "style": "deepObject" - }, - "documents": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "full_name_aliases": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "registered_address": { - "explode": true, - "style": "deepObject" - }, - "relationship": { - "explode": true, - "style": "deepObject" - }, - "verification": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "address": { - "description": "The person's address.", - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "address_kana": { - "description": "The Kana variation of the person's address (Japan only).", - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kana_specs", - "type": "object" - }, - "address_kanji": { - "description": "The Kanji variation of the person's address (Japan only).", - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kanji_specs", - "type": "object" - }, - "dob": { - "anyOf": [ - { - "properties": { - "day": { - "type": "integer" - }, - "month": { - "type": "integer" - }, - "year": { - "type": "integer" - } - }, - "required": [ - "day", - "month", - "year" - ], - "title": "date_of_birth_specs", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The person's date of birth." - }, - "documents": { - "description": "Documents that may be submitted to satisfy various informational requests.", - "properties": { - "company_authorization": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "passport": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "visa": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - } - }, - "title": "person_documents_specs", - "type": "object" - }, - "email": { - "description": "The person's email address.", - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "first_name": { - "description": "The person's first name.", - "maxLength": 5000, - "type": "string" - }, - "first_name_kana": { - "description": "The Kana variation of the person's first name (Japan only).", - "maxLength": 5000, - "type": "string" - }, - "first_name_kanji": { - "description": "The Kanji variation of the person's first name (Japan only).", - "maxLength": 5000, - "type": "string" - }, - "full_name_aliases": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "A list of alternate names or aliases that the person is known by." - }, - "gender": { - "description": "The person's gender (International regulations require either \"male\" or \"female\").", - "type": "string" - }, - "id_number": { - "description": "The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", - "maxLength": 5000, - "type": "string" - }, - "id_number_secondary": { - "description": "The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", - "maxLength": 5000, - "type": "string" - }, - "last_name": { - "description": "The person's last name.", - "maxLength": 5000, - "type": "string" - }, - "last_name_kana": { - "description": "The Kana variation of the person's last name (Japan only).", - "maxLength": 5000, - "type": "string" - }, - "last_name_kanji": { - "description": "The Kanji variation of the person's last name (Japan only).", - "maxLength": 5000, - "type": "string" - }, - "maiden_name": { - "description": "The person's maiden name.", - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "nationality": { - "description": "The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or \"XX\" if unavailable.", - "maxLength": 5000, - "type": "string" - }, - "person_token": { - "description": "A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person.", - "maxLength": 5000, - "type": "string" - }, - "phone": { - "description": "The person's phone number.", - "type": "string" - }, - "political_exposure": { - "description": "Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.", - "maxLength": 5000, - "type": "string" - }, - "registered_address": { - "description": "The person's registered address.", - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "relationship": { - "description": "The relationship that this person has with the account's legal entity.", - "properties": { - "director": { - "type": "boolean" - }, - "executive": { - "type": "boolean" - }, - "owner": { - "type": "boolean" - }, - "percent_ownership": { - "anyOf": [ - { - "type": "number" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "representative": { - "type": "boolean" - }, - "title": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "relationship_specs", - "type": "object" - }, - "ssn_last_4": { - "description": "The last four digits of the person's Social Security number (U.S. only).", - "type": "string" - }, - "verification": { - "description": "The person's verification status.", - "properties": { - "additional_document": { - "properties": { - "back": { - "maxLength": 500, - "type": "string" - }, - "front": { - "maxLength": 500, - "type": "string" - } - }, - "title": "person_verification_document_specs", - "type": "object" - }, - "document": { - "properties": { - "back": { - "maxLength": 500, - "type": "string" - }, - "front": { - "maxLength": 500, - "type": "string" - } - }, - "title": "person_verification_document_specs", - "type": "object" - } - }, - "title": "person_verification_specs", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/person" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/accounts/{account}/persons/{person}": { - "delete": { - "description": "Deletes an existing person’s relationship to the account’s legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener
. If your integration is using the executive
parameter, you cannot delete the only verified executive
on file.
Retrieves an existing person.
", - "operationId": "GetAccountsAccountPersonsPerson", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": "person", - "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/person" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates an existing person.
", - "operationId": "PostAccountsAccountPersonsPerson", - "parameters": [ - { - "in": "path", - "name": "account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "person", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "address": { - "explode": true, - "style": "deepObject" - }, - "address_kana": { - "explode": true, - "style": "deepObject" - }, - "address_kanji": { - "explode": true, - "style": "deepObject" - }, - "dob": { - "explode": true, - "style": "deepObject" - }, - "documents": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "full_name_aliases": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "registered_address": { - "explode": true, - "style": "deepObject" - }, - "relationship": { - "explode": true, - "style": "deepObject" - }, - "verification": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "address": { - "description": "The person's address.", - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "address_kana": { - "description": "The Kana variation of the person's address (Japan only).", - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kana_specs", - "type": "object" - }, - "address_kanji": { - "description": "The Kanji variation of the person's address (Japan only).", - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kanji_specs", - "type": "object" - }, - "dob": { - "anyOf": [ - { - "properties": { - "day": { - "type": "integer" - }, - "month": { - "type": "integer" - }, - "year": { - "type": "integer" - } - }, - "required": [ - "day", - "month", - "year" - ], - "title": "date_of_birth_specs", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The person's date of birth." - }, - "documents": { - "description": "Documents that may be submitted to satisfy various informational requests.", - "properties": { - "company_authorization": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "passport": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "visa": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - } - }, - "title": "person_documents_specs", - "type": "object" - }, - "email": { - "description": "The person's email address.", - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "first_name": { - "description": "The person's first name.", - "maxLength": 5000, - "type": "string" - }, - "first_name_kana": { - "description": "The Kana variation of the person's first name (Japan only).", - "maxLength": 5000, - "type": "string" - }, - "first_name_kanji": { - "description": "The Kanji variation of the person's first name (Japan only).", - "maxLength": 5000, - "type": "string" - }, - "full_name_aliases": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "A list of alternate names or aliases that the person is known by." - }, - "gender": { - "description": "The person's gender (International regulations require either \"male\" or \"female\").", - "type": "string" - }, - "id_number": { - "description": "The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", - "maxLength": 5000, - "type": "string" - }, - "id_number_secondary": { - "description": "The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", - "maxLength": 5000, - "type": "string" - }, - "last_name": { - "description": "The person's last name.", - "maxLength": 5000, - "type": "string" - }, - "last_name_kana": { - "description": "The Kana variation of the person's last name (Japan only).", - "maxLength": 5000, - "type": "string" - }, - "last_name_kanji": { - "description": "The Kanji variation of the person's last name (Japan only).", - "maxLength": 5000, - "type": "string" - }, - "maiden_name": { - "description": "The person's maiden name.", - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "nationality": { - "description": "The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or \"XX\" if unavailable.", - "maxLength": 5000, - "type": "string" - }, - "person_token": { - "description": "A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person.", - "maxLength": 5000, - "type": "string" - }, - "phone": { - "description": "The person's phone number.", - "type": "string" - }, - "political_exposure": { - "description": "Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.", - "maxLength": 5000, - "type": "string" - }, - "registered_address": { - "description": "The person's registered address.", - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "relationship": { - "description": "The relationship that this person has with the account's legal entity.", - "properties": { - "director": { - "type": "boolean" - }, - "executive": { - "type": "boolean" - }, - "owner": { - "type": "boolean" - }, - "percent_ownership": { - "anyOf": [ - { - "type": "number" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "representative": { - "type": "boolean" - }, - "title": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "relationship_specs", - "type": "object" - }, - "ssn_last_4": { - "description": "The last four digits of the person's Social Security number (U.S. only).", - "type": "string" - }, - "verification": { - "description": "The person's verification status.", - "properties": { - "additional_document": { - "properties": { - "back": { - "maxLength": 500, - "type": "string" - }, - "front": { - "maxLength": 500, - "type": "string" - } - }, - "title": "person_verification_document_specs", - "type": "object" - }, - "document": { - "properties": { - "back": { - "maxLength": 500, - "type": "string" - }, - "front": { - "maxLength": 500, - "type": "string" - } - }, - "title": "person_verification_document_specs", - "type": "object" - } - }, - "title": "person_verification_specs", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/person" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/accounts/{account}/reject": { - "post": { - "description": "With Connect, you may flag accounts as suspicious.
\n\nTest-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero.
", - "operationId": "PostAccountsAccountReject", - "parameters": [ - { - "in": "path", - "name": "account", - "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" - }, - "reason": { - "description": "The reason for rejecting the account. Can be `fraud`, `terms_of_service`, or `other`.", - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "reason" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/apple_pay/domains": { - "get": { - "description": "List apple pay domains.
", - "operationId": "GetApplePayDomains", - "parameters": [ - { - "in": "query", - "name": "domain_name", - "required": false, - "schema": { - "maxLength": 5000, - "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": "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/apple_pay_domain" - }, - "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/apple_pay/domains", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "ApplePayDomainList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Create an apple pay domain.
", - "operationId": "PostApplePayDomains", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "domain_name": { - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "domain_name" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/apple_pay_domain" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/apple_pay/domains/{domain}": { - "delete": { - "description": "Delete an apple pay domain.
", - "operationId": "DeleteApplePayDomainsDomain", - "parameters": [ - { - "in": "path", - "name": "domain", - "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/deleted_apple_pay_domain" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "Retrieve an apple pay domain.
", - "operationId": "GetApplePayDomainsDomain", - "parameters": [ - { - "in": "path", - "name": "domain", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/apple_pay_domain" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/application_fees": { - "get": { - "description": "Returns a list of application fees you’ve previously collected. The application fees are returned in sorted order, with the most recent fees appearing first.
", - "operationId": "GetApplicationFees", - "parameters": [ - { - "description": "Only return application fees for the charge specified by this charge ID.", - "in": "query", - "name": "charge", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": "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/application_fee" - }, - "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/application_fees", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "PlatformEarningList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/application_fees/{fee}/refunds/{id}": { - "get": { - "description": "By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee.
", - "operationId": "GetApplicationFeesFeeRefundsId", - "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": "fee", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/fee_refund" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
\n\nThis request only accepts metadata as an argument.
", - "operationId": "PostApplicationFeesFeeRefundsId", - "parameters": [ - { - "in": "path", - "name": "fee", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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" - }, - "metadata": { - "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" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/fee_refund" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/application_fees/{id}": { - "get": { - "description": "Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee.
", - "operationId": "GetApplicationFeesId", - "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/application_fee" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/application_fees/{id}/refund": { - "post": { - "description": "", - "operationId": "PostApplicationFeesIdRefund", - "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": { - "amount": { - "type": "integer" - }, - "directive": { - "maxLength": 5000, - "type": "string" - }, - "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/application_fee" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/application_fees/{id}/refunds": { - "get": { - "description": "You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit
and starting_after
parameters to page through additional refunds.
Refunds an application fee that has previously been collected but not yet refunded.\nFunds will be refunded to the Stripe account from which the fee was originally collected.
\n\nYou can optionally refund only part of an application fee.\nYou can do so multiple times, until the entire fee has been refunded.
\n\nOnce entirely refunded, an application fee can’t be refunded again.\nThis method will raise an error when called on an already-refunded application fee,\nor when trying to refund more money than is left on an application fee.
", - "operationId": "PostApplicationFeesIdRefunds", - "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" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee.", - "type": "integer" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/fee_refund" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/apps/secrets": { - "get": { - "description": "List all secrets stored on the given scope.
", - "operationId": "GetAppsSecrets", - "parameters": [ - { - "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": "Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.", - "explode": true, - "in": "query", - "name": "scope", - "required": true, - "schema": { - "properties": { - "type": { - "enum": [ - "account", - "user" - ], - "type": "string" - }, - "user": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "scope_param", - "type": "object" - }, - "style": "deepObject" - }, - { - "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/apps.secret" - }, - "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/apps/secrets", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "SecretServiceResourceSecretList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Create or replace a secret in the secret store.
", - "operationId": "PostAppsSecrets", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "scope": { - "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" - }, - "expires_at": { - "description": "The Unix timestamp for the expiry time of the secret, after which the secret deletes.", - "format": "unix-time", - "type": "integer" - }, - "name": { - "description": "A name for the secret that's unique within the scope.", - "maxLength": 5000, - "type": "string" - }, - "payload": { - "description": "The plaintext secret value to be stored.", - "maxLength": 5000, - "type": "string" - }, - "scope": { - "description": "Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.", - "properties": { - "type": { - "enum": [ - "account", - "user" - ], - "type": "string" - }, - "user": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "scope_param", - "type": "object" - } - }, - "required": [ - "name", - "payload", - "scope" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/apps.secret" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/apps/secrets/delete": { - "post": { - "description": "Deletes a secret from the secret store by name and scope.
", - "operationId": "PostAppsSecretsDelete", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "scope": { - "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" - }, - "name": { - "description": "A name for the secret that's unique within the scope.", - "maxLength": 5000, - "type": "string" - }, - "scope": { - "description": "Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.", - "properties": { - "type": { - "enum": [ - "account", - "user" - ], - "type": "string" - }, - "user": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "scope_param", - "type": "object" - } - }, - "required": [ - "name", - "scope" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/apps.secret" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/apps/secrets/find": { - "get": { - "description": "Finds a secret in the secret store by name and scope.
", - "operationId": "GetAppsSecretsFind", - "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" - }, - { - "description": "A name for the secret that's unique within the scope.", - "in": "query", - "name": "name", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.", - "explode": true, - "in": "query", - "name": "scope", - "required": true, - "schema": { - "properties": { - "type": { - "enum": [ - "account", - "user" - ], - "type": "string" - }, - "user": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "scope_param", - "type": "object" - }, - "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/apps.secret" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/balance": { - "get": { - "description": "Retrieves the current account balance, based on the authentication that was used to make the request.\n For a sample request, see Accounting for negative balances.
", - "operationId": "GetBalance", - "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/balance" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/balance/history": { - "get": { - "description": "Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first.
\n\nNote that this endpoint was previously called “Balance history” and used the path /v1/balance/history
.
Retrieves the balance transaction with the given ID.
\n\nNote that this endpoint previously used the path /v1/balance/history/:id
.
Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first.
\n\nNote that this endpoint was previously called “Balance history” and used the path /v1/balance/history
.
Retrieves the balance transaction with the given ID.
\n\nNote that this endpoint previously used the path /v1/balance/history/:id
.
Returns a list of configurations that describe the functionality of the customer portal.
", - "operationId": "GetBillingPortalConfigurations", - "parameters": [ - { - "description": "Only return configurations that are active or inactive (e.g., pass `true` to only list active configurations).", - "in": "query", - "name": "active", - "required": false, - "schema": { - "type": "boolean" - }, - "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": "Only return the default or non-default configurations (e.g., pass `true` to only list the default configuration).", - "in": "query", - "name": "is_default", - "required": false, - "schema": { - "type": "boolean" - }, - "style": "form" - }, - { - "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": "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_portal.configuration" - }, - "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_portal/configurations", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "PortalConfigurationList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a configuration that describes the functionality and behavior of a PortalSession
", - "operationId": "PostBillingPortalConfigurations", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "business_profile": { - "explode": true, - "style": "deepObject" - }, - "default_return_url": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "features": { - "explode": true, - "style": "deepObject" - }, - "login_page": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "business_profile": { - "description": "The business information shown to customers in the portal.", - "properties": { - "headline": { - "maxLength": 60, - "type": "string" - }, - "privacy_policy_url": { - "type": "string" - }, - "terms_of_service_url": { - "type": "string" - } - }, - "title": "business_profile_create_param", - "type": "object" - }, - "default_return_url": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session." - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "features": { - "description": "Information about the features available in the portal.", - "properties": { - "customer_update": { - "properties": { - "allowed_updates": { - "anyOf": [ - { - "items": { - "enum": [ - "address", - "email", - "phone", - "shipping", - "tax_id" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "customer_update_creation_param", - "type": "object" - }, - "invoice_history": { - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "invoice_list_param", - "type": "object" - }, - "payment_method_update": { - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "payment_method_update_param", - "type": "object" - }, - "subscription_cancel": { - "properties": { - "cancellation_reason": { - "properties": { - "enabled": { - "type": "boolean" - }, - "options": { - "anyOf": [ - { - "items": { - "enum": [ - "customer_service", - "low_quality", - "missing_features", - "other", - "switched_service", - "too_complex", - "too_expensive", - "unused" - ], - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "required": [ - "enabled", - "options" - ], - "title": "subscription_cancellation_reason_creation_param", - "type": "object" - }, - "enabled": { - "type": "boolean" - }, - "mode": { - "enum": [ - "at_period_end", - "immediately" - ], - "type": "string" - }, - "proration_behavior": { - "enum": [ - "always_invoice", - "create_prorations", - "none" - ], - "type": "string" - } - }, - "required": [ - "enabled" - ], - "title": "subscription_cancel_creation_param", - "type": "object" - }, - "subscription_pause": { - "properties": { - "enabled": { - "type": "boolean" - } - }, - "title": "subscription_pause_param", - "type": "object" - }, - "subscription_update": { - "properties": { - "default_allowed_updates": { - "anyOf": [ - { - "items": { - "enum": [ - "price", - "promotion_code", - "quantity" - ], - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "enabled": { - "type": "boolean" - }, - "products": { - "anyOf": [ - { - "items": { - "properties": { - "prices": { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "product": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "prices", - "product" - ], - "title": "subscription_update_product_param", - "type": "object" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "proration_behavior": { - "enum": [ - "always_invoice", - "create_prorations", - "none" - ], - "type": "string" - } - }, - "required": [ - "default_allowed_updates", - "enabled", - "products" - ], - "title": "subscription_update_creation_param", - "type": "object" - } - }, - "title": "features_creation_param", - "type": "object" - }, - "login_page": { - "description": "The hosted login page for this configuration. Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share).", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "login_page_create_param", - "type": "object" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - } - }, - "required": [ - "business_profile", - "features" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/billing_portal.configuration" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/billing_portal/configurations/{configuration}": { - "get": { - "description": "Retrieves a configuration that describes the functionality of the customer portal.
", - "operationId": "GetBillingPortalConfigurationsConfiguration", - "parameters": [ - { - "in": "path", - "name": "configuration", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/billing_portal.configuration" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates a configuration that describes the functionality of the customer portal.
", - "operationId": "PostBillingPortalConfigurationsConfiguration", - "parameters": [ - { - "in": "path", - "name": "configuration", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "business_profile": { - "explode": true, - "style": "deepObject" - }, - "default_return_url": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "features": { - "explode": true, - "style": "deepObject" - }, - "login_page": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "active": { - "description": "Whether the configuration is active and can be used to create portal sessions.", - "type": "boolean" - }, - "business_profile": { - "description": "The business information shown to customers in the portal.", - "properties": { - "headline": { - "maxLength": 60, - "type": "string" - }, - "privacy_policy_url": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "terms_of_service_url": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "business_profile_update_param", - "type": "object" - }, - "default_return_url": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session." - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "features": { - "description": "Information about the features available in the portal.", - "properties": { - "customer_update": { - "properties": { - "allowed_updates": { - "anyOf": [ - { - "items": { - "enum": [ - "address", - "email", - "phone", - "shipping", - "tax_id" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "enabled": { - "type": "boolean" - } - }, - "title": "customer_update_updating_param", - "type": "object" - }, - "invoice_history": { - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "invoice_list_param", - "type": "object" - }, - "payment_method_update": { - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "payment_method_update_param", - "type": "object" - }, - "subscription_cancel": { - "properties": { - "cancellation_reason": { - "properties": { - "enabled": { - "type": "boolean" - }, - "options": { - "anyOf": [ - { - "items": { - "enum": [ - "customer_service", - "low_quality", - "missing_features", - "other", - "switched_service", - "too_complex", - "too_expensive", - "unused" - ], - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "required": [ - "enabled" - ], - "title": "subscription_cancellation_reason_updating_param", - "type": "object" - }, - "enabled": { - "type": "boolean" - }, - "mode": { - "enum": [ - "at_period_end", - "immediately" - ], - "type": "string" - }, - "proration_behavior": { - "enum": [ - "always_invoice", - "create_prorations", - "none" - ], - "type": "string" - } - }, - "title": "subscription_cancel_updating_param", - "type": "object" - }, - "subscription_pause": { - "properties": { - "enabled": { - "type": "boolean" - } - }, - "title": "subscription_pause_param", - "type": "object" - }, - "subscription_update": { - "properties": { - "default_allowed_updates": { - "anyOf": [ - { - "items": { - "enum": [ - "price", - "promotion_code", - "quantity" - ], - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "enabled": { - "type": "boolean" - }, - "products": { - "anyOf": [ - { - "items": { - "properties": { - "prices": { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "product": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "prices", - "product" - ], - "title": "subscription_update_product_param", - "type": "object" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "proration_behavior": { - "enum": [ - "always_invoice", - "create_prorations", - "none" - ], - "type": "string" - } - }, - "title": "subscription_update_updating_param", - "type": "object" - } - }, - "title": "features_updating_param", - "type": "object" - }, - "login_page": { - "description": "The hosted login page for this configuration. Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share).", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "login_page_update_param", - "type": "object" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/billing_portal.configuration" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/billing_portal/sessions": { - "post": { - "description": "Creates a session of the customer portal.
", - "operationId": "PostBillingPortalSessions", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "flow_data": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "configuration": { - "description": "The ID of an existing [configuration](https://stripe.com/docs/api/customer_portal/configuration) to use for this session, describing its functionality and features. If not specified, the session uses the default configuration.", - "maxLength": 5000, - "type": "string" - }, - "customer": { - "description": "The ID of an existing customer.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "flow_data": { - "description": "Information about a specific flow for the customer to go through.", - "properties": { - "after_completion": { - "properties": { - "hosted_confirmation": { - "properties": { - "custom_message": { - "maxLength": 500, - "type": "string" - } - }, - "title": "after_completion_hosted_confirmation_param", - "type": "object" - }, - "redirect": { - "properties": { - "return_url": { - "type": "string" - } - }, - "required": [ - "return_url" - ], - "title": "after_completion_redirect_param", - "type": "object" - }, - "type": { - "enum": [ - "hosted_confirmation", - "portal_homepage", - "redirect" - ], - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "flow_data_after_completion_param", - "type": "object" - }, - "subscription_cancel": { - "properties": { - "subscription": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "subscription" - ], - "title": "flow_data_subscription_cancel_param", - "type": "object" - }, - "type": { - "enum": [ - "payment_method_update", - "subscription_cancel" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "required": [ - "type" - ], - "title": "flow_data_param", - "type": "object" - }, - "locale": { - "description": "The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s `preferred_locales` or browser’s locale is used.", - "enum": [ - "auto", - "bg", - "cs", - "da", - "de", - "el", - "en", - "en-AU", - "en-CA", - "en-GB", - "en-IE", - "en-IN", - "en-NZ", - "en-SG", - "es", - "es-419", - "et", - "fi", - "fil", - "fr", - "fr-CA", - "hr", - "hu", - "id", - "it", - "ja", - "ko", - "lt", - "lv", - "ms", - "mt", - "nb", - "nl", - "pl", - "pt", - "pt-BR", - "ro", - "ru", - "sk", - "sl", - "sv", - "th", - "tr", - "vi", - "zh", - "zh-HK", - "zh-TW" - ], - "type": "string" - }, - "on_behalf_of": { - "description": "The `on_behalf_of` account to use for this session. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/charges-transfers#on-behalf-of). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays.", - "type": "string" - }, - "return_url": { - "description": "The default URL to redirect customers to when they click on the portal's link to return to your website.", - "type": "string" - } - }, - "required": [ - "customer" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/billing_portal.session" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/charges": { - "get": { - "description": "Returns a list of charges you’ve previously created. The charges are returned in sorted order, with the most recent charges appearing first.
", - "operationId": "GetCharges", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "Only return charges for the customer specified by this customer ID.", - "in": "query", - "name": "customer", - "required": false, - "schema": { - "maxLength": 5000, - "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": { - "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": "Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID.", - "in": "query", - "name": "payment_intent", - "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": { - "type": "string" - }, - "style": "form" - }, - { - "description": "Only return charges for this transfer group.", - "in": "query", - "name": "transfer_group", - "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/charge" - }, - "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/charges", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "ChargeList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "To charge a credit card or other payment source, you create a Charge
object. If your API key is in test mode, the supplied payment source (e.g., card) won’t actually be charged, although everything else will occur as if in live mode. (Stripe assumes that the charge would have completed successfully).
Search for charges you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
", - "operationId": "GetChargesSearch", - "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" - }, - { - "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": "A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.", - "in": "query", - "name": "page", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for charges](https://stripe.com/docs/search#query-fields-for-charges).", - "in": "query", - "name": "query", - "required": true, - "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/charge" - }, - "type": "array" - }, - "has_more": { - "type": "boolean" - }, - "next_page": { - "maxLength": 5000, - "nullable": true, - "type": "string" - }, - "object": { - "description": "String representing the object's type. Objects of the same type share the same value.", - "enum": [ - "search_result" - ], - "type": "string" - }, - "total_count": { - "description": "The total number of objects that match the query, only accurate up to 10,000.", - "type": "integer" - }, - "url": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "SearchResult", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/charges/{charge}": { - "get": { - "description": "Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.
", - "operationId": "GetChargesCharge", - "parameters": [ - { - "in": "path", - "name": "charge", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/charge" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
", - "operationId": "PostChargesCharge", - "parameters": [ - { - "in": "path", - "name": "charge", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "fraud_details": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "shipping": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "customer": { - "description": "The ID of an existing customer that will be associated with this request. This field may only be updated if there is no existing associated customer with this charge.", - "maxLength": 5000, - "type": "string" - }, - "description": { - "description": "An arbitrary string which you can attach to a charge object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing.", - "maxLength": 40000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "fraud_details": { - "description": "A set of key-value pairs you can attach to a charge giving information about its riskiness. If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. If you believe a charge is safe, include a `user_report` key with a value of `safe`. Stripe will use the information you send to improve our fraud detection algorithms.", - "properties": { - "user_report": { - "enum": [ - "", - "fraudulent", - "safe" - ], - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "user_report" - ], - "title": "fraud_details", - "type": "object" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "receipt_email": { - "description": "This is the email address that the receipt for this charge will be sent to. If this field is updated, then a new email receipt will be sent to the updated address.", - "maxLength": 5000, - "type": "string" - }, - "shipping": { - "description": "Shipping information for the charge. Helps prevent fraud on charges for physical goods.", - "properties": { - "address": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "optional_fields_address", - "type": "object" - }, - "carrier": { - "maxLength": 5000, - "type": "string" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "maxLength": 5000, - "type": "string" - }, - "tracking_number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "address", - "name" - ], - "title": "optional_fields_shipping", - "type": "object" - }, - "transfer_group": { - "description": "A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/charges-transfers#transfer-options) for details.", - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/charge" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/charges/{charge}/capture": { - "post": { - "description": "Capture the payment of an existing, uncaptured, charge. This is the second half of the two-step payment flow, where first you created a charge with the capture option set to false.
\n\nUncaptured payments expire a set number of days after they are created (7 by default). If they are not captured by that point in time, they will be marked as refunded and will no longer be capturable.
", - "operationId": "PostChargesChargeCapture", - "parameters": [ - { - "in": "path", - "name": "charge", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "transfer_data": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "The amount to capture, which must be less than or equal to the original amount. Any additional amount will be automatically refunded.", - "type": "integer" - }, - "application_fee": { - "description": "An application fee to add on to this charge.", - "type": "integer" - }, - "application_fee_amount": { - "description": "An application fee amount to add on to this charge, which must be less than or equal to the original amount.", - "type": "integer" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "receipt_email": { - "description": "The email address to send this charge's receipt to. This will override the previously-specified email address for this charge, if one was set. Receipts will not be sent in test mode.", - "type": "string" - }, - "statement_descriptor": { - "description": "For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters.", - "maxLength": 22, - "type": "string" - }, - "statement_descriptor_suffix": { - "description": "Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.", - "maxLength": 22, - "type": "string" - }, - "transfer_data": { - "description": "An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details.", - "properties": { - "amount": { - "type": "integer" - } - }, - "title": "transfer_data_specs", - "type": "object" - }, - "transfer_group": { - "description": "A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/charges-transfers#transfer-options) for details.", - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/charge" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/charges/{charge}/dispute": { - "get": { - "description": "Retrieve a dispute for a specified charge.
", - "operationId": "GetChargesChargeDispute", - "parameters": [ - { - "in": "path", - "name": "charge", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/dispute" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "", - "operationId": "PostChargesChargeDispute", - "parameters": [ - { - "in": "path", - "name": "charge", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "evidence": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "evidence": { - "description": "Evidence to upload, to respond to a dispute. Updating any field in the hash will submit all fields in the hash for review. The combined character count of all fields is limited to 150,000.", - "properties": { - "access_activity_log": { - "maxLength": 20000, - "type": "string" - }, - "billing_address": { - "maxLength": 5000, - "type": "string" - }, - "cancellation_policy": { - "type": "string" - }, - "cancellation_policy_disclosure": { - "maxLength": 20000, - "type": "string" - }, - "cancellation_rebuttal": { - "maxLength": 20000, - "type": "string" - }, - "customer_communication": { - "type": "string" - }, - "customer_email_address": { - "maxLength": 5000, - "type": "string" - }, - "customer_name": { - "maxLength": 5000, - "type": "string" - }, - "customer_purchase_ip": { - "maxLength": 5000, - "type": "string" - }, - "customer_signature": { - "type": "string" - }, - "duplicate_charge_documentation": { - "type": "string" - }, - "duplicate_charge_explanation": { - "maxLength": 20000, - "type": "string" - }, - "duplicate_charge_id": { - "maxLength": 5000, - "type": "string" - }, - "product_description": { - "maxLength": 20000, - "type": "string" - }, - "receipt": { - "type": "string" - }, - "refund_policy": { - "type": "string" - }, - "refund_policy_disclosure": { - "maxLength": 20000, - "type": "string" - }, - "refund_refusal_explanation": { - "maxLength": 20000, - "type": "string" - }, - "service_date": { - "maxLength": 5000, - "type": "string" - }, - "service_documentation": { - "type": "string" - }, - "shipping_address": { - "maxLength": 5000, - "type": "string" - }, - "shipping_carrier": { - "maxLength": 5000, - "type": "string" - }, - "shipping_date": { - "maxLength": 5000, - "type": "string" - }, - "shipping_documentation": { - "type": "string" - }, - "shipping_tracking_number": { - "maxLength": 5000, - "type": "string" - }, - "uncategorized_file": { - "type": "string" - }, - "uncategorized_text": { - "maxLength": 20000, - "type": "string" - } - }, - "title": "dispute_evidence_params", - "type": "object" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "submit": { - "description": "Whether to immediately submit evidence to the bank. If `false`, evidence is staged on the dispute. Staged evidence is visible in the API and Dashboard, and can be submitted to the bank by making another request with this attribute set to `true` (the default).", - "type": "boolean" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/dispute" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/charges/{charge}/dispute/close": { - "post": { - "description": "", - "operationId": "PostChargesChargeDisputeClose", - "parameters": [ - { - "in": "path", - "name": "charge", - "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/dispute" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/charges/{charge}/refund": { - "post": { - "description": "When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.
\n\nCreating a new refund will refund a charge that has previously been created but not yet refunded.\nFunds will be refunded to the credit or debit card that was originally charged.
\n\nYou can optionally refund only part of a charge.\nYou can do so multiple times, until the entire charge has been refunded.
\n\nOnce entirely refunded, a charge can’t be refunded again.\nThis method will raise an error when called on an already-refunded charge,\nor when trying to refund more money than is left on a charge.
", - "operationId": "PostChargesChargeRefund", - "parameters": [ - { - "in": "path", - "name": "charge", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "type": "integer" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "instructions_email": { - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "payment_intent": { - "maxLength": 5000, - "type": "string" - }, - "reason": { - "enum": [ - "duplicate", - "fraudulent", - "requested_by_customer" - ], - "maxLength": 5000, - "type": "string" - }, - "refund_application_fee": { - "type": "boolean" - }, - "reverse_transfer": { - "type": "boolean" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/charge" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/charges/{charge}/refunds": { - "get": { - "description": "You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the limit
and starting_after
parameters to page through additional refunds.
Create a refund.
", - "operationId": "PostChargesChargeRefunds", - "parameters": [ - { - "in": "path", - "name": "charge", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "A positive integer representing how much to refund.", - "type": "integer" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "customer": { - "description": "Customer whose customer balance to refund from.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "instructions_email": { - "description": "Address to send refund email, use customer email if not specified", - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "origin": { - "description": "Origin of the refund", - "enum": [ - "customer_balance" - ], - "type": "string" - }, - "payment_intent": { - "maxLength": 5000, - "type": "string" - }, - "reason": { - "enum": [ - "duplicate", - "fraudulent", - "requested_by_customer" - ], - "maxLength": 5000, - "type": "string" - }, - "refund_application_fee": { - "type": "boolean" - }, - "reverse_transfer": { - "type": "boolean" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/refund" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/charges/{charge}/refunds/{refund}": { - "get": { - "description": "Retrieves the details of an existing refund.
", - "operationId": "GetChargesChargeRefundsRefund", - "parameters": [ - { - "in": "path", - "name": "charge", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - { - "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": "refund", - "required": true, - "schema": { - "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/refund" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Update a specified refund.
", - "operationId": "PostChargesChargeRefundsRefund", - "parameters": [ - { - "in": "path", - "name": "charge", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "refund", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "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" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/refund" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/checkout/sessions": { - "get": { - "description": "Returns a list of Checkout Sessions.
", - "operationId": "GetCheckoutSessions", - "parameters": [ - { - "description": "Only return the Checkout Sessions for the Customer specified.", - "in": "query", - "name": "customer", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "Only return the Checkout Sessions for the Customer details specified.", - "explode": true, - "in": "query", - "name": "customer_details", - "required": false, - "schema": { - "properties": { - "email": { - "type": "string" - } - }, - "required": [ - "email" - ], - "title": "customer_details_params", - "type": "object" - }, - "style": "deepObject" - }, - { - "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": "Only return the Checkout Session for the PaymentIntent specified.", - "in": "query", - "name": "payment_intent", - "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" - }, - { - "description": "Only return the Checkout Session for the subscription specified.", - "in": "query", - "name": "subscription", - "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/checkout.session" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "PaymentPagesCheckoutSessionList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a Session object.
", - "operationId": "PostCheckoutSessions", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "after_expiration": { - "explode": true, - "style": "deepObject" - }, - "automatic_tax": { - "explode": true, - "style": "deepObject" - }, - "consent_collection": { - "explode": true, - "style": "deepObject" - }, - "custom_text": { - "explode": true, - "style": "deepObject" - }, - "customer_update": { - "explode": true, - "style": "deepObject" - }, - "discounts": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "invoice_creation": { - "explode": true, - "style": "deepObject" - }, - "line_items": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "payment_intent_data": { - "explode": true, - "style": "deepObject" - }, - "payment_method_options": { - "explode": true, - "style": "deepObject" - }, - "payment_method_types": { - "explode": true, - "style": "deepObject" - }, - "phone_number_collection": { - "explode": true, - "style": "deepObject" - }, - "setup_intent_data": { - "explode": true, - "style": "deepObject" - }, - "shipping_address_collection": { - "explode": true, - "style": "deepObject" - }, - "shipping_options": { - "explode": true, - "style": "deepObject" - }, - "subscription_data": { - "explode": true, - "style": "deepObject" - }, - "tax_id_collection": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "after_expiration": { - "description": "Configure actions after a Checkout Session has expired.", - "properties": { - "recovery": { - "properties": { - "allow_promotion_codes": { - "type": "boolean" - }, - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "recovery_params", - "type": "object" - } - }, - "title": "after_expiration_params", - "type": "object" - }, - "allow_promotion_codes": { - "description": "Enables user redeemable promotion codes.", - "type": "boolean" - }, - "automatic_tax": { - "description": "Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions.", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "automatic_tax_params", - "type": "object" - }, - "billing_address_collection": { - "description": "Specify whether Checkout should collect the customer's billing address.", - "enum": [ - "auto", - "required" - ], - "type": "string" - }, - "cancel_url": { - "description": "If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website.", - "maxLength": 5000, - "type": "string" - }, - "client_reference_id": { - "description": "A unique string to reference the Checkout Session. This can be a\ncustomer ID, a cart ID, or similar, and can be used to reconcile the\nsession with your internal systems.", - "maxLength": 200, - "type": "string" - }, - "consent_collection": { - "description": "Configure fields for the Checkout Session to gather active consent from customers.", - "properties": { - "promotions": { - "enum": [ - "auto", - "none" - ], - "type": "string" - }, - "terms_of_service": { - "enum": [ - "none", - "required" - ], - "type": "string" - } - }, - "title": "consent_collection_params", - "type": "object" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "custom_text": { - "description": "Display additional text for your customers using custom text.", - "properties": { - "shipping_address": { - "anyOf": [ - { - "properties": { - "message": { - "maxLength": 500, - "type": "string" - } - }, - "required": [ - "message" - ], - "title": "custom_text_position_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "submit": { - "anyOf": [ - { - "properties": { - "message": { - "maxLength": 500, - "type": "string" - } - }, - "required": [ - "message" - ], - "title": "custom_text_position_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "custom_text_param", - "type": "object" - }, - "customer": { - "description": "ID of an existing Customer, if one exists. In `payment` mode, the customer’s most recent card\npayment method will be used to prefill the email, name, card details, and billing address\non the Checkout page. In `subscription` mode, the customer’s [default payment method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method)\nwill be used if it’s a card, and otherwise the most recent card will be used. A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details.\n\nIf the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout.\nIf the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer.\n\nIf blank for Checkout Sessions in `payment` or `subscription` mode, Checkout will create a new Customer object based on information provided during the payment flow.\n\nYou can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse.", - "maxLength": 5000, - "type": "string" - }, - "customer_creation": { - "description": "Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation.\n\nWhen a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout\nwith [customer_details](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details).\n\nSessions that don't create Customers instead are grouped by [guest customers](https://stripe.com/docs/payments/checkout/guest-customers)\nin the Dashboard. Promotion codes limited to first time customers will return invalid for these Sessions.\n\nCan only be set in `payment` and `setup` mode.", - "enum": [ - "always", - "if_required" - ], - "type": "string" - }, - "customer_email": { - "description": "If provided, this value will be used when the Customer object is created.\nIf not provided, customers will be asked to enter their email address.\nUse this parameter to prefill customer data if you already have an email\non file. To access information about the customer once a session is\ncomplete, use the `customer` field.", - "type": "string" - }, - "customer_update": { - "description": "Controls what fields on Customer can be updated by the Checkout Session. Can only be provided when `customer` is provided.", - "properties": { - "address": { - "enum": [ - "auto", - "never" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "name": { - "enum": [ - "auto", - "never" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "shipping": { - "enum": [ - "auto", - "never" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "customer_update_params", - "type": "object" - }, - "discounts": { - "description": "The coupon or promotion code to apply to this Session. Currently, only up to one may be specified.", - "items": { - "properties": { - "coupon": { - "maxLength": 5000, - "type": "string" - }, - "promotion_code": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "discount_params", - "type": "object" - }, - "type": "array" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "expires_at": { - "description": "The Epoch time in seconds at which the Checkout Session will expire. It can be anywhere from 30 minutes to 24 hours after Checkout Session creation. By default, this value is 24 hours from creation.", - "format": "unix-time", - "type": "integer" - }, - "invoice_creation": { - "description": "Generate a post-purchase Invoice for one-time payments.", - "properties": { - "enabled": { - "type": "boolean" - }, - "invoice_data": { - "properties": { - "account_tax_ids": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "custom_fields": { - "anyOf": [ - { - "items": { - "properties": { - "name": { - "maxLength": 30, - "type": "string" - }, - "value": { - "maxLength": 30, - "type": "string" - } - }, - "required": [ - "name", - "value" - ], - "title": "custom_field_params", - "type": "object" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "description": { - "maxLength": 1500, - "type": "string" - }, - "footer": { - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "rendering_options": { - "anyOf": [ - { - "properties": { - "amount_tax_display": { - "enum": [ - "", - "exclude_tax", - "include_inclusive_tax" - ], - "type": "string" - } - }, - "title": "rendering_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "invoice_data_params", - "type": "object" - } - }, - "required": [ - "enabled" - ], - "title": "invoice_creation_params", - "type": "object" - }, - "line_items": { - "description": "A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices).\n\nFor `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen.\n\nFor `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. Line items with one-time Prices will be on the initial invoice only.", - "items": { - "properties": { - "adjustable_quantity": { - "properties": { - "enabled": { - "type": "boolean" - }, - "maximum": { - "type": "integer" - }, - "minimum": { - "type": "integer" - } - }, - "required": [ - "enabled" - ], - "title": "adjustable_quantity_params", - "type": "object" - }, - "dynamic_tax_rates": { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "price": { - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "product_data": { - "properties": { - "description": { - "maxLength": 40000, - "type": "string" - }, - "images": { - "items": { - "type": "string" - }, - "type": "array" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "tax_code": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "name" - ], - "title": "product_data", - "type": "object" - }, - "recurring": { - "properties": { - "interval": { - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - } - }, - "required": [ - "interval" - ], - "title": "recurring_adhoc", - "type": "object" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency" - ], - "title": "price_data_with_product_data", - "type": "object" - }, - "quantity": { - "type": "integer" - }, - "tax_rates": { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - } - }, - "title": "line_item_params", - "type": "object" - }, - "type": "array" - }, - "locale": { - "description": "The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's locale is used.", - "enum": [ - "auto", - "bg", - "cs", - "da", - "de", - "el", - "en", - "en-GB", - "es", - "es-419", - "et", - "fi", - "fil", - "fr", - "fr-CA", - "hr", - "hu", - "id", - "it", - "ja", - "ko", - "lt", - "lv", - "ms", - "mt", - "nb", - "nl", - "pl", - "pt", - "pt-BR", - "ro", - "ru", - "sk", - "sl", - "sv", - "th", - "tr", - "vi", - "zh", - "zh-HK", - "zh-TW" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "mode": { - "description": "The mode of the Checkout Session. Pass `subscription` if the Checkout Session includes at least one recurring item.", - "enum": [ - "payment", - "setup", - "subscription" - ], - "type": "string" - }, - "payment_intent_data": { - "description": "A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode.", - "properties": { - "application_fee_amount": { - "type": "integer" - }, - "capture_method": { - "enum": [ - "automatic", - "manual" - ], - "type": "string" - }, - "description": { - "maxLength": 1000, - "type": "string" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "on_behalf_of": { - "type": "string" - }, - "receipt_email": { - "type": "string" - }, - "setup_future_usage": { - "enum": [ - "off_session", - "on_session" - ], - "type": "string" - }, - "shipping": { - "properties": { - "address": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "line1" - ], - "title": "address", - "type": "object" - }, - "carrier": { - "maxLength": 5000, - "type": "string" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "maxLength": 5000, - "type": "string" - }, - "tracking_number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "address", - "name" - ], - "title": "shipping", - "type": "object" - }, - "statement_descriptor": { - "maxLength": 22, - "type": "string" - }, - "statement_descriptor_suffix": { - "maxLength": 22, - "type": "string" - }, - "transfer_data": { - "properties": { - "amount": { - "type": "integer" - }, - "destination": { - "type": "string" - } - }, - "required": [ - "destination" - ], - "title": "transfer_data_params", - "type": "object" - }, - "transfer_group": { - "type": "string" - } - }, - "title": "payment_intent_data_params", - "type": "object" - }, - "payment_method_collection": { - "description": "Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.\nThis may occur if the Checkout Session includes a free trial or a discount.\n\nCan only be set in `subscription` mode.\n\nIf you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials).", - "enum": [ - "always", - "if_required" - ], - "type": "string" - }, - "payment_method_options": { - "description": "Payment-method-specific configuration.", - "properties": { - "acss_debit": { - "properties": { - "currency": { - "enum": [ - "cad", - "usd" - ], - "type": "string" - }, - "mandate_options": { - "properties": { - "custom_mandate_url": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "default_for": { - "items": { - "enum": [ - "invoice", - "subscription" - ], - "type": "string" - }, - "type": "array" - }, - "interval_description": { - "maxLength": 500, - "type": "string" - }, - "payment_schedule": { - "enum": [ - "combined", - "interval", - "sporadic" - ], - "type": "string" - }, - "transaction_type": { - "enum": [ - "business", - "personal" - ], - "type": "string" - } - }, - "title": "mandate_options_param", - "type": "object" - }, - "setup_future_usage": { - "enum": [ - "none", - "off_session", - "on_session" - ], - "type": "string" - }, - "verification_method": { - "enum": [ - "automatic", - "instant", - "microdeposits" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "affirm": { - "properties": { - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "afterpay_clearpay": { - "properties": { - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "alipay": { - "properties": { - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "au_becs_debit": { - "properties": { - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "bacs_debit": { - "properties": { - "setup_future_usage": { - "enum": [ - "none", - "off_session", - "on_session" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "bancontact": { - "properties": { - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "boleto": { - "properties": { - "expires_after_days": { - "type": "integer" - }, - "setup_future_usage": { - "enum": [ - "none", - "off_session", - "on_session" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "card": { - "properties": { - "installments": { - "properties": { - "enabled": { - "type": "boolean" - } - }, - "title": "installments_param", - "type": "object" - }, - "setup_future_usage": { - "enum": [ - "off_session", - "on_session" - ], - "type": "string" - }, - "statement_descriptor_suffix_kana": { - "maxLength": 22, - "type": "string" - }, - "statement_descriptor_suffix_kanji": { - "maxLength": 17, - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "customer_balance": { - "properties": { - "bank_transfer": { - "properties": { - "eu_bank_transfer": { - "properties": { - "country": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "country" - ], - "title": "eu_bank_transfer_params", - "type": "object" - }, - "requested_address_types": { - "items": { - "enum": [ - "iban", - "sepa", - "sort_code", - "spei", - "zengin" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - }, - "type": { - "enum": [ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "required": [ - "type" - ], - "title": "bank_transfer_param", - "type": "object" - }, - "funding_type": { - "enum": [ - "bank_transfer" - ], - "type": "string" - }, - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "eps": { - "properties": { - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "fpx": { - "properties": { - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "giropay": { - "properties": { - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "grabpay": { - "properties": { - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "ideal": { - "properties": { - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "klarna": { - "properties": { - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "konbini": { - "properties": { - "expires_after_days": { - "type": "integer" - }, - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "oxxo": { - "properties": { - "expires_after_days": { - "type": "integer" - }, - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "p24": { - "properties": { - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - }, - "tos_shown_and_accepted": { - "type": "boolean" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "paynow": { - "properties": { - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "pix": { - "properties": { - "expires_after_seconds": { - "type": "integer" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "sepa_debit": { - "properties": { - "setup_future_usage": { - "enum": [ - "none", - "off_session", - "on_session" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "sofort": { - "properties": { - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "us_bank_account": { - "properties": { - "financial_connections": { - "properties": { - "permissions": { - "items": { - "enum": [ - "balances", - "ownership", - "payment_method", - "transactions" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - } - }, - "title": "linked_account_options_param", - "type": "object" - }, - "setup_future_usage": { - "enum": [ - "none", - "off_session", - "on_session" - ], - "type": "string" - }, - "verification_method": { - "enum": [ - "automatic", - "instant" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "wechat_pay": { - "properties": { - "app_id": { - "maxLength": 5000, - "type": "string" - }, - "client": { - "enum": [ - "android", - "ios", - "web" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "setup_future_usage": { - "enum": [ - "none" - ], - "type": "string" - } - }, - "required": [ - "client" - ], - "title": "payment_method_options_param", - "type": "object" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "payment_method_types": { - "description": "A list of the types of payment methods (e.g., `card`) this Checkout Session can accept.\n\nIn `payment` and `subscription` mode, you can omit this attribute to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).\nIt is required in `setup` mode.\n\nRead more about the supported payment methods and their requirements in our [payment\nmethod details guide](/docs/payments/checkout/payment-methods).\n\nIf multiple payment methods are passed, Checkout will dynamically reorder them to\nprioritize the most relevant payment methods based on the customer's location and\nother characteristics.", - "items": { - "enum": [ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "blik", - "boleto", - "card", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "klarna", - "konbini", - "oxxo", - "p24", - "paynow", - "pix", - "promptpay", - "sepa_debit", - "sofort", - "us_bank_account", - "wechat_pay" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - }, - "phone_number_collection": { - "description": "Controls phone number collection settings for the session.\n\nWe recommend that you review your privacy policy and check with your legal contacts\nbefore using this feature. Learn more about [collecting phone numbers with Checkout](https://stripe.com/docs/payments/checkout/phone-numbers).", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "phone_number_collection_params", - "type": "object" - }, - "setup_intent_data": { - "description": "A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode.", - "properties": { - "description": { - "maxLength": 1000, - "type": "string" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "on_behalf_of": { - "type": "string" - } - }, - "title": "setup_intent_data_param", - "type": "object" - }, - "shipping_address_collection": { - "description": "When set, provides configuration for Checkout to collect a shipping address from a customer.", - "properties": { - "allowed_countries": { - "items": { - "enum": [ - "AC", - "AD", - "AE", - "AF", - "AG", - "AI", - "AL", - "AM", - "AO", - "AQ", - "AR", - "AT", - "AU", - "AW", - "AX", - "AZ", - "BA", - "BB", - "BD", - "BE", - "BF", - "BG", - "BH", - "BI", - "BJ", - "BL", - "BM", - "BN", - "BO", - "BQ", - "BR", - "BS", - "BT", - "BV", - "BW", - "BY", - "BZ", - "CA", - "CD", - "CF", - "CG", - "CH", - "CI", - "CK", - "CL", - "CM", - "CN", - "CO", - "CR", - "CV", - "CW", - "CY", - "CZ", - "DE", - "DJ", - "DK", - "DM", - "DO", - "DZ", - "EC", - "EE", - "EG", - "EH", - "ER", - "ES", - "ET", - "FI", - "FJ", - "FK", - "FO", - "FR", - "GA", - "GB", - "GD", - "GE", - "GF", - "GG", - "GH", - "GI", - "GL", - "GM", - "GN", - "GP", - "GQ", - "GR", - "GS", - "GT", - "GU", - "GW", - "GY", - "HK", - "HN", - "HR", - "HT", - "HU", - "ID", - "IE", - "IL", - "IM", - "IN", - "IO", - "IQ", - "IS", - "IT", - "JE", - "JM", - "JO", - "JP", - "KE", - "KG", - "KH", - "KI", - "KM", - "KN", - "KR", - "KW", - "KY", - "KZ", - "LA", - "LB", - "LC", - "LI", - "LK", - "LR", - "LS", - "LT", - "LU", - "LV", - "LY", - "MA", - "MC", - "MD", - "ME", - "MF", - "MG", - "MK", - "ML", - "MM", - "MN", - "MO", - "MQ", - "MR", - "MS", - "MT", - "MU", - "MV", - "MW", - "MX", - "MY", - "MZ", - "NA", - "NC", - "NE", - "NG", - "NI", - "NL", - "NO", - "NP", - "NR", - "NU", - "NZ", - "OM", - "PA", - "PE", - "PF", - "PG", - "PH", - "PK", - "PL", - "PM", - "PN", - "PR", - "PS", - "PT", - "PY", - "QA", - "RE", - "RO", - "RS", - "RU", - "RW", - "SA", - "SB", - "SC", - "SE", - "SG", - "SH", - "SI", - "SJ", - "SK", - "SL", - "SM", - "SN", - "SO", - "SR", - "SS", - "ST", - "SV", - "SX", - "SZ", - "TA", - "TC", - "TD", - "TF", - "TG", - "TH", - "TJ", - "TK", - "TL", - "TM", - "TN", - "TO", - "TR", - "TT", - "TV", - "TW", - "TZ", - "UA", - "UG", - "US", - "UY", - "UZ", - "VA", - "VC", - "VE", - "VG", - "VN", - "VU", - "WF", - "WS", - "XK", - "YE", - "YT", - "ZA", - "ZM", - "ZW", - "ZZ" - ], - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "allowed_countries" - ], - "title": "shipping_address_collection_params", - "type": "object" - }, - "shipping_options": { - "description": "The shipping rate options to apply to this Session.", - "items": { - "properties": { - "shipping_rate": { - "maxLength": 5000, - "type": "string" - }, - "shipping_rate_data": { - "properties": { - "delivery_estimate": { - "properties": { - "maximum": { - "properties": { - "unit": { - "enum": [ - "business_day", - "day", - "hour", - "month", - "week" - ], - "type": "string" - }, - "value": { - "type": "integer" - } - }, - "required": [ - "unit", - "value" - ], - "title": "delivery_estimate_bound", - "type": "object" - }, - "minimum": { - "properties": { - "unit": { - "enum": [ - "business_day", - "day", - "hour", - "month", - "week" - ], - "type": "string" - }, - "value": { - "type": "integer" - } - }, - "required": [ - "unit", - "value" - ], - "title": "delivery_estimate_bound", - "type": "object" - } - }, - "title": "delivery_estimate", - "type": "object" - }, - "display_name": { - "maxLength": 100, - "type": "string" - }, - "fixed_amount": { - "properties": { - "amount": { - "type": "integer" - }, - "currency": { - "type": "string" - }, - "currency_options": { - "additionalProperties": { - "properties": { - "amount": { - "type": "integer" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - } - }, - "required": [ - "amount" - ], - "title": "currency_option", - "type": "object" - }, - "type": "object" - } - }, - "required": [ - "amount", - "currency" - ], - "title": "fixed_amount", - "type": "object" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "tax_code": { - "type": "string" - }, - "type": { - "enum": [ - "fixed_amount" - ], - "type": "string" - } - }, - "required": [ - "display_name" - ], - "title": "method_params", - "type": "object" - } - }, - "title": "shipping_option_params", - "type": "object" - }, - "type": "array" - }, - "submit_type": { - "description": "Describes the type of transaction being performed by Checkout in order to customize\nrelevant text on the page, such as the submit button. `submit_type` can only be\nspecified on Checkout Sessions in `payment` mode, but not Checkout Sessions\nin `subscription` or `setup` mode.", - "enum": [ - "auto", - "book", - "donate", - "pay" - ], - "type": "string" - }, - "subscription_data": { - "description": "A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode.", - "properties": { - "application_fee_percent": { - "type": "number" - }, - "default_tax_rates": { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "description": { - "maxLength": 500, - "type": "string" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "on_behalf_of": { - "type": "string" - }, - "transfer_data": { - "properties": { - "amount_percent": { - "type": "number" - }, - "destination": { - "type": "string" - } - }, - "required": [ - "destination" - ], - "title": "transfer_data_specs", - "type": "object" - }, - "trial_end": { - "format": "unix-time", - "type": "integer" - }, - "trial_period_days": { - "type": "integer" - } - }, - "title": "subscription_data_params", - "type": "object" - }, - "success_url": { - "description": "The URL to which Stripe should send customers when payment or setup\nis complete.\nIf you’d like to use information from the successful Checkout Session on your page,\nread the guide on [customizing your success page](https://stripe.com/docs/payments/checkout/custom-success-page).", - "maxLength": 5000, - "type": "string" - }, - "tax_id_collection": { - "description": "Controls tax ID collection settings for the session.", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "tax_id_collection_params", - "type": "object" - } - }, - "required": [ - "success_url" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/checkout.session" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/checkout/sessions/{session}": { - "get": { - "description": "Retrieves a Session object.
", - "operationId": "GetCheckoutSessionsSession", - "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": "session", - "required": true, - "schema": { - "maxLength": 66, - "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/checkout.session" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/checkout/sessions/{session}/expire": { - "post": { - "description": "A Session can be expired when it is in one of these statuses: open
After it expires, a customer can’t complete a Session and customers loading the Session see a message saying the Session is expired.
", - "operationId": "PostCheckoutSessionsSessionExpire", - "parameters": [ - { - "in": "path", - "name": "session", - "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/checkout.session" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/checkout/sessions/{session}/line_items": { - "get": { - "description": "When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
", - "operationId": "GetCheckoutSessionsSessionLineItems", - "parameters": [ - { - "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" - }, - { - "in": "path", - "name": "session", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/item" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "PaymentPagesCheckoutSessionListLineItems", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/country_specs": { - "get": { - "description": "Lists all Country Spec objects available in the API.
", - "operationId": "GetCountrySpecs", - "parameters": [ - { - "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": "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/country_spec" - }, - "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/country_specs", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "CountrySpecList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/country_specs/{country}": { - "get": { - "description": "Returns a Country Spec for a given Country code.
", - "operationId": "GetCountrySpecsCountry", - "parameters": [ - { - "in": "path", - "name": "country", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/country_spec" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/coupons": { - "get": { - "description": "Returns a list of your coupons.
", - "operationId": "GetCoupons", - "parameters": [ - { - "description": "A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.", - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": "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/coupon" - }, - "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/coupons", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "CouponsResourceCouponList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "You can create coupons easily via the coupon management page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly.
\n\nA coupon has either a percent_off
or an amount_off
and currency
. If you set an amount_off
, that amount will be subtracted from any invoice’s subtotal. For example, an invoice with a subtotal of amount_off
of amount_off
of
You can delete coupons via the coupon management page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can’t redeem the coupon. You can also delete coupons via the API.
", - "operationId": "DeleteCouponsCoupon", - "parameters": [ - { - "in": "path", - "name": "coupon", - "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/deleted_coupon" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "Retrieves the coupon with the given ID.
", - "operationId": "GetCouponsCoupon", - "parameters": [ - { - "in": "path", - "name": "coupon", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/coupon" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable.
", - "operationId": "PostCouponsCoupon", - "parameters": [ - { - "in": "path", - "name": "coupon", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "currency_options": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "currency_options": { - "additionalProperties": { - "properties": { - "amount_off": { - "type": "integer" - } - }, - "required": [ - "amount_off" - ], - "title": "currency_option", - "type": "object" - }, - "description": "Coupons defined in each available currency option (only supported if the coupon is amount-based). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).", - "type": "object" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "name": { - "description": "Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set.", - "maxLength": 40, - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/coupon" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/credit_notes": { - "get": { - "description": "Returns a list of credit notes.
", - "operationId": "GetCreditNotes", - "parameters": [ - { - "description": "Only return credit notes for the customer specified by this customer ID.", - "in": "query", - "name": "customer", - "required": false, - "schema": { - "maxLength": 5000, - "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": "Only return credit notes for the invoice specified by this invoice ID.", - "in": "query", - "name": "invoice", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "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": "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/credit_note" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "CreditNotesList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Issue a credit note to adjust the amount of a finalized invoice. For a status=open
invoice, a credit note reduces\nits amount_due
. For a status=paid
invoice, a credit note does not affect its amount_due
. Instead, it can result\nin any combination of the following:
refund_amount
) or link an existing refund (using refund
).credit_amount
) which will be automatically applied to their next invoice when it’s finalized.out_of_band_amount
).For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.
\n\nYou may issue multiple credit notes for an invoice. Each credit note will increment the invoice’s pre_payment_credit_notes_amount
\nor post_payment_credit_notes_amount
depending on its status
at the time of credit note creation.
Get a preview of a credit note without creating it.
", - "operationId": "GetCreditNotesPreview", - "parameters": [ - { - "description": "The integer amount in cents (or local equivalent) representing the total amount of the credit note.", - "in": "query", - "name": "amount", - "required": false, - "schema": { - "type": "integer" - }, - "style": "form" - }, - { - "description": "The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice.", - "in": "query", - "name": "credit_amount", - "required": false, - "schema": { - "type": "integer" - }, - "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": "ID of the invoice.", - "in": "query", - "name": "invoice", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "Line items that make up the credit note.", - "explode": true, - "in": "query", - "name": "lines", - "required": false, - "schema": { - "items": { - "properties": { - "amount": { - "type": "integer" - }, - "description": { - "maxLength": 5000, - "type": "string" - }, - "invoice_line_item": { - "maxLength": 5000, - "type": "string" - }, - "quantity": { - "type": "integer" - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "type": { - "enum": [ - "custom_line_item", - "invoice_line_item" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "credit_note_line_item_params", - "type": "object" - }, - "type": "array" - }, - "style": "deepObject" - }, - { - "description": "The credit note's memo appears on the credit note PDF.", - "in": "query", - "name": "memo", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "explode": true, - "in": "query", - "name": "metadata", - "required": false, - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "style": "deepObject" - }, - { - "description": "The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe.", - "in": "query", - "name": "out_of_band_amount", - "required": false, - "schema": { - "type": "integer" - }, - "style": "form" - }, - { - "description": "Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`", - "in": "query", - "name": "reason", - "required": false, - "schema": { - "enum": [ - "duplicate", - "fraudulent", - "order_change", - "product_unsatisfactory" - ], - "type": "string" - }, - "style": "form" - }, - { - "description": "ID of an existing refund to link this credit note to.", - "in": "query", - "name": "refund", - "required": false, - "schema": { - "type": "string" - }, - "style": "form" - }, - { - "description": "The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice.", - "in": "query", - "name": "refund_amount", - "required": false, - "schema": { - "type": "integer" - }, - "style": "form" - } - ], - "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/credit_note" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/credit_notes/preview/lines": { - "get": { - "description": "When retrieving a credit note preview, you’ll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.
", - "operationId": "GetCreditNotesPreviewLines", - "parameters": [ - { - "description": "The integer amount in cents (or local equivalent) representing the total amount of the credit note.", - "in": "query", - "name": "amount", - "required": false, - "schema": { - "type": "integer" - }, - "style": "form" - }, - { - "description": "The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice.", - "in": "query", - "name": "credit_amount", - "required": false, - "schema": { - "type": "integer" - }, - "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": "ID of the invoice.", - "in": "query", - "name": "invoice", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "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": "Line items that make up the credit note.", - "explode": true, - "in": "query", - "name": "lines", - "required": false, - "schema": { - "items": { - "properties": { - "amount": { - "type": "integer" - }, - "description": { - "maxLength": 5000, - "type": "string" - }, - "invoice_line_item": { - "maxLength": 5000, - "type": "string" - }, - "quantity": { - "type": "integer" - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "type": { - "enum": [ - "custom_line_item", - "invoice_line_item" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "credit_note_line_item_params", - "type": "object" - }, - "type": "array" - }, - "style": "deepObject" - }, - { - "description": "The credit note's memo appears on the credit note PDF.", - "in": "query", - "name": "memo", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "explode": true, - "in": "query", - "name": "metadata", - "required": false, - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "style": "deepObject" - }, - { - "description": "The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe.", - "in": "query", - "name": "out_of_band_amount", - "required": false, - "schema": { - "type": "integer" - }, - "style": "form" - }, - { - "description": "Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`", - "in": "query", - "name": "reason", - "required": false, - "schema": { - "enum": [ - "duplicate", - "fraudulent", - "order_change", - "product_unsatisfactory" - ], - "type": "string" - }, - "style": "form" - }, - { - "description": "ID of an existing refund to link this credit note to.", - "in": "query", - "name": "refund", - "required": false, - "schema": { - "type": "string" - }, - "style": "form" - }, - { - "description": "The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice.", - "in": "query", - "name": "refund_amount", - "required": false, - "schema": { - "type": "integer" - }, - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/credit_note_line_item" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "CreditNoteLinesList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/credit_notes/{credit_note}/lines": { - "get": { - "description": "When retrieving a credit note, you’ll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
", - "operationId": "GetCreditNotesCreditNoteLines", - "parameters": [ - { - "in": "path", - "name": "credit_note", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/credit_note_line_item" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "CreditNoteLinesList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/credit_notes/{id}": { - "get": { - "description": "Retrieves the credit note object with the given identifier.
", - "operationId": "GetCreditNotesId", - "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/credit_note" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates an existing credit note.
", - "operationId": "PostCreditNotesId", - "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" - }, - "metadata": { - "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" - }, - "memo": { - "description": "Credit note memo.", - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/credit_note" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/credit_notes/{id}/void": { - "post": { - "description": "Marks a credit note as void. Learn more about voiding credit notes.
", - "operationId": "PostCreditNotesIdVoid", - "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/credit_note" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers": { - "get": { - "description": "Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.
", - "operationId": "GetCustomers", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "A case-sensitive filter on the list based on the customer's `email` field. The value must be a string.", - "in": "query", - "name": "email", - "required": false, - "schema": { - "maxLength": 512, - "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": "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" - }, - { - "description": "Provides a list of customers that are associated with the specified test clock. The response will not include customers with test clocks if this parameter is not set.", - "in": "query", - "name": "test_clock", - "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/customer" - }, - "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/customers", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "CustomerResourceCustomerList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a new customer object.
", - "operationId": "PostCustomers", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "address": { - "explode": true, - "style": "deepObject" - }, - "cash_balance": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "invoice_settings": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "preferred_locales": { - "explode": true, - "style": "deepObject" - }, - "shipping": { - "explode": true, - "style": "deepObject" - }, - "tax": { - "explode": true, - "style": "deepObject" - }, - "tax_id_data": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "address": { - "anyOf": [ - { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "optional_fields_address", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The customer's address." - }, - "balance": { - "description": "An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice.", - "type": "integer" - }, - "cash_balance": { - "description": "Balance information and default balance settings for this customer.", - "properties": { - "settings": { - "properties": { - "reconciliation_mode": { - "enum": [ - "automatic", - "manual", - "merchant_default" - ], - "type": "string" - } - }, - "title": "balance_settings_param", - "type": "object" - } - }, - "title": "cash_balance_param", - "type": "object" - }, - "coupon": { - "maxLength": 5000, - "type": "string" - }, - "description": { - "description": "An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard.", - "maxLength": 5000, - "type": "string" - }, - "email": { - "description": "Customer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*.", - "maxLength": 512, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "invoice_prefix": { - "description": "The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers.", - "maxLength": 5000, - "type": "string" - }, - "invoice_settings": { - "description": "Default invoice settings for this customer.", - "properties": { - "custom_fields": { - "anyOf": [ - { - "items": { - "properties": { - "name": { - "maxLength": 30, - "type": "string" - }, - "value": { - "maxLength": 30, - "type": "string" - } - }, - "required": [ - "name", - "value" - ], - "title": "custom_field_params", - "type": "object" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "default_payment_method": { - "maxLength": 5000, - "type": "string" - }, - "footer": { - "maxLength": 5000, - "type": "string" - }, - "rendering_options": { - "anyOf": [ - { - "properties": { - "amount_tax_display": { - "enum": [ - "", - "exclude_tax", - "include_inclusive_tax" - ], - "type": "string" - } - }, - "title": "rendering_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "customer_param", - "type": "object" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "name": { - "description": "The customer's full name or business name.", - "maxLength": 256, - "type": "string" - }, - "next_invoice_sequence": { - "description": "The sequence to be used on the customer's next invoice. Defaults to 1.", - "type": "integer" - }, - "payment_method": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "description": "The customer's phone number.", - "maxLength": 20, - "type": "string" - }, - "preferred_locales": { - "description": "Customer's preferred languages, ordered by preference.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "promotion_code": { - "description": "The API ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount.", - "maxLength": 5000, - "type": "string" - }, - "shipping": { - "anyOf": [ - { - "properties": { - "address": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "optional_fields_address", - "type": "object" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "address", - "name" - ], - "title": "customer_shipping", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The customer's shipping information. Appears on invoices emailed to this customer." - }, - "source": { - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "tax": { - "description": "Tax details about the customer.", - "properties": { - "ip_address": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "tax_param", - "type": "object" - }, - "tax_exempt": { - "description": "The customer's tax exemption. One of `none`, `exempt`, or `reverse`.", - "enum": [ - "", - "exempt", - "none", - "reverse" - ], - "type": "string" - }, - "tax_id_data": { - "description": "The customer's tax IDs.", - "items": { - "properties": { - "type": { - "enum": [ - "ae_trn", - "au_abn", - "au_arn", - "bg_uic", - "br_cnpj", - "br_cpf", - "ca_bn", - "ca_gst_hst", - "ca_pst_bc", - "ca_pst_mb", - "ca_pst_sk", - "ca_qst", - "ch_vat", - "cl_tin", - "eg_tin", - "es_cif", - "eu_oss_vat", - "eu_vat", - "gb_vat", - "ge_vat", - "hk_br", - "hu_tin", - "id_npwp", - "il_vat", - "in_gst", - "is_vat", - "jp_cn", - "jp_rn", - "jp_trn", - "ke_pin", - "kr_brn", - "li_uid", - "mx_rfc", - "my_frp", - "my_itn", - "my_sst", - "no_vat", - "nz_gst", - "ph_tin", - "ru_inn", - "ru_kpp", - "sa_vat", - "sg_gst", - "sg_uen", - "si_tin", - "th_vat", - "tr_tin", - "tw_vat", - "ua_vat", - "us_ein", - "za_vat" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "value": { - "type": "string" - } - }, - "required": [ - "type", - "value" - ], - "title": "data_params", - "type": "object" - }, - "type": "array" - }, - "test_clock": { - "description": "ID of the test clock to attach to the customer.", - "maxLength": 5000, - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/customer" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/search": { - "get": { - "description": "Search for customers you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
", - "operationId": "GetCustomersSearch", - "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" - }, - { - "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": "A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.", - "in": "query", - "name": "page", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for customers](https://stripe.com/docs/search#query-fields-for-customers).", - "in": "query", - "name": "query", - "required": true, - "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/customer" - }, - "type": "array" - }, - "has_more": { - "type": "boolean" - }, - "next_page": { - "maxLength": 5000, - "nullable": true, - "type": "string" - }, - "object": { - "description": "String representing the object's type. Objects of the same type share the same value.", - "enum": [ - "search_result" - ], - "type": "string" - }, - "total_count": { - "description": "The total number of objects that match the query, only accurate up to 10,000.", - "type": "integer" - }, - "url": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "SearchResult", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}": { - "delete": { - "description": "Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
", - "operationId": "DeleteCustomersCustomer", - "parameters": [ - { - "in": "path", - "name": "customer", - "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/deleted_customer" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "Retrieves a Customer object.
", - "operationId": "GetCustomersCustomer", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": { - "anyOf": [ - { - "$ref": "#/components/schemas/customer" - }, - { - "$ref": "#/components/schemas/deleted_customer" - } - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the past_due
state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.
This request accepts mostly the same arguments as the customer creation call.
", - "operationId": "PostCustomersCustomer", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "address": { - "explode": true, - "style": "deepObject" - }, - "bank_account": { - "explode": true, - "style": "deepObject" - }, - "card": { - "explode": true, - "style": "deepObject" - }, - "cash_balance": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "invoice_settings": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "preferred_locales": { - "explode": true, - "style": "deepObject" - }, - "shipping": { - "explode": true, - "style": "deepObject" - }, - "tax": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "address": { - "anyOf": [ - { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "optional_fields_address", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The customer's address." - }, - "balance": { - "description": "An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice.", - "type": "integer" - }, - "bank_account": { - "anyOf": [ - { - "properties": { - "account_holder_name": { - "maxLength": 5000, - "type": "string" - }, - "account_holder_type": { - "enum": [ - "company", - "individual" - ], - "maxLength": 5000, - "type": "string" - }, - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "currency": { - "type": "string" - }, - "object": { - "enum": [ - "bank_account" - ], - "maxLength": 5000, - "type": "string" - }, - "routing_number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "account_number", - "country" - ], - "title": "customer_payment_source_bank_account", - "type": "object" - }, - { - "maxLength": 5000, - "type": "string" - } - ], - "description": "Either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details." - }, - "card": { - "anyOf": [ - { - "properties": { - "address_city": { - "maxLength": 5000, - "type": "string" - }, - "address_country": { - "maxLength": 5000, - "type": "string" - }, - "address_line1": { - "maxLength": 5000, - "type": "string" - }, - "address_line2": { - "maxLength": 5000, - "type": "string" - }, - "address_state": { - "maxLength": 5000, - "type": "string" - }, - "address_zip": { - "maxLength": 5000, - "type": "string" - }, - "cvc": { - "maxLength": 5000, - "type": "string" - }, - "exp_month": { - "type": "integer" - }, - "exp_year": { - "type": "integer" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "number": { - "maxLength": 5000, - "type": "string" - }, - "object": { - "enum": [ - "card" - ], - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "exp_month", - "exp_year", - "number" - ], - "title": "customer_payment_source_card", - "type": "object" - }, - { - "maxLength": 5000, - "type": "string" - } - ], - "description": "A token, like the ones returned by [Stripe.js](https://stripe.com/docs/js).", - "x-stripeBypassValidation": true - }, - "cash_balance": { - "description": "Balance information and default balance settings for this customer.", - "properties": { - "settings": { - "properties": { - "reconciliation_mode": { - "enum": [ - "automatic", - "manual", - "merchant_default" - ], - "type": "string" - } - }, - "title": "balance_settings_param", - "type": "object" - } - }, - "title": "cash_balance_param", - "type": "object" - }, - "coupon": { - "maxLength": 5000, - "type": "string" - }, - "default_alipay_account": { - "description": "ID of Alipay account to make the customer's new default for invoice payments.", - "maxLength": 500, - "type": "string" - }, - "default_bank_account": { - "description": "ID of bank account to make the customer's new default for invoice payments.", - "maxLength": 500, - "type": "string" - }, - "default_card": { - "description": "ID of card to make the customer's new default for invoice payments.", - "maxLength": 500, - "type": "string" - }, - "default_source": { - "description": "If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter.\n\nProvide the ID of a payment source already attached to this customer to make it this customer's default payment source.\n\nIf you want to add a new payment source and make it the default, see the [source](https://stripe.com/docs/api/customers/update#update_customer-source) property.", - "maxLength": 500, - "type": "string" - }, - "description": { - "description": "An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard.", - "maxLength": 5000, - "type": "string" - }, - "email": { - "description": "Customer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*.", - "maxLength": 512, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "invoice_prefix": { - "description": "The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers.", - "maxLength": 5000, - "type": "string" - }, - "invoice_settings": { - "description": "Default invoice settings for this customer.", - "properties": { - "custom_fields": { - "anyOf": [ - { - "items": { - "properties": { - "name": { - "maxLength": 30, - "type": "string" - }, - "value": { - "maxLength": 30, - "type": "string" - } - }, - "required": [ - "name", - "value" - ], - "title": "custom_field_params", - "type": "object" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "default_payment_method": { - "maxLength": 5000, - "type": "string" - }, - "footer": { - "maxLength": 5000, - "type": "string" - }, - "rendering_options": { - "anyOf": [ - { - "properties": { - "amount_tax_display": { - "enum": [ - "", - "exclude_tax", - "include_inclusive_tax" - ], - "type": "string" - } - }, - "title": "rendering_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "customer_param", - "type": "object" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "name": { - "description": "The customer's full name or business name.", - "maxLength": 256, - "type": "string" - }, - "next_invoice_sequence": { - "description": "The sequence to be used on the customer's next invoice. Defaults to 1.", - "type": "integer" - }, - "phone": { - "description": "The customer's phone number.", - "maxLength": 20, - "type": "string" - }, - "preferred_locales": { - "description": "Customer's preferred languages, ordered by preference.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "promotion_code": { - "description": "The API ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount.", - "maxLength": 5000, - "type": "string" - }, - "shipping": { - "anyOf": [ - { - "properties": { - "address": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "optional_fields_address", - "type": "object" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "address", - "name" - ], - "title": "customer_shipping", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The customer's shipping information. Appears on invoices emailed to this customer." - }, - "source": { - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "tax": { - "description": "Tax details about the customer.", - "properties": { - "ip_address": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "tax_param", - "type": "object" - }, - "tax_exempt": { - "description": "The customer's tax exemption. One of `none`, `exempt`, or `reverse`.", - "enum": [ - "", - "exempt", - "none", - "reverse" - ], - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/customer" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/balance_transactions": { - "get": { - "description": "Returns a list of transactions that updated the customer’s balances.
", - "operationId": "GetCustomersCustomerBalanceTransactions", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/customer_balance_transaction" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "CustomerBalanceTransactionList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates an immutable transaction that updates the customer’s credit balance.
", - "operationId": "PostCustomersCustomerBalanceTransactions", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "The integer amount in **cents (or local equivalent)** to apply to the customer's credit balance.", - "type": "integer" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Specifies the [`invoice_credit_balance`](https://stripe.com/docs/api/customers/object#customer_object-invoice_credit_balance) that this transaction will apply to. If the customer's `currency` is not set, it will be updated to this value.", - "type": "string" - }, - "description": { - "description": "An arbitrary string attached to the object. Often useful for displaying to users.", - "maxLength": 350, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - } - }, - "required": [ - "amount", - "currency" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/customer_balance_transaction" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/balance_transactions/{transaction}": { - "get": { - "description": "Retrieves a specific customer balance transaction that updated the customer’s balances.
", - "operationId": "GetCustomersCustomerBalanceTransactionsTransaction", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": "transaction", - "required": true, - "schema": { - "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/customer_balance_transaction" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Most credit balance transaction fields are immutable, but you may update its description
and metadata
.
You can see a list of the bank accounts belonging to a Customer. Note that the 10 most recent sources are always available by default on the Customer. If you need more than those 10, you can use this API method and the limit
and starting_after
parameters to page through additional bank accounts.
When you create a new credit card, you must specify a customer or recipient on which to create it.
\n\nIf the card’s owner has no default card, then the new card will become the default.\nHowever, if the owner already has a default, then it will not change.\nTo change the default, you should update the customer to have a new default_source
.
Delete a specified source for a given customer.
", - "operationId": "DeleteCustomersCustomerBankAccountsId", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "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": { - "anyOf": [ - { - "$ref": "#/components/schemas/payment_source" - }, - { - "$ref": "#/components/schemas/deleted_payment_source" - } - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "deprecated": true, - "description": "By default, you can see the 10 most recent sources stored on a Customer directly on the object, but you can also retrieve details about a specific bank account stored on the Stripe account.
", - "operationId": "GetCustomersCustomerBankAccountsId", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/bank_account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Update a specified source for a given customer.
", - "operationId": "PostCustomersCustomerBankAccountsId", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "owner": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "account_holder_name": { - "description": "The name of the person or business that owns the bank account.", - "maxLength": 5000, - "type": "string" - }, - "account_holder_type": { - "description": "The type of entity that holds the account. This can be either `individual` or `company`.", - "enum": [ - "company", - "individual" - ], - "maxLength": 5000, - "type": "string" - }, - "address_city": { - "description": "City/District/Suburb/Town/Village.", - "maxLength": 5000, - "type": "string" - }, - "address_country": { - "description": "Billing address country, if provided when creating card.", - "maxLength": 5000, - "type": "string" - }, - "address_line1": { - "description": "Address line 1 (Street address/PO Box/Company name).", - "maxLength": 5000, - "type": "string" - }, - "address_line2": { - "description": "Address line 2 (Apartment/Suite/Unit/Building).", - "maxLength": 5000, - "type": "string" - }, - "address_state": { - "description": "State/County/Province/Region.", - "maxLength": 5000, - "type": "string" - }, - "address_zip": { - "description": "ZIP or postal code.", - "maxLength": 5000, - "type": "string" - }, - "exp_month": { - "description": "Two digit number representing the card’s expiration month.", - "maxLength": 5000, - "type": "string" - }, - "exp_year": { - "description": "Four digit number representing the card’s expiration year.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "name": { - "description": "Cardholder name.", - "maxLength": 5000, - "type": "string" - }, - "owner": { - "properties": { - "address": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "source_address", - "type": "object" - }, - "email": { - "type": "string" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "owner", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/card" - }, - { - "$ref": "#/components/schemas/bank_account" - }, - { - "$ref": "#/components/schemas/source" - } - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/bank_accounts/{id}/verify": { - "post": { - "description": "Verify a specified bank account for a given customer.
", - "operationId": "PostCustomersCustomerBankAccountsIdVerify", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "amounts": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amounts": { - "description": "Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.", - "items": { - "type": "integer" - }, - "type": "array" - }, - "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/bank_account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/cards": { - "get": { - "deprecated": true, - "description": "You can see a list of the cards belonging to a customer.\nNote that the 10 most recent sources are always available on the Customer
object.\nIf you need more than those 10, you can use this API method and the limit
and starting_after
parameters to page through additional cards.
When you create a new credit card, you must specify a customer or recipient on which to create it.
\n\nIf the card’s owner has no default card, then the new card will become the default.\nHowever, if the owner already has a default, then it will not change.\nTo change the default, you should update the customer to have a new default_source
.
Delete a specified source for a given customer.
", - "operationId": "DeleteCustomersCustomerCardsId", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "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": { - "anyOf": [ - { - "$ref": "#/components/schemas/payment_source" - }, - { - "$ref": "#/components/schemas/deleted_payment_source" - } - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "deprecated": true, - "description": "You can always see the 10 most recent cards directly on a customer; this method lets you retrieve details about a specific card stored on the customer.
", - "operationId": "GetCustomersCustomerCardsId", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/card" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Update a specified source for a given customer.
", - "operationId": "PostCustomersCustomerCardsId", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "owner": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "account_holder_name": { - "description": "The name of the person or business that owns the bank account.", - "maxLength": 5000, - "type": "string" - }, - "account_holder_type": { - "description": "The type of entity that holds the account. This can be either `individual` or `company`.", - "enum": [ - "company", - "individual" - ], - "maxLength": 5000, - "type": "string" - }, - "address_city": { - "description": "City/District/Suburb/Town/Village.", - "maxLength": 5000, - "type": "string" - }, - "address_country": { - "description": "Billing address country, if provided when creating card.", - "maxLength": 5000, - "type": "string" - }, - "address_line1": { - "description": "Address line 1 (Street address/PO Box/Company name).", - "maxLength": 5000, - "type": "string" - }, - "address_line2": { - "description": "Address line 2 (Apartment/Suite/Unit/Building).", - "maxLength": 5000, - "type": "string" - }, - "address_state": { - "description": "State/County/Province/Region.", - "maxLength": 5000, - "type": "string" - }, - "address_zip": { - "description": "ZIP or postal code.", - "maxLength": 5000, - "type": "string" - }, - "exp_month": { - "description": "Two digit number representing the card’s expiration month.", - "maxLength": 5000, - "type": "string" - }, - "exp_year": { - "description": "Four digit number representing the card’s expiration year.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "name": { - "description": "Cardholder name.", - "maxLength": 5000, - "type": "string" - }, - "owner": { - "properties": { - "address": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "source_address", - "type": "object" - }, - "email": { - "type": "string" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "owner", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/card" - }, - { - "$ref": "#/components/schemas/bank_account" - }, - { - "$ref": "#/components/schemas/source" - } - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/cash_balance": { - "get": { - "description": "Retrieves a customer’s cash balance.
", - "operationId": "GetCustomersCustomerCashBalance", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/cash_balance" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Changes the settings on a customer’s cash balance.
", - "operationId": "PostCustomersCustomerCashBalance", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "settings": { - "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" - }, - "settings": { - "description": "A hash of settings for this cash balance.", - "properties": { - "reconciliation_mode": { - "enum": [ - "automatic", - "manual", - "merchant_default" - ], - "type": "string" - } - }, - "title": "balance_settings_param", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/cash_balance" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/cash_balance_transactions": { - "get": { - "description": "Returns a list of transactions that modified the customer’s cash balance.
", - "operationId": "GetCustomersCustomerCashBalanceTransactions", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": "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": "Customers with certain payments enabled have a cash balance, representing funds that were paid\nby the customer to a merchant, but have not yet been allocated to a payment. Cash Balance Transactions\nrepresent when funds are moved into or out of this balance. This includes funding by the customer, allocation\nto payments, and refunds to the customer.", - "properties": { - "data": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/customer_cash_balance_transaction" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "CustomerCashBalanceTransactionList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/cash_balance_transactions/{transaction}": { - "get": { - "description": "Retrieves a specific cash balance transaction, which updated the customer’s cash balance.
", - "operationId": "GetCustomersCustomerCashBalanceTransactionsTransaction", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": "transaction", - "required": true, - "schema": { - "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/customer_cash_balance_transaction" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/discount": { - "delete": { - "description": "Removes the currently applied discount on a customer.
", - "operationId": "DeleteCustomersCustomerDiscount", - "parameters": [ - { - "in": "path", - "name": "customer", - "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/deleted_discount" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "", - "operationId": "GetCustomersCustomerDiscount", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/discount" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/funding_instructions": { - "post": { - "description": "Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new\nfunding instructions will be created. If funding instructions have already been created for a given customer, the same\nfunding instructions will be retrieved. In other words, we will return the same funding instructions each time.
", - "operationId": "PostCustomersCustomerFundingInstructions", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "bank_transfer": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "bank_transfer": { - "description": "Additional parameters for `bank_transfer` funding types", - "properties": { - "eu_bank_transfer": { - "properties": { - "country": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "country" - ], - "title": "eu_bank_account_params", - "type": "object" - }, - "requested_address_types": { - "items": { - "enum": [ - "iban", - "sort_code", - "spei", - "zengin" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - }, - "type": { - "enum": [ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "required": [ - "type" - ], - "title": "bank_transfer_params", - "type": "object" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "funding_type": { - "description": "The `funding_type` to get the instructions for.", - "enum": [ - "bank_transfer" - ], - "type": "string" - } - }, - "required": [ - "bank_transfer", - "currency", - "funding_type" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/funding_instructions" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/payment_methods": { - "get": { - "description": "Returns a list of PaymentMethods for a given Customer
", - "operationId": "GetCustomersCustomerPaymentMethods", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": { - "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": "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": { - "type": "string" - }, - "style": "form" - }, - { - "description": "An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request.", - "in": "query", - "name": "type", - "required": false, - "schema": { - "enum": [ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "blik", - "boleto", - "card", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "klarna", - "konbini", - "link", - "oxxo", - "p24", - "paynow", - "pix", - "promptpay", - "sepa_debit", - "sofort", - "us_bank_account", - "wechat_pay" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "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/payment_method" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "CustomerPaymentMethodResourceList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/payment_methods/{payment_method}": { - "get": { - "description": "Retrieves a PaymentMethod object for a given Customer.
", - "operationId": "GetCustomersCustomerPaymentMethodsPaymentMethod", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": "payment_method", - "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/payment_method" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/sources": { - "get": { - "description": "List sources for a specified customer.
", - "operationId": "GetCustomersCustomerSources", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": { - "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 sources according to a particular object type.", - "in": "query", - "name": "object", - "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": { - "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": { - "description": "Details about each object.", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/bank_account" - }, - { - "$ref": "#/components/schemas/card" - }, - { - "$ref": "#/components/schemas/source" - } - ], - "title": "Polymorphic", - "x-stripeBypassValidation": true - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "ApmsSourcesSourceList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "When you create a new credit card, you must specify a customer or recipient on which to create it.
\n\nIf the card’s owner has no default card, then the new card will become the default.\nHowever, if the owner already has a default, then it will not change.\nTo change the default, you should update the customer to have a new default_source
.
Delete a specified source for a given customer.
", - "operationId": "DeleteCustomersCustomerSourcesId", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "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": { - "anyOf": [ - { - "$ref": "#/components/schemas/payment_source" - }, - { - "$ref": "#/components/schemas/deleted_payment_source" - } - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "Retrieve a specified source for a given customer.
", - "operationId": "GetCustomersCustomerSourcesId", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": 500, - "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/payment_source" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Update a specified source for a given customer.
", - "operationId": "PostCustomersCustomerSourcesId", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "owner": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "account_holder_name": { - "description": "The name of the person or business that owns the bank account.", - "maxLength": 5000, - "type": "string" - }, - "account_holder_type": { - "description": "The type of entity that holds the account. This can be either `individual` or `company`.", - "enum": [ - "company", - "individual" - ], - "maxLength": 5000, - "type": "string" - }, - "address_city": { - "description": "City/District/Suburb/Town/Village.", - "maxLength": 5000, - "type": "string" - }, - "address_country": { - "description": "Billing address country, if provided when creating card.", - "maxLength": 5000, - "type": "string" - }, - "address_line1": { - "description": "Address line 1 (Street address/PO Box/Company name).", - "maxLength": 5000, - "type": "string" - }, - "address_line2": { - "description": "Address line 2 (Apartment/Suite/Unit/Building).", - "maxLength": 5000, - "type": "string" - }, - "address_state": { - "description": "State/County/Province/Region.", - "maxLength": 5000, - "type": "string" - }, - "address_zip": { - "description": "ZIP or postal code.", - "maxLength": 5000, - "type": "string" - }, - "exp_month": { - "description": "Two digit number representing the card’s expiration month.", - "maxLength": 5000, - "type": "string" - }, - "exp_year": { - "description": "Four digit number representing the card’s expiration year.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "name": { - "description": "Cardholder name.", - "maxLength": 5000, - "type": "string" - }, - "owner": { - "properties": { - "address": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "source_address", - "type": "object" - }, - "email": { - "type": "string" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "owner", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/card" - }, - { - "$ref": "#/components/schemas/bank_account" - }, - { - "$ref": "#/components/schemas/source" - } - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/sources/{id}/verify": { - "post": { - "description": "Verify a specified bank account for a given customer.
", - "operationId": "PostCustomersCustomerSourcesIdVerify", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "amounts": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amounts": { - "description": "Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.", - "items": { - "type": "integer" - }, - "type": "array" - }, - "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/bank_account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/subscriptions": { - "get": { - "description": "You can see a list of the customer’s active subscriptions. Note that the 10 most recent active subscriptions are always available by default on the customer object. If you need more than those 10, you can use the limit and starting_after parameters to page through additional subscriptions.
", - "operationId": "GetCustomersCustomerSubscriptions", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/subscription" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "SubscriptionList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a new subscription on an existing customer.
", - "operationId": "PostCustomersCustomerSubscriptions", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "add_invoice_items": { - "explode": true, - "style": "deepObject" - }, - "automatic_tax": { - "explode": true, - "style": "deepObject" - }, - "billing_thresholds": { - "explode": true, - "style": "deepObject" - }, - "default_tax_rates": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "items": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "payment_settings": { - "explode": true, - "style": "deepObject" - }, - "pending_invoice_item_interval": { - "explode": true, - "style": "deepObject" - }, - "transfer_data": { - "explode": true, - "style": "deepObject" - }, - "trial_end": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "add_invoice_items": { - "description": "A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items.", - "items": { - "properties": { - "price": { - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product" - ], - "title": "one_time_price_data_with_negative_amounts", - "type": "object" - }, - "quantity": { - "type": "integer" - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "subscription_create_add_invoice_item_entry", - "type": "object" - }, - "type": "array" - }, - "application_fee_percent": { - "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).", - "type": "number" - }, - "automatic_tax": { - "description": "Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed.", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "automatic_tax_config", - "type": "object" - }, - "backdate_start_date": { - "description": "For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor.", - "format": "unix-time", - "type": "integer" - }, - "billing_cycle_anchor": { - "description": "A future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format.", - "format": "unix-time", - "type": "integer", - "x-stripeBypassValidation": true - }, - "billing_thresholds": { - "anyOf": [ - { - "properties": { - "amount_gte": { - "type": "integer" - }, - "reset_billing_cycle_anchor": { - "type": "boolean" - } - }, - "title": "billing_thresholds_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds." - }, - "cancel_at": { - "description": "A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.", - "format": "unix-time", - "type": "integer" - }, - "cancel_at_period_end": { - "description": "Boolean indicating whether this subscription should cancel at the end of the current period.", - "type": "boolean" - }, - "collection_method": { - "description": "Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`.", - "enum": [ - "charge_automatically", - "send_invoice" - ], - "type": "string" - }, - "coupon": { - "description": "The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription.", - "maxLength": 5000, - "type": "string" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "days_until_due": { - "description": "Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`.", - "type": "integer" - }, - "default_payment_method": { - "description": "ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).", - "maxLength": 5000, - "type": "string" - }, - "default_source": { - "description": "ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).", - "maxLength": 5000, - "type": "string" - }, - "default_tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription." - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "items": { - "description": "A list of up to 20 subscription items, each with an attached price.", - "items": { - "properties": { - "billing_thresholds": { - "anyOf": [ - { - "properties": { - "usage_gte": { - "type": "integer" - } - }, - "required": [ - "usage_gte" - ], - "title": "item_billing_thresholds_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "price": { - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "recurring": { - "properties": { - "interval": { - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - } - }, - "required": [ - "interval" - ], - "title": "recurring_adhoc", - "type": "object" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product", - "recurring" - ], - "title": "recurring_price_data", - "type": "object" - }, - "quantity": { - "type": "integer" - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "subscription_item_create_params", - "type": "object" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "off_session": { - "description": "Indicates if a customer is on or off-session while an invoice payment is attempted.", - "type": "boolean" - }, - "payment_behavior": { - "description": "Only applies to subscriptions with `collection_method=charge_automatically`.\n\nUse `allow_incomplete` to create subscriptions with `status=incomplete` if the first invoice cannot be paid. Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior.\n\nUse `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. Subscriptions transition to `status=active` when successfully confirming the payment intent on the first invoice. This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. If the payment intent is not confirmed within 23 hours subscriptions transition to `status=incomplete_expired`, which is a terminal state.\n\nUse `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not create a subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.\n\n`pending_if_incomplete` is only used with updates and cannot be passed when creating a subscription.\n\nSubscriptions with `collection_method=send_invoice` are automatically activated regardless of the first invoice status.", - "enum": [ - "allow_incomplete", - "default_incomplete", - "error_if_incomplete", - "pending_if_incomplete" - ], - "type": "string" - }, - "payment_settings": { - "description": "Payment settings to pass to invoices created by the subscription.", - "properties": { - "payment_method_options": { - "properties": { - "acss_debit": { - "anyOf": [ - { - "properties": { - "mandate_options": { - "properties": { - "transaction_type": { - "enum": [ - "business", - "personal" - ], - "type": "string" - } - }, - "title": "mandate_options_param", - "type": "object" - }, - "verification_method": { - "enum": [ - "automatic", - "instant", - "microdeposits" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "bancontact": { - "anyOf": [ - { - "properties": { - "preferred_language": { - "enum": [ - "de", - "en", - "fr", - "nl" - ], - "type": "string" - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "card": { - "anyOf": [ - { - "properties": { - "mandate_options": { - "properties": { - "amount": { - "type": "integer" - }, - "amount_type": { - "enum": [ - "fixed", - "maximum" - ], - "type": "string" - }, - "description": { - "maxLength": 200, - "type": "string" - } - }, - "title": "mandate_options_param", - "type": "object" - }, - "network": { - "enum": [ - "amex", - "cartes_bancaires", - "diners", - "discover", - "interac", - "jcb", - "mastercard", - "unionpay", - "unknown", - "visa" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "request_three_d_secure": { - "enum": [ - "any", - "automatic" - ], - "type": "string" - } - }, - "title": "subscription_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "customer_balance": { - "anyOf": [ - { - "properties": { - "bank_transfer": { - "properties": { - "eu_bank_transfer": { - "properties": { - "country": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "country" - ], - "title": "eu_bank_transfer_param", - "type": "object" - }, - "type": { - "type": "string" - } - }, - "title": "bank_transfer_param", - "type": "object" - }, - "funding_type": { - "type": "string" - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "konbini": { - "anyOf": [ - { - "properties": { - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "us_bank_account": { - "anyOf": [ - { - "properties": { - "financial_connections": { - "properties": { - "permissions": { - "items": { - "enum": [ - "balances", - "ownership", - "payment_method", - "transactions" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - } - }, - "title": "invoice_linked_account_options_param", - "type": "object" - }, - "verification_method": { - "enum": [ - "automatic", - "instant", - "microdeposits" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "payment_method_options", - "type": "object" - }, - "payment_method_types": { - "anyOf": [ - { - "items": { - "enum": [ - "ach_credit_transfer", - "ach_debit", - "acss_debit", - "au_becs_debit", - "bacs_debit", - "bancontact", - "boleto", - "card", - "customer_balance", - "fpx", - "giropay", - "grabpay", - "ideal", - "konbini", - "link", - "paynow", - "promptpay", - "sepa_debit", - "sofort", - "us_bank_account", - "wechat_pay" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "save_default_payment_method": { - "enum": [ - "off", - "on_subscription" - ], - "type": "string" - } - }, - "title": "payment_settings", - "type": "object" - }, - "pending_invoice_item_interval": { - "anyOf": [ - { - "properties": { - "interval": { - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - } - }, - "required": [ - "interval" - ], - "title": "pending_invoice_item_interval_params", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval." - }, - "promotion_code": { - "description": "The API ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription.", - "maxLength": 5000, - "type": "string" - }, - "proration_behavior": { - "description": "Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`.", - "enum": [ - "always_invoice", - "create_prorations", - "none" - ], - "type": "string" - }, - "transfer_data": { - "description": "If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges.", - "properties": { - "amount_percent": { - "type": "number" - }, - "destination": { - "type": "string" - } - }, - "required": [ - "destination" - ], - "title": "transfer_data_specs", - "type": "object" - }, - "trial_end": { - "anyOf": [ - { - "enum": [ - "now" - ], - "maxLength": 5000, - "type": "string" - }, - { - "format": "unix-time", - "type": "integer" - } - ], - "description": "Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more." - }, - "trial_from_plan": { - "description": "Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.", - "type": "boolean" - }, - "trial_period_days": { - "description": "Integer representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.", - "type": "integer" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/subscription" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/subscriptions/{subscription_exposed_id}": { - "delete": { - "description": "Cancels a customer’s subscription. If you set the at_period_end
parameter to true
, the subscription will remain active until the end of the period, at which point it will be canceled and not renewed. Otherwise, with the default false
value, the subscription is terminated immediately. In either case, the customer will not be charged again for the subscription.
Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
\n\nBy default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
", - "operationId": "DeleteCustomersCustomerSubscriptionsSubscriptionExposedId", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "subscription_exposed_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" - }, - "invoice_now": { - "description": "Can be set to `true` if `at_period_end` is not set to `true`. Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items.", - "type": "boolean" - }, - "prorate": { - "description": "Can be set to `true` if `at_period_end` is not set to `true`. Will generate a proration invoice item that credits remaining unused time until the subscription period end.", - "type": "boolean" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/subscription" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "Retrieves the subscription with the given ID.
", - "operationId": "GetCustomersCustomerSubscriptionsSubscriptionExposedId", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": "subscription_exposed_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/subscription" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates an existing subscription on a customer to match the specified parameters. When changing plans or quantities, we will optionally prorate the price we charge next month to make up for any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint.
", - "operationId": "PostCustomersCustomerSubscriptionsSubscriptionExposedId", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "subscription_exposed_id", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "add_invoice_items": { - "explode": true, - "style": "deepObject" - }, - "automatic_tax": { - "explode": true, - "style": "deepObject" - }, - "billing_thresholds": { - "explode": true, - "style": "deepObject" - }, - "cancel_at": { - "explode": true, - "style": "deepObject" - }, - "default_tax_rates": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "items": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "pause_collection": { - "explode": true, - "style": "deepObject" - }, - "payment_settings": { - "explode": true, - "style": "deepObject" - }, - "pending_invoice_item_interval": { - "explode": true, - "style": "deepObject" - }, - "transfer_data": { - "explode": true, - "style": "deepObject" - }, - "trial_end": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "add_invoice_items": { - "description": "A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items.", - "items": { - "properties": { - "price": { - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product" - ], - "title": "one_time_price_data_with_negative_amounts", - "type": "object" - }, - "quantity": { - "type": "integer" - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "add_invoice_item_entry", - "type": "object" - }, - "type": "array" - }, - "application_fee_percent": { - "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).", - "type": "number" - }, - "automatic_tax": { - "description": "Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed.", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "automatic_tax_config", - "type": "object" - }, - "billing_cycle_anchor": { - "description": "Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).", - "enum": [ - "now", - "unchanged" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "billing_thresholds": { - "anyOf": [ - { - "properties": { - "amount_gte": { - "type": "integer" - }, - "reset_billing_cycle_anchor": { - "type": "boolean" - } - }, - "title": "billing_thresholds_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds." - }, - "cancel_at": { - "anyOf": [ - { - "format": "unix-time", - "type": "integer" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period." - }, - "cancel_at_period_end": { - "description": "Boolean indicating whether this subscription should cancel at the end of the current period.", - "type": "boolean" - }, - "collection_method": { - "description": "Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`.", - "enum": [ - "charge_automatically", - "send_invoice" - ], - "type": "string" - }, - "coupon": { - "description": "The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription.", - "maxLength": 5000, - "type": "string" - }, - "days_until_due": { - "description": "Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`.", - "type": "integer" - }, - "default_payment_method": { - "description": "ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).", - "maxLength": 5000, - "type": "string" - }, - "default_source": { - "description": "ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).", - "maxLength": 5000, - "type": "string" - }, - "default_tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. Pass an empty string to remove previously-defined tax rates." - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "items": { - "description": "A list of up to 20 subscription items, each with an attached price.", - "items": { - "properties": { - "billing_thresholds": { - "anyOf": [ - { - "properties": { - "usage_gte": { - "type": "integer" - } - }, - "required": [ - "usage_gte" - ], - "title": "item_billing_thresholds_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "clear_usage": { - "type": "boolean" - }, - "deleted": { - "type": "boolean" - }, - "id": { - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "price": { - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "recurring": { - "properties": { - "interval": { - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - } - }, - "required": [ - "interval" - ], - "title": "recurring_adhoc", - "type": "object" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product", - "recurring" - ], - "title": "recurring_price_data", - "type": "object" - }, - "quantity": { - "type": "integer" - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "subscription_item_update_params", - "type": "object" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "off_session": { - "description": "Indicates if a customer is on or off-session while an invoice payment is attempted.", - "type": "boolean" - }, - "pause_collection": { - "anyOf": [ - { - "properties": { - "behavior": { - "enum": [ - "keep_as_draft", - "mark_uncollectible", - "void" - ], - "type": "string" - }, - "resumes_at": { - "format": "unix-time", - "type": "integer" - } - }, - "required": [ - "behavior" - ], - "title": "pause_collection_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "If specified, payment collection for this subscription will be paused." - }, - "payment_behavior": { - "description": "Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior.\n\nUse `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method.\n\nUse `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes).\n\nUse `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.", - "enum": [ - "allow_incomplete", - "default_incomplete", - "error_if_incomplete", - "pending_if_incomplete" - ], - "type": "string" - }, - "payment_settings": { - "description": "Payment settings to pass to invoices created by the subscription.", - "properties": { - "payment_method_options": { - "properties": { - "acss_debit": { - "anyOf": [ - { - "properties": { - "mandate_options": { - "properties": { - "transaction_type": { - "enum": [ - "business", - "personal" - ], - "type": "string" - } - }, - "title": "mandate_options_param", - "type": "object" - }, - "verification_method": { - "enum": [ - "automatic", - "instant", - "microdeposits" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "bancontact": { - "anyOf": [ - { - "properties": { - "preferred_language": { - "enum": [ - "de", - "en", - "fr", - "nl" - ], - "type": "string" - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "card": { - "anyOf": [ - { - "properties": { - "mandate_options": { - "properties": { - "amount": { - "type": "integer" - }, - "amount_type": { - "enum": [ - "fixed", - "maximum" - ], - "type": "string" - }, - "description": { - "maxLength": 200, - "type": "string" - } - }, - "title": "mandate_options_param", - "type": "object" - }, - "network": { - "enum": [ - "amex", - "cartes_bancaires", - "diners", - "discover", - "interac", - "jcb", - "mastercard", - "unionpay", - "unknown", - "visa" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "request_three_d_secure": { - "enum": [ - "any", - "automatic" - ], - "type": "string" - } - }, - "title": "subscription_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "customer_balance": { - "anyOf": [ - { - "properties": { - "bank_transfer": { - "properties": { - "eu_bank_transfer": { - "properties": { - "country": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "country" - ], - "title": "eu_bank_transfer_param", - "type": "object" - }, - "type": { - "type": "string" - } - }, - "title": "bank_transfer_param", - "type": "object" - }, - "funding_type": { - "type": "string" - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "konbini": { - "anyOf": [ - { - "properties": { - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "us_bank_account": { - "anyOf": [ - { - "properties": { - "financial_connections": { - "properties": { - "permissions": { - "items": { - "enum": [ - "balances", - "ownership", - "payment_method", - "transactions" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - } - }, - "title": "invoice_linked_account_options_param", - "type": "object" - }, - "verification_method": { - "enum": [ - "automatic", - "instant", - "microdeposits" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "payment_method_options", - "type": "object" - }, - "payment_method_types": { - "anyOf": [ - { - "items": { - "enum": [ - "ach_credit_transfer", - "ach_debit", - "acss_debit", - "au_becs_debit", - "bacs_debit", - "bancontact", - "boleto", - "card", - "customer_balance", - "fpx", - "giropay", - "grabpay", - "ideal", - "konbini", - "link", - "paynow", - "promptpay", - "sepa_debit", - "sofort", - "us_bank_account", - "wechat_pay" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "save_default_payment_method": { - "enum": [ - "off", - "on_subscription" - ], - "type": "string" - } - }, - "title": "payment_settings", - "type": "object" - }, - "pending_invoice_item_interval": { - "anyOf": [ - { - "properties": { - "interval": { - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - } - }, - "required": [ - "interval" - ], - "title": "pending_invoice_item_interval_params", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval." - }, - "promotion_code": { - "description": "The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription.", - "maxLength": 5000, - "type": "string" - }, - "proration_behavior": { - "description": "Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes.", - "enum": [ - "always_invoice", - "create_prorations", - "none" - ], - "type": "string" - }, - "proration_date": { - "description": "If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations.", - "format": "unix-time", - "type": "integer" - }, - "transfer_data": { - "anyOf": [ - { - "properties": { - "amount_percent": { - "type": "number" - }, - "destination": { - "type": "string" - } - }, - "required": [ - "destination" - ], - "title": "transfer_data_specs", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. This will be unset if you POST an empty value." - }, - "trial_end": { - "anyOf": [ - { - "enum": [ - "now" - ], - "maxLength": 5000, - "type": "string" - }, - { - "format": "unix-time", - "type": "integer" - } - ], - "description": "Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`." - }, - "trial_from_plan": { - "description": "Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.", - "type": "boolean" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/subscription" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/subscriptions/{subscription_exposed_id}/discount": { - "delete": { - "description": "Removes the currently applied discount on a customer.
", - "operationId": "DeleteCustomersCustomerSubscriptionsSubscriptionExposedIdDiscount", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "subscription_exposed_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/deleted_discount" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "", - "operationId": "GetCustomersCustomerSubscriptionsSubscriptionExposedIdDiscount", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": "subscription_exposed_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/discount" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/customers/{customer}/tax_ids": { - "get": { - "description": "Returns a list of tax IDs for a customer.
", - "operationId": "GetCustomersCustomerTaxIds", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/tax_id" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "TaxIDsList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a new TaxID
object for a customer.
Deletes an existing TaxID
object.
Retrieves the TaxID
object with the given identifier.
Returns a list of your disputes.
", - "operationId": "GetDisputes", - "parameters": [ - { - "description": "Only return disputes associated to the charge specified by this charge ID.", - "in": "query", - "name": "charge", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": "Only return disputes associated to the PaymentIntent specified by this PaymentIntent ID.", - "in": "query", - "name": "payment_intent", - "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/dispute" - }, - "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/disputes", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "DisputeList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/disputes/{dispute}": { - "get": { - "description": "Retrieves the dispute with the given ID.
", - "operationId": "GetDisputesDispute", - "parameters": [ - { - "in": "path", - "name": "dispute", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/dispute" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "When you get a dispute, contacting your customer is always the best first step. If that doesn’t work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your dashboard, but if you prefer, you can use the API to submit evidence programmatically.
\n\nDepending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our guide to dispute types.
", - "operationId": "PostDisputesDispute", - "parameters": [ - { - "in": "path", - "name": "dispute", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "evidence": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "evidence": { - "description": "Evidence to upload, to respond to a dispute. Updating any field in the hash will submit all fields in the hash for review. The combined character count of all fields is limited to 150,000.", - "properties": { - "access_activity_log": { - "maxLength": 20000, - "type": "string" - }, - "billing_address": { - "maxLength": 5000, - "type": "string" - }, - "cancellation_policy": { - "type": "string" - }, - "cancellation_policy_disclosure": { - "maxLength": 20000, - "type": "string" - }, - "cancellation_rebuttal": { - "maxLength": 20000, - "type": "string" - }, - "customer_communication": { - "type": "string" - }, - "customer_email_address": { - "maxLength": 5000, - "type": "string" - }, - "customer_name": { - "maxLength": 5000, - "type": "string" - }, - "customer_purchase_ip": { - "maxLength": 5000, - "type": "string" - }, - "customer_signature": { - "type": "string" - }, - "duplicate_charge_documentation": { - "type": "string" - }, - "duplicate_charge_explanation": { - "maxLength": 20000, - "type": "string" - }, - "duplicate_charge_id": { - "maxLength": 5000, - "type": "string" - }, - "product_description": { - "maxLength": 20000, - "type": "string" - }, - "receipt": { - "type": "string" - }, - "refund_policy": { - "type": "string" - }, - "refund_policy_disclosure": { - "maxLength": 20000, - "type": "string" - }, - "refund_refusal_explanation": { - "maxLength": 20000, - "type": "string" - }, - "service_date": { - "maxLength": 5000, - "type": "string" - }, - "service_documentation": { - "type": "string" - }, - "shipping_address": { - "maxLength": 5000, - "type": "string" - }, - "shipping_carrier": { - "maxLength": 5000, - "type": "string" - }, - "shipping_date": { - "maxLength": 5000, - "type": "string" - }, - "shipping_documentation": { - "type": "string" - }, - "shipping_tracking_number": { - "maxLength": 5000, - "type": "string" - }, - "uncategorized_file": { - "type": "string" - }, - "uncategorized_text": { - "maxLength": 20000, - "type": "string" - } - }, - "title": "dispute_evidence_params", - "type": "object" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "submit": { - "description": "Whether to immediately submit evidence to the bank. If `false`, evidence is staged on the dispute. Staged evidence is visible in the API and Dashboard, and can be submitted to the bank by making another request with this attribute set to `true` (the default).", - "type": "boolean" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/dispute" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/disputes/{dispute}/close": { - "post": { - "description": "Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost.
\n\nThe status of the dispute will change from needs_response
to lost
. Closing a dispute is irreversible.
Creates a short-lived API key for a given resource.
", - "operationId": "PostEphemeralKeys", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "customer": { - "description": "The ID of the Customer you'd like to modify using the resulting ephemeral key.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "issuing_card": { - "description": "The ID of the Issuing Card you'd like to access using the resulting ephemeral key.", - "maxLength": 5000, - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ephemeral_key" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/ephemeral_keys/{key}": { - "delete": { - "description": "Invalidates a short-lived API key for a given resource.
", - "operationId": "DeleteEphemeralKeysKey", - "parameters": [ - { - "in": "path", - "name": "key", - "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/ephemeral_key" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/events": { - "get": { - "description": "List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in event object api_version
attribute (not according to your current Stripe API version or Stripe-Version
header).
Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook.
", - "operationId": "GetEventsId", - "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/event" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/exchange_rates": { - "get": { - "description": "Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports.
", - "operationId": "GetExchangeRates", - "parameters": [ - { - "description": "A cursor for use in pagination. `ending_before` is the currency that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with the exchange rate for currency X 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 total number of supported payout currencies, and the default is the max.", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "type": "integer" - }, - "style": "form" - }, - { - "description": "A cursor for use in pagination. `starting_after` is the currency that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with the exchange rate for currency X, your subsequent call can include `starting_after=X` 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/exchange_rate" - }, - "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/exchange_rates", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "ExchangeRateList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/exchange_rates/{rate_id}": { - "get": { - "description": "Retrieves the exchange rates from the given currency to every supported currency.
", - "operationId": "GetExchangeRatesRateId", - "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": "rate_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/exchange_rate" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/file_links": { - "get": { - "description": "Returns a list of file links.
", - "operationId": "GetFileLinks", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": { - "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": "Filter links by their expiration status. By default, all links are returned.", - "in": "query", - "name": "expired", - "required": false, - "schema": { - "type": "boolean" - }, - "style": "form" - }, - { - "description": "Only return links for the given file.", - "in": "query", - "name": "file", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "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": "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": { - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/file_link" - }, - "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/file_links", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "FileFileLinkList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a new file link object.
", - "operationId": "PostFileLinks", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "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" - }, - "expires_at": { - "description": "A future timestamp after which the link will no longer be usable.", - "format": "unix-time", - "type": "integer" - }, - "file": { - "description": "The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`.", - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - } - }, - "required": [ - "file" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/file_link" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/file_links/{link}": { - "get": { - "description": "Retrieves the file link with the given ID.
", - "operationId": "GetFileLinksLink", - "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": "link", - "required": true, - "schema": { - "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/file_link" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates an existing file link object. Expired links can no longer be updated.
", - "operationId": "PostFileLinksLink", - "parameters": [ - { - "in": "path", - "name": "link", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "expires_at": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "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" - }, - "expires_at": { - "anyOf": [ - { - "enum": [ - "now" - ], - "maxLength": 5000, - "type": "string" - }, - { - "format": "unix-time", - "type": "integer" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "A future timestamp after which the link will no longer be usable, or `now` to expire the link immediately." - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/file_link" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/files": { - "get": { - "description": "Returns a list of the files that your account has access to. The files are returned sorted by creation date, with the most recently created files appearing first.
", - "operationId": "GetFiles", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": "The file purpose to filter queries by. If none is provided, files will not be filtered by purpose.", - "in": "query", - "name": "purpose", - "required": false, - "schema": { - "enum": [ - "account_requirement", - "additional_verification", - "business_icon", - "business_logo", - "customer_signature", - "dispute_evidence", - "document_provider_identity_document", - "finance_report_run", - "identity_document", - "identity_document_downloadable", - "pci_document", - "selfie", - "sigma_scheduled_query", - "tax_document_user_upload", - "terminal_reader_splashscreen" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "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/file" - }, - "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/files", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "FileFileList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "To upload a file to Stripe, you’ll need to send a request of type multipart/form-data
. The request should contain the file you would like to upload, as well as the parameters for creating a file.
All of Stripe’s officially supported Client libraries should have support for sending multipart/form-data
.
Retrieves the details of an existing file object. Supply the unique file ID from a file, and Stripe will return the corresponding file object. To access file contents, see the File Upload Guide.
", - "operationId": "GetFilesFile", - "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": "file", - "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/file" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/financial_connections/accounts": { - "get": { - "description": "Returns a list of Financial Connections Account
objects.
Retrieves the details of an Financial Connections Account
.
Disables your access to a Financial Connections Account
. You will no longer be able to access data associated with the account (e.g. balances, transactions).
Lists all owners for a given Account
Refreshes the data associated with a Financial Connections Account
.
To launch the Financial Connections authorization flow, create a Session
. The session’s client_secret
can be used to launch the flow using Stripe.js.
Retrieves the details of a Financial Connections Session
List all verification reports.
", - "operationId": "GetIdentityVerificationReports", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": "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" - }, - { - "description": "Only return VerificationReports of this type", - "in": "query", - "name": "type", - "required": false, - "schema": { - "enum": [ - "document", - "id_number" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "style": "form" - }, - { - "description": "Only return VerificationReports created by this VerificationSession ID. It is allowed to provide a VerificationIntent ID.", - "in": "query", - "name": "verification_session", - "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/identity.verification_report" - }, - "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/identity/verification_reports", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "GelatoVerificationReportList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/identity/verification_reports/{report}": { - "get": { - "description": "Retrieves an existing VerificationReport
", - "operationId": "GetIdentityVerificationReportsReport", - "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": "report", - "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/identity.verification_report" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/identity/verification_sessions": { - "get": { - "description": "Returns a list of VerificationSessions
", - "operationId": "GetIdentityVerificationSessions", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": "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" - }, - { - "description": "Only return VerificationSessions with this status. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work).", - "in": "query", - "name": "status", - "required": false, - "schema": { - "enum": [ - "canceled", - "processing", - "requires_input", - "verified" - ], - "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/identity.verification_session" - }, - "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/identity/verification_sessions", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "GelatoVerificationSessionList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a VerificationSession object.
\n\nAfter the VerificationSession is created, display a verification modal using the session client_secret
or send your users to the session’s url
.
If your API key is in test mode, verification checks won’t actually process, though everything else will occur as if in live mode.
\n\nRelated guide: Verify your users’ identity documents.
", - "operationId": "PostIdentityVerificationSessions", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "options": { - "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" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "options": { - "description": "A set of options for the session’s verification checks.", - "properties": { - "document": { - "anyOf": [ - { - "properties": { - "allowed_types": { - "items": { - "enum": [ - "driving_license", - "id_card", - "passport" - ], - "type": "string" - }, - "type": "array" - }, - "require_id_number": { - "type": "boolean" - }, - "require_live_capture": { - "type": "boolean" - }, - "require_matching_selfie": { - "type": "boolean" - } - }, - "title": "document_options", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "session_options_param", - "type": "object" - }, - "return_url": { - "description": "The URL that the user will be redirected to upon completing the verification flow.", - "type": "string" - }, - "type": { - "description": "The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed.", - "enum": [ - "document", - "id_number" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "required": [ - "type" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/identity.verification_session" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/identity/verification_sessions/{session}": { - "get": { - "description": "Retrieves the details of a VerificationSession that was previously created.
\n\nWhen the session status is requires_input
, you can use this method to retrieve a valid\nclient_secret
or url
to allow re-submission.
Updates a VerificationSession object.
\n\nWhen the session status is requires_input
, you can use this method to update the\nverification check and options.
A VerificationSession object can be canceled when it is in requires_input
status.
Once canceled, future submission attempts are disabled. This cannot be undone. Learn more.
", - "operationId": "PostIdentityVerificationSessionsSessionCancel", - "parameters": [ - { - "in": "path", - "name": "session", - "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/identity.verification_session" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/identity/verification_sessions/{session}/redact": { - "post": { - "description": "Redact a VerificationSession to remove all collected information from Stripe. This will redact\nthe VerificationSession and all objects related to it, including VerificationReports, Events,\nrequest logs, etc.
\n\nA VerificationSession object can be redacted when it is in requires_input
or verified
\nstatus. Redacting a VerificationSession in requires_action
\nstate will automatically cancel it.
The redaction process may take up to four days. When the redaction process is in progress, the\nVerificationSession’s redaction.status
field will be set to processing
; when the process is\nfinished, it will change to redacted
and an identity.verification_session.redacted
event\nwill be emitted.
Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the\nfields that contain personal data will be replaced by the string [redacted]
or a similar\nplaceholder. The metadata
field will also be erased. Redacted objects cannot be updated or\nused for any purpose.
Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first.
", - "operationId": "GetInvoiceitems", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "The identifier of the customer whose invoice items to return. If none is provided, all invoice items will be returned.", - "in": "query", - "name": "customer", - "required": false, - "schema": { - "maxLength": 5000, - "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": "Only return invoice items belonging to this invoice. If none is provided, all invoice items will be returned. If specifying an invoice, no customer identifier is needed.", - "in": "query", - "name": "invoice", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "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": "Set to `true` to only show pending invoice items, which are not yet attached to any invoices. Set to `false` to only show invoice items already attached to invoices. If unspecified, no filter is applied.", - "in": "query", - "name": "pending", - "required": false, - "schema": { - "type": "boolean" - }, - "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/invoiceitem" - }, - "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/invoiceitems", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "InvoicesItemsList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified.
", - "operationId": "PostInvoiceitems", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "discounts": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "period": { - "explode": true, - "style": "deepObject" - }, - "price_data": { - "explode": true, - "style": "deepObject" - }, - "tax_code": { - "explode": true, - "style": "deepObject" - }, - "tax_rates": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. Passing in a negative `amount` will reduce the `amount_due` on the invoice.", - "type": "integer" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "customer": { - "description": "The ID of the customer who will be billed when this invoice item is billed.", - "maxLength": 5000, - "type": "string" - }, - "description": { - "description": "An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.", - "maxLength": 5000, - "type": "string" - }, - "discountable": { - "description": "Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items.", - "type": "boolean" - }, - "discounts": { - "anyOf": [ - { - "items": { - "properties": { - "coupon": { - "maxLength": 5000, - "type": "string" - }, - "discount": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "discounts_data_param", - "type": "object" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The coupons to redeem into discounts for the invoice item or invoice line item." - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "invoice": { - "description": "The ID of an existing invoice to add this invoice item to. When left blank, the invoice item will be added to the next upcoming scheduled invoice. This is useful when adding invoice items in response to an invoice.created webhook. You can only add invoice items to draft invoices and there is a maximum of 250 items per invoice.", - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "period": { - "description": "The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.", - "properties": { - "end": { - "format": "unix-time", - "type": "integer" - }, - "start": { - "format": "unix-time", - "type": "integer" - } - }, - "required": [ - "end", - "start" - ], - "title": "period", - "type": "object" - }, - "price": { - "description": "The ID of the price object.", - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product" - ], - "title": "one_time_price_data", - "type": "object" - }, - "quantity": { - "description": "Non-negative integer. The quantity of units for the invoice item.", - "type": "integer" - }, - "subscription": { - "description": "The ID of a subscription to add this invoice item to. When left blank, the invoice item will be be added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. Use this when you want to express that an invoice item has been accrued within the context of a particular subscription.", - "maxLength": 5000, - "type": "string" - }, - "tax_behavior": { - "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "tax_code": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID." - }, - "tax_rates": { - "description": "The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "unit_amount": { - "description": "The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount` will reduce the `amount_due` on the invoice.", - "type": "integer" - }, - "unit_amount_decimal": { - "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", - "format": "decimal", - "type": "string" - } - }, - "required": [ - "customer" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/invoiceitem" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/invoiceitems/{invoiceitem}": { - "delete": { - "description": "Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice.
", - "operationId": "DeleteInvoiceitemsInvoiceitem", - "parameters": [ - { - "in": "path", - "name": "invoiceitem", - "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/deleted_invoiceitem" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "Retrieves the invoice item with the given ID.
", - "operationId": "GetInvoiceitemsInvoiceitem", - "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": "invoiceitem", - "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/invoiceitem" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it’s attached to is closed.
", - "operationId": "PostInvoiceitemsInvoiceitem", - "parameters": [ - { - "in": "path", - "name": "invoiceitem", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "discounts": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "period": { - "explode": true, - "style": "deepObject" - }, - "price_data": { - "explode": true, - "style": "deepObject" - }, - "tax_code": { - "explode": true, - "style": "deepObject" - }, - "tax_rates": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount.", - "type": "integer" - }, - "description": { - "description": "An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.", - "maxLength": 5000, - "type": "string" - }, - "discountable": { - "description": "Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items. Cannot be set to true for prorations.", - "type": "boolean" - }, - "discounts": { - "anyOf": [ - { - "items": { - "properties": { - "coupon": { - "maxLength": 5000, - "type": "string" - }, - "discount": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "discounts_data_param", - "type": "object" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The coupons & existing discounts which apply to the invoice item or invoice line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts." - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "period": { - "description": "The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.", - "properties": { - "end": { - "format": "unix-time", - "type": "integer" - }, - "start": { - "format": "unix-time", - "type": "integer" - } - }, - "required": [ - "end", - "start" - ], - "title": "period", - "type": "object" - }, - "price": { - "description": "The ID of the price object.", - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product" - ], - "title": "one_time_price_data", - "type": "object" - }, - "quantity": { - "description": "Non-negative integer. The quantity of units for the invoice item.", - "type": "integer" - }, - "tax_behavior": { - "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "tax_code": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID." - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. Pass an empty string to remove previously-defined tax rates." - }, - "unit_amount": { - "description": "The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount.", - "type": "integer" - }, - "unit_amount_decimal": { - "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", - "format": "decimal", - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/invoiceitem" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/invoices": { - "get": { - "description": "You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.
", - "operationId": "GetInvoices", - "parameters": [ - { - "description": "The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`.", - "in": "query", - "name": "collection_method", - "required": false, - "schema": { - "enum": [ - "charge_automatically", - "send_invoice" - ], - "type": "string" - }, - "style": "form" - }, - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "Only return invoices for the customer specified by this customer ID.", - "in": "query", - "name": "customer", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "explode": true, - "in": "query", - "name": "due_date", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": "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" - }, - { - "description": "The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview)", - "in": "query", - "name": "status", - "required": false, - "schema": { - "enum": [ - "draft", - "open", - "paid", - "uncollectible", - "void" - ], - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "Only return invoices for the subscription specified by this subscription ID.", - "in": "query", - "name": "subscription", - "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/invoice" - }, - "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/invoices", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "InvoicesList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you finalize the invoice, which allows you to pay or send the invoice to your customers.
", - "operationId": "PostInvoices", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "account_tax_ids": { - "explode": true, - "style": "deepObject" - }, - "automatic_tax": { - "explode": true, - "style": "deepObject" - }, - "custom_fields": { - "explode": true, - "style": "deepObject" - }, - "default_tax_rates": { - "explode": true, - "style": "deepObject" - }, - "discounts": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "from_invoice": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "payment_settings": { - "explode": true, - "style": "deepObject" - }, - "rendering_options": { - "explode": true, - "style": "deepObject" - }, - "transfer_data": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "account_tax_ids": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The account tax IDs associated with the invoice. Only editable when the invoice is a draft." - }, - "application_fee_amount": { - "description": "A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).", - "type": "integer" - }, - "auto_advance": { - "description": "Controls whether Stripe will perform [automatic collection](https://stripe.com/docs/billing/invoices/workflow/#auto_advance) of the invoice. When `false`, the invoice's state will not automatically advance without an explicit action.", - "type": "boolean" - }, - "automatic_tax": { - "description": "Settings for automatic tax lookup for this invoice.", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "automatic_tax_param", - "type": "object" - }, - "collection_method": { - "description": "Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. Defaults to `charge_automatically`.", - "enum": [ - "charge_automatically", - "send_invoice" - ], - "type": "string" - }, - "currency": { - "description": "The currency to create this invoice in. Defaults to that of `customer` if not specified.", - "type": "string" - }, - "custom_fields": { - "anyOf": [ - { - "items": { - "properties": { - "name": { - "maxLength": 30, - "type": "string" - }, - "value": { - "maxLength": 30, - "type": "string" - } - }, - "required": [ - "name", - "value" - ], - "title": "custom_field_params", - "type": "object" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "A list of up to 4 custom fields to be displayed on the invoice." - }, - "customer": { - "description": "The ID of the customer who will be billed.", - "maxLength": 5000, - "type": "string" - }, - "days_until_due": { - "description": "The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`.", - "type": "integer" - }, - "default_payment_method": { - "description": "ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.", - "maxLength": 5000, - "type": "string" - }, - "default_source": { - "description": "ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.", - "maxLength": 5000, - "type": "string" - }, - "default_tax_rates": { - "description": "The tax rates that will apply to any line item that does not have `tax_rates` set.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "description": { - "description": "An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.", - "maxLength": 1500, - "type": "string" - }, - "discounts": { - "anyOf": [ - { - "items": { - "properties": { - "coupon": { - "maxLength": 5000, - "type": "string" - }, - "discount": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "discounts_data_param", - "type": "object" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The coupons to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any discounts." - }, - "due_date": { - "description": "The date on which payment for this invoice is due. Valid only for invoices where `collection_method=send_invoice`.", - "format": "unix-time", - "type": "integer" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "footer": { - "description": "Footer to be displayed on the invoice.", - "maxLength": 5000, - "type": "string" - }, - "from_invoice": { - "description": "Revise an existing invoice. The new invoice will be created in `status=draft`. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details.", - "properties": { - "action": { - "enum": [ - "revision" - ], - "maxLength": 5000, - "type": "string" - }, - "invoice": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "action", - "invoice" - ], - "title": "from_invoice", - "type": "object" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "on_behalf_of": { - "description": "The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.", - "type": "string" - }, - "payment_settings": { - "description": "Configuration settings for the PaymentIntent that is generated when the invoice is finalized.", - "properties": { - "default_mandate": { - "maxLength": 5000, - "type": "string" - }, - "payment_method_options": { - "properties": { - "acss_debit": { - "anyOf": [ - { - "properties": { - "mandate_options": { - "properties": { - "transaction_type": { - "enum": [ - "business", - "personal" - ], - "type": "string" - } - }, - "title": "mandate_options_param", - "type": "object" - }, - "verification_method": { - "enum": [ - "automatic", - "instant", - "microdeposits" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "bancontact": { - "anyOf": [ - { - "properties": { - "preferred_language": { - "enum": [ - "de", - "en", - "fr", - "nl" - ], - "type": "string" - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "card": { - "anyOf": [ - { - "properties": { - "installments": { - "properties": { - "enabled": { - "type": "boolean" - }, - "plan": { - "anyOf": [ - { - "properties": { - "count": { - "type": "integer" - }, - "interval": { - "enum": [ - "month" - ], - "type": "string" - }, - "type": { - "enum": [ - "fixed_count" - ], - "type": "string" - } - }, - "required": [ - "count", - "interval", - "type" - ], - "title": "installment_plan", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "installments_param", - "type": "object" - }, - "request_three_d_secure": { - "enum": [ - "any", - "automatic" - ], - "type": "string" - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "customer_balance": { - "anyOf": [ - { - "properties": { - "bank_transfer": { - "properties": { - "eu_bank_transfer": { - "properties": { - "country": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "country" - ], - "title": "eu_bank_transfer_param", - "type": "object" - }, - "type": { - "type": "string" - } - }, - "title": "bank_transfer_param", - "type": "object" - }, - "funding_type": { - "type": "string" - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "konbini": { - "anyOf": [ - { - "properties": { - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "us_bank_account": { - "anyOf": [ - { - "properties": { - "financial_connections": { - "properties": { - "permissions": { - "items": { - "enum": [ - "balances", - "ownership", - "payment_method", - "transactions" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - } - }, - "title": "invoice_linked_account_options_param", - "type": "object" - }, - "verification_method": { - "enum": [ - "automatic", - "instant", - "microdeposits" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "payment_method_options", - "type": "object" - }, - "payment_method_types": { - "anyOf": [ - { - "items": { - "enum": [ - "ach_credit_transfer", - "ach_debit", - "acss_debit", - "au_becs_debit", - "bacs_debit", - "bancontact", - "boleto", - "card", - "customer_balance", - "fpx", - "giropay", - "grabpay", - "ideal", - "konbini", - "link", - "paynow", - "promptpay", - "sepa_debit", - "sofort", - "us_bank_account", - "wechat_pay" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "payment_settings", - "type": "object" - }, - "pending_invoice_items_behavior": { - "description": "How to handle pending invoice items on invoice creation. One of `include` or `exclude`. `include` will include any pending invoice items, and will create an empty draft invoice if no pending invoice items exist. `exclude` will always create an empty invoice draft regardless if there are pending invoice items or not. Defaults to `exclude` if the parameter is omitted.", - "enum": [ - "exclude", - "include", - "include_and_require" - ], - "type": "string" - }, - "rendering_options": { - "anyOf": [ - { - "properties": { - "amount_tax_display": { - "enum": [ - "", - "exclude_tax", - "include_inclusive_tax" - ], - "type": "string" - } - }, - "title": "rendering_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Options for invoice PDF rendering." - }, - "statement_descriptor": { - "description": "Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`.", - "maxLength": 22, - "type": "string" - }, - "subscription": { - "description": "The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription. The subscription's billing cycle and regular subscription events won't be affected.", - "maxLength": 5000, - "type": "string" - }, - "transfer_data": { - "description": "If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge.", - "properties": { - "amount": { - "type": "integer" - }, - "destination": { - "type": "string" - } - }, - "required": [ - "destination" - ], - "title": "transfer_data_specs", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/invoice" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/invoices/search": { - "get": { - "description": "Search for invoices you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
", - "operationId": "GetInvoicesSearch", - "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" - }, - { - "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": "A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.", - "in": "query", - "name": "page", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for invoices](https://stripe.com/docs/search#query-fields-for-invoices).", - "in": "query", - "name": "query", - "required": true, - "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/invoice" - }, - "type": "array" - }, - "has_more": { - "type": "boolean" - }, - "next_page": { - "maxLength": 5000, - "nullable": true, - "type": "string" - }, - "object": { - "description": "String representing the object's type. Objects of the same type share the same value.", - "enum": [ - "search_result" - ], - "type": "string" - }, - "total_count": { - "description": "The total number of objects that match the query, only accurate up to 10,000.", - "type": "integer" - }, - "url": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "SearchResult", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/invoices/upcoming": { - "get": { - "description": "At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
\n\nNote that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount.
\n\nYou can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a proration_date
parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date
returned on the upcoming invoice resource. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start]
is equal to the subscription_proration_date
on the upcoming invoice resource.
When retrieving an upcoming invoice, you’ll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
", - "operationId": "GetInvoicesUpcomingLines", - "parameters": [ - { - "description": "Settings for automatic tax lookup for this invoice preview.", - "explode": true, - "in": "query", - "name": "automatic_tax", - "required": false, - "schema": { - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "automatic_tax_param", - "type": "object" - }, - "style": "deepObject" - }, - { - "description": "The code of the coupon to apply. If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. The invoice can be previewed without a coupon by passing this value as an empty string.", - "in": "query", - "name": "coupon", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "The currency to preview this invoice in. Defaults to that of `customer` if not specified.", - "in": "query", - "name": "currency", - "required": false, - "schema": { - "type": "string" - }, - "style": "form" - }, - { - "description": "The identifier of the customer whose upcoming invoice you'd like to retrieve.", - "in": "query", - "name": "customer", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "Details about the customer you want to invoice or overrides for an existing customer.", - "explode": true, - "in": "query", - "name": "customer_details", - "required": false, - "schema": { - "properties": { - "address": { - "anyOf": [ - { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "optional_fields_address", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "shipping": { - "anyOf": [ - { - "properties": { - "address": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "optional_fields_address", - "type": "object" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "address", - "name" - ], - "title": "customer_shipping", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "tax": { - "properties": { - "ip_address": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "tax_param", - "type": "object" - }, - "tax_exempt": { - "enum": [ - "", - "exempt", - "none", - "reverse" - ], - "type": "string" - }, - "tax_ids": { - "items": { - "properties": { - "type": { - "enum": [ - "ae_trn", - "au_abn", - "au_arn", - "bg_uic", - "br_cnpj", - "br_cpf", - "ca_bn", - "ca_gst_hst", - "ca_pst_bc", - "ca_pst_mb", - "ca_pst_sk", - "ca_qst", - "ch_vat", - "cl_tin", - "eg_tin", - "es_cif", - "eu_oss_vat", - "eu_vat", - "gb_vat", - "ge_vat", - "hk_br", - "hu_tin", - "id_npwp", - "il_vat", - "in_gst", - "is_vat", - "jp_cn", - "jp_rn", - "jp_trn", - "ke_pin", - "kr_brn", - "li_uid", - "mx_rfc", - "my_frp", - "my_itn", - "my_sst", - "no_vat", - "nz_gst", - "ph_tin", - "ru_inn", - "ru_kpp", - "sa_vat", - "sg_gst", - "sg_uen", - "si_tin", - "th_vat", - "tr_tin", - "tw_vat", - "ua_vat", - "us_ein", - "za_vat" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "value": { - "type": "string" - } - }, - "required": [ - "type", - "value" - ], - "title": "data_params", - "type": "object" - }, - "type": "array" - } - }, - "title": "customer_details_param", - "type": "object" - }, - "style": "deepObject" - }, - { - "description": "The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead.", - "explode": true, - "in": "query", - "name": "discounts", - "required": false, - "schema": { - "anyOf": [ - { - "items": { - "properties": { - "coupon": { - "maxLength": 5000, - "type": "string" - }, - "discount": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "discounts_data_param", - "type": "object" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "style": "deepObject" - }, - { - "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": "List of invoice items to add or update in the upcoming invoice preview.", - "explode": true, - "in": "query", - "name": "invoice_items", - "required": false, - "schema": { - "items": { - "properties": { - "amount": { - "type": "integer" - }, - "currency": { - "type": "string" - }, - "description": { - "maxLength": 5000, - "type": "string" - }, - "discountable": { - "type": "boolean" - }, - "discounts": { - "anyOf": [ - { - "items": { - "properties": { - "coupon": { - "maxLength": 5000, - "type": "string" - }, - "discount": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "discounts_data_param", - "type": "object" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "invoiceitem": { - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "period": { - "properties": { - "end": { - "format": "unix-time", - "type": "integer" - }, - "start": { - "format": "unix-time", - "type": "integer" - } - }, - "required": [ - "end", - "start" - ], - "title": "period", - "type": "object" - }, - "price": { - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product" - ], - "title": "one_time_price_data", - "type": "object" - }, - "quantity": { - "type": "integer" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "tax_code": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "title": "invoice_item_preview_params", - "type": "object" - }, - "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": "The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields.", - "in": "query", - "name": "schedule", - "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" - }, - { - "description": "The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions.", - "in": "query", - "name": "subscription", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`.", - "explode": true, - "in": "query", - "name": "subscription_billing_cycle_anchor", - "required": false, - "schema": { - "anyOf": [ - { - "enum": [ - "now", - "unchanged" - ], - "maxLength": 5000, - "type": "string" - }, - { - "format": "unix-time", - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if within the current period and prorations have been enabled using `proration_behavior`.", - "explode": true, - "in": "query", - "name": "subscription_cancel_at", - "required": false, - "schema": { - "anyOf": [ - { - "format": "unix-time", - "type": "integer" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "style": "deepObject" - }, - { - "description": "Boolean indicating whether this subscription should cancel at the end of the current period.", - "in": "query", - "name": "subscription_cancel_at_period_end", - "required": false, - "schema": { - "type": "boolean" - }, - "style": "form" - }, - { - "description": "This simulates the subscription being canceled or expired immediately.", - "in": "query", - "name": "subscription_cancel_now", - "required": false, - "schema": { - "type": "boolean" - }, - "style": "form" - }, - { - "description": "If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set.", - "explode": true, - "in": "query", - "name": "subscription_default_tax_rates", - "required": false, - "schema": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "style": "deepObject" - }, - { - "description": "A list of up to 20 subscription items, each with an attached price.", - "explode": true, - "in": "query", - "name": "subscription_items", - "required": false, - "schema": { - "items": { - "properties": { - "billing_thresholds": { - "anyOf": [ - { - "properties": { - "usage_gte": { - "type": "integer" - } - }, - "required": [ - "usage_gte" - ], - "title": "item_billing_thresholds_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "clear_usage": { - "type": "boolean" - }, - "deleted": { - "type": "boolean" - }, - "id": { - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "price": { - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "recurring": { - "properties": { - "interval": { - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - } - }, - "required": [ - "interval" - ], - "title": "recurring_adhoc", - "type": "object" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product", - "recurring" - ], - "title": "recurring_price_data", - "type": "object" - }, - "quantity": { - "type": "integer" - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "subscription_item_update_params", - "type": "object" - }, - "type": "array" - }, - "style": "deepObject" - }, - { - "description": "Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes.", - "in": "query", - "name": "subscription_proration_behavior", - "required": false, - "schema": { - "enum": [ - "always_invoice", - "create_prorations", - "none" - ], - "type": "string" - }, - "style": "form" - }, - { - "description": "If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period, and cannot be before the subscription was on its current plan. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'.", - "in": "query", - "name": "subscription_proration_date", - "required": false, - "schema": { - "format": "unix-time", - "type": "integer" - }, - "style": "form" - }, - { - "description": "Date a subscription is intended to start (can be future or past)", - "in": "query", - "name": "subscription_start_date", - "required": false, - "schema": { - "format": "unix-time", - "type": "integer" - }, - "style": "form" - }, - { - "description": "If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required.", - "explode": true, - "in": "query", - "name": "subscription_trial_end", - "required": false, - "schema": { - "anyOf": [ - { - "enum": [ - "now" - ], - "maxLength": 5000, - "type": "string" - }, - { - "format": "unix-time", - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.", - "in": "query", - "name": "subscription_trial_from_plan", - "required": false, - "schema": { - "type": "boolean" - }, - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/line_item" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "InvoiceLinesList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/invoices/{invoice}": { - "delete": { - "description": "Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be voided.
", - "operationId": "DeleteInvoicesInvoice", - "parameters": [ - { - "in": "path", - "name": "invoice", - "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/deleted_invoice" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "Retrieves the invoice with the given ID.
", - "operationId": "GetInvoicesInvoice", - "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": "invoice", - "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/invoice" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Draft invoices are fully editable. Once an invoice is finalized,\nmonetary values, as well as collection_method
, become uneditable.
If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on,\nsending reminders for, or automatically reconciling invoices, pass\nauto_advance=false
.
Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you’d like to finalize a draft invoice manually, you can do so using this method.
", - "operationId": "PostInvoicesInvoiceFinalize", - "parameters": [ - { - "in": "path", - "name": "invoice", - "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": { - "auto_advance": { - "description": "Controls whether Stripe will perform [automatic collection](https://stripe.com/docs/invoicing/automatic-charging) of the invoice. When `false`, the invoice's state will not automatically advance without an explicit action.", - "type": "boolean" - }, - "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/invoice" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/invoices/{invoice}/lines": { - "get": { - "description": "When retrieving an invoice, you’ll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
", - "operationId": "GetInvoicesInvoiceLines", - "parameters": [ - { - "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" - }, - { - "in": "path", - "name": "invoice", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/line_item" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "InvoiceLinesList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/invoices/{invoice}/mark_uncollectible": { - "post": { - "description": "Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
", - "operationId": "PostInvoicesInvoiceMarkUncollectible", - "parameters": [ - { - "in": "path", - "name": "invoice", - "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/invoice" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/invoices/{invoice}/pay": { - "post": { - "description": "Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings. However, if you’d like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.
", - "operationId": "PostInvoicesInvoicePay", - "parameters": [ - { - "in": "path", - "name": "invoice", - "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" - }, - "forgive": { - "description": "In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. \n\nPassing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to `false`.", - "type": "boolean" - }, - "mandate": { - "description": "ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set.", - "maxLength": 5000, - "type": "string" - }, - "off_session": { - "description": "Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session).", - "type": "boolean" - }, - "paid_out_of_band": { - "description": "Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`.", - "type": "boolean" - }, - "payment_method": { - "description": "A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid.", - "maxLength": 5000, - "type": "string" - }, - "source": { - "description": "A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid.", - "maxLength": 5000, - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/invoice" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/invoices/{invoice}/send": { - "post": { - "description": "Stripe will automatically send invoices to customers according to your subscriptions settings. However, if you’d like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.
\n\nRequests made in test-mode result in no emails being sent, despite sending an invoice.sent
event.
Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to deletion, however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.
", - "operationId": "PostInvoicesInvoiceVoid", - "parameters": [ - { - "in": "path", - "name": "invoice", - "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/invoice" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/issuing/authorizations": { - "get": { - "description": "Returns a list of Issuing Authorization
objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
Retrieves an Issuing Authorization
object.
Updates the specified Issuing Authorization
object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Approves a pending Issuing Authorization
object. This request should be made within the timeout window of the real-time authorization flow. \nYou can also respond directly to the webhook request to approve an authorization (preferred). More details can be found here.
Declines a pending Issuing Authorization
object. This request should be made within the timeout window of the real time authorization flow.\nYou can also respond directly to the webhook request to decline an authorization (preferred). More details can be found here.
Returns a list of Issuing Cardholder
objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
Creates a new Issuing Cardholder
object that can be issued cards.
Retrieves an Issuing Cardholder
object.
Updates the specified Issuing Cardholder
object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Returns a list of Issuing Card
objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
Creates an Issuing Card
object.
Retrieves an Issuing Card
object.
Updates the specified Issuing Card
object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Returns a list of Issuing Dispute
objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
Creates an Issuing Dispute
object. Individual pieces of evidence within the evidence
object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to Dispute reasons and evidence for more details about evidence requirements.
Retrieves an Issuing Dispute
object.
Updates the specified Issuing Dispute
object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence
object can be unset by passing in an empty string.
Submits an Issuing Dispute
to the card network. Stripe validates that all evidence fields required for the dispute’s reason are present. For more details, see Dispute reasons and evidence.
Returns a list of Issuing Settlement
objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
Retrieves an Issuing Settlement
object.
Updates the specified Issuing Settlement
object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Returns a list of Issuing Transaction
objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
Retrieves an Issuing Transaction
object.
Updates the specified Issuing Transaction
object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
To launch the Financial Connections authorization flow, create a Session
. The session’s client_secret
can be used to launch the flow using Stripe.js.
Retrieves the details of a Financial Connections Session
Returns a list of Financial Connections Account
objects.
Retrieves the details of an Financial Connections Account
.
Disables your access to a Financial Connections Account
. You will no longer be able to access data associated with the account (e.g. balances, transactions).
Lists all owners for a given Account
Refreshes the data associated with a Financial Connections Account
.
Retrieves a Mandate object.
", - "operationId": "GetMandatesMandate", - "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": "mandate", - "required": true, - "schema": { - "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/mandate" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/payment_intents": { - "get": { - "description": "Returns a list of PaymentIntents.
", - "operationId": "GetPaymentIntents", - "parameters": [ - { - "description": "A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.", - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "Only return PaymentIntents for the customer specified by this customer ID.", - "in": "query", - "name": "customer", - "required": false, - "schema": { - "maxLength": 5000, - "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": "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/payment_intent" - }, - "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/payment_intents", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "PaymentFlowsPaymentIntentList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a PaymentIntent object.
\n\nAfter the PaymentIntent is created, attach a payment method and confirm\nto continue the payment. You can read more about the different payment flows\navailable via the Payment Intents API here.
\n\nWhen confirm=true
is used during creation, it is equivalent to creating\nand confirming the PaymentIntent in the same call. You may use any parameters\navailable in the confirm API when confirm=true
\nis supplied.
Search for PaymentIntents you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
", - "operationId": "GetPaymentIntentsSearch", - "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" - }, - { - "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": "A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.", - "in": "query", - "name": "page", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for payment intents](https://stripe.com/docs/search#query-fields-for-payment-intents).", - "in": "query", - "name": "query", - "required": true, - "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/payment_intent" - }, - "type": "array" - }, - "has_more": { - "type": "boolean" - }, - "next_page": { - "maxLength": 5000, - "nullable": true, - "type": "string" - }, - "object": { - "description": "String representing the object's type. Objects of the same type share the same value.", - "enum": [ - "search_result" - ], - "type": "string" - }, - "total_count": { - "description": "The total number of objects that match the query, only accurate up to 10,000.", - "type": "integer" - }, - "url": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "SearchResult", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/payment_intents/{intent}": { - "get": { - "description": "Retrieves the details of a PaymentIntent that has previously been created.
\n\nClient-side retrieval using a publishable key is allowed when the client_secret
is provided in the query string.
When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the payment intent object reference for more details.
", - "operationId": "GetPaymentIntentsIntent", - "parameters": [ - { - "description": "The client secret of the PaymentIntent. Required if a publishable key is used to retrieve the source.", - "in": "query", - "name": "client_secret", - "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" - }, - { - "in": "path", - "name": "intent", - "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/payment_intent" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates properties on a PaymentIntent object without confirming.
\n\nDepending on which properties you update, you may need to confirm the\nPaymentIntent again. For example, updating the payment_method
will\nalways require you to confirm the PaymentIntent again. If you prefer to\nupdate and confirm at the same time, we recommend updating properties via\nthe confirm API instead.
Manually reconcile the remaining amount for a customer_balance PaymentIntent.
", - "operationId": "PostPaymentIntentsIntentApplyCustomerBalance", - "parameters": [ - { - "in": "path", - "name": "intent", - "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": { - "amount": { - "description": "Amount intended to be applied to this PaymentIntent from the customer’s cash balance.\n\nA positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency).\n\nThe maximum amount is the amount of the PaymentIntent.\n\nWhen omitted, the amount defaults to the remaining amount requested on the PaymentIntent.", - "type": "integer" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "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/payment_intent" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/payment_intents/{intent}/cancel": { - "post": { - "description": "A PaymentIntent object can be canceled when it is in one of these statuses: requires_payment_method
, requires_capture
, requires_confirmation
, requires_action
or, in rare cases, processing
.
Once canceled, no additional charges will be made by the PaymentIntent and any operations on the PaymentIntent will fail with an error. For PaymentIntents with status=’requires_capture’
, the remaining amount_capturable
will automatically be refunded.
You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session instead.
", - "operationId": "PostPaymentIntentsIntentCancel", - "parameters": [ - { - "in": "path", - "name": "intent", - "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": { - "cancellation_reason": { - "description": "Reason for canceling this PaymentIntent. Possible values are `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`", - "enum": [ - "abandoned", - "duplicate", - "fraudulent", - "requested_by_customer" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "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/payment_intent" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/payment_intents/{intent}/capture": { - "post": { - "description": "Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture
.
Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by default).
\n\nLearn more about separate authorization and capture.
", - "operationId": "PostPaymentIntentsIntentCapture", - "parameters": [ - { - "in": "path", - "name": "intent", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "transfer_data": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount_to_capture": { - "description": "The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. Defaults to the full `amount_capturable` if not provided.", - "type": "integer" - }, - "application_fee_amount": { - "description": "The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).", - "type": "integer" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "statement_descriptor": { - "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.", - "maxLength": 22, - "type": "string" - }, - "statement_descriptor_suffix": { - "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.", - "maxLength": 22, - "type": "string" - }, - "transfer_data": { - "description": "The parameters used to automatically create a Transfer when the payment\nis captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).", - "properties": { - "amount": { - "type": "integer" - } - }, - "title": "transfer_data_update_params", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/payment_intent" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/payment_intents/{intent}/confirm": { - "post": { - "description": "Confirm that your customer intends to pay with current or provided\npayment method. Upon confirmation, the PaymentIntent will attempt to initiate\na payment.\nIf the selected payment method requires additional authentication steps, the\nPaymentIntent will transition to the requires_action
status and\nsuggest additional actions via next_action
. If payment fails,\nthe PaymentIntent will transition to the requires_payment_method
status. If\npayment succeeds, the PaymentIntent will transition to the succeeded
\nstatus (or requires_capture
, if capture_method
is set to manual
).\nIf the confirmation_method
is automatic
, payment may be attempted\nusing our client SDKs\nand the PaymentIntent’s client_secret.\nAfter next_action
s are handled by the client, no additional\nconfirmation is required to complete the payment.\nIf the confirmation_method
is manual
, all payment attempts must be\ninitiated using a secret key.\nIf any actions are required for the payment, the PaymentIntent will\nreturn to the requires_confirmation
state\nafter those actions are completed. Your server needs to then\nexplicitly re-confirm the PaymentIntent to initiate the next payment\nattempt. Read the expanded documentation\nto learn more about manual confirmation.
Perform an incremental authorization on an eligible\nPaymentIntent. To be eligible, the\nPaymentIntent’s status must be requires_capture
and\nincremental_authorization_supported\nmust be true
.
Incremental authorizations attempt to increase the authorized amount on\nyour customer’s card to the new, higher amount
provided. As with the\ninitial authorization, incremental authorizations may be declined. A\nsingle PaymentIntent can call this endpoint multiple times to further\nincrease the authorized amount.
If the incremental authorization succeeds, the PaymentIntent object is\nreturned with the updated\namount.\nIf the incremental authorization fails, a\ncard_declined error is returned, and no\nfields on the PaymentIntent or Charge are updated. The PaymentIntent\nobject remains capturable for the previously authorized amount.
\n\nEach PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.\nOnce captured, a PaymentIntent can no longer be incremented.
\n\nLearn more about incremental authorizations.
", - "operationId": "PostPaymentIntentsIntentIncrementAuthorization", - "parameters": [ - { - "in": "path", - "name": "intent", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "transfer_data": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "The updated total amount you intend to collect from the cardholder. This amount must be greater than the currently authorized amount.", - "type": "integer" - }, - "application_fee_amount": { - "description": "The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).", - "type": "integer" - }, - "description": { - "description": "An arbitrary string attached to the object. Often useful for displaying to users.", - "maxLength": 1000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "statement_descriptor": { - "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.", - "maxLength": 22, - "type": "string" - }, - "transfer_data": { - "description": "The parameters used to automatically create a Transfer when the payment is captured.\nFor more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).", - "properties": { - "amount": { - "type": "integer" - } - }, - "title": "transfer_data_update_params", - "type": "object" - } - }, - "required": [ - "amount" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/payment_intent" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/payment_intents/{intent}/verify_microdeposits": { - "post": { - "description": "Verifies microdeposits on a PaymentIntent object.
", - "operationId": "PostPaymentIntentsIntentVerifyMicrodeposits", - "parameters": [ - { - "in": "path", - "name": "intent", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "amounts": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amounts": { - "description": "Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.", - "items": { - "type": "integer" - }, - "type": "array" - }, - "client_secret": { - "description": "The client secret of the PaymentIntent.", - "maxLength": 5000, - "type": "string" - }, - "descriptor_code": { - "description": "A six-character code starting with SM present in the microdeposit sent to the bank account.", - "maxLength": 5000, - "type": "string" - }, - "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/payment_intent" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/payment_links": { - "get": { - "description": "Returns a list of your payment links.
", - "operationId": "GetPaymentLinks", - "parameters": [ - { - "description": "Only return payment links that are active or inactive (e.g., pass `false` to list all inactive payment links).", - "in": "query", - "name": "active", - "required": false, - "schema": { - "type": "boolean" - }, - "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": "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/payment_link" - }, - "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/payment_links", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "PaymentLinksResourcePaymentLinkList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a payment link.
", - "operationId": "PostPaymentLinks", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "after_completion": { - "explode": true, - "style": "deepObject" - }, - "automatic_tax": { - "explode": true, - "style": "deepObject" - }, - "consent_collection": { - "explode": true, - "style": "deepObject" - }, - "custom_text": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "line_items": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "payment_intent_data": { - "explode": true, - "style": "deepObject" - }, - "payment_method_types": { - "explode": true, - "style": "deepObject" - }, - "phone_number_collection": { - "explode": true, - "style": "deepObject" - }, - "shipping_address_collection": { - "explode": true, - "style": "deepObject" - }, - "shipping_options": { - "explode": true, - "style": "deepObject" - }, - "subscription_data": { - "explode": true, - "style": "deepObject" - }, - "tax_id_collection": { - "explode": true, - "style": "deepObject" - }, - "transfer_data": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "after_completion": { - "description": "Behavior after the purchase is complete.", - "properties": { - "hosted_confirmation": { - "properties": { - "custom_message": { - "maxLength": 500, - "type": "string" - } - }, - "title": "after_completion_confirmation_page_params", - "type": "object" - }, - "redirect": { - "properties": { - "url": { - "maxLength": 2048, - "type": "string" - } - }, - "required": [ - "url" - ], - "title": "after_completion_redirect_params", - "type": "object" - }, - "type": { - "enum": [ - "hosted_confirmation", - "redirect" - ], - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "after_completion_params", - "type": "object" - }, - "allow_promotion_codes": { - "description": "Enables user redeemable promotion codes.", - "type": "boolean" - }, - "application_fee_amount": { - "description": "The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Can only be applied when there are no line items with recurring prices.", - "type": "integer" - }, - "application_fee_percent": { - "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field.", - "type": "number" - }, - "automatic_tax": { - "description": "Configuration for automatic tax collection.", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "automatic_tax_params", - "type": "object" - }, - "billing_address_collection": { - "description": "Configuration for collecting the customer's billing address.", - "enum": [ - "auto", - "required" - ], - "type": "string" - }, - "consent_collection": { - "description": "Configure fields to gather active consent from customers.", - "properties": { - "promotions": { - "enum": [ - "auto", - "none" - ], - "type": "string" - }, - "terms_of_service": { - "enum": [ - "none", - "required" - ], - "type": "string" - } - }, - "title": "consent_collection_params", - "type": "object" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies) and supported by each line item's price.", - "type": "string" - }, - "custom_text": { - "description": "Display additional text for your customers using custom text.", - "properties": { - "shipping_address": { - "anyOf": [ - { - "properties": { - "message": { - "maxLength": 500, - "type": "string" - } - }, - "required": [ - "message" - ], - "title": "custom_text_position_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "submit": { - "anyOf": [ - { - "properties": { - "message": { - "maxLength": 500, - "type": "string" - } - }, - "required": [ - "message" - ], - "title": "custom_text_position_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "custom_text_param", - "type": "object" - }, - "customer_creation": { - "description": "Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers).", - "enum": [ - "always", - "if_required" - ], - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "line_items": { - "description": "The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported.", - "items": { - "properties": { - "adjustable_quantity": { - "properties": { - "enabled": { - "type": "boolean" - }, - "maximum": { - "type": "integer" - }, - "minimum": { - "type": "integer" - } - }, - "required": [ - "enabled" - ], - "title": "adjustable_quantity_params", - "type": "object" - }, - "price": { - "maxLength": 5000, - "type": "string" - }, - "quantity": { - "type": "integer" - } - }, - "required": [ - "price", - "quantity" - ], - "title": "line_items_create_params", - "type": "object" - }, - "type": "array" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link.", - "type": "object" - }, - "on_behalf_of": { - "description": "The account on behalf of which to charge.", - "type": "string" - }, - "payment_intent_data": { - "description": "A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode.", - "properties": { - "capture_method": { - "enum": [ - "automatic", - "manual" - ], - "type": "string" - }, - "setup_future_usage": { - "enum": [ - "off_session", - "on_session" - ], - "type": "string" - } - }, - "title": "payment_intent_data_params", - "type": "object" - }, - "payment_method_collection": { - "description": "Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount.\n\nCan only be set in `subscription` mode.\n\nIf you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials).", - "enum": [ - "always", - "if_required" - ], - "type": "string" - }, - "payment_method_types": { - "description": "The list of payment method types that customers can use. If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)).", - "items": { - "enum": [ - "affirm", - "afterpay_clearpay", - "alipay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "blik", - "boleto", - "card", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "klarna", - "konbini", - "oxxo", - "p24", - "paynow", - "pix", - "promptpay", - "sepa_debit", - "sofort", - "us_bank_account", - "wechat_pay" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - }, - "phone_number_collection": { - "description": "Controls phone number collection settings during checkout.\n\nWe recommend that you review your privacy policy and check with your legal contacts.", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "phone_number_collection_params", - "type": "object" - }, - "shipping_address_collection": { - "description": "Configuration for collecting the customer's shipping address.", - "properties": { - "allowed_countries": { - "items": { - "enum": [ - "AC", - "AD", - "AE", - "AF", - "AG", - "AI", - "AL", - "AM", - "AO", - "AQ", - "AR", - "AT", - "AU", - "AW", - "AX", - "AZ", - "BA", - "BB", - "BD", - "BE", - "BF", - "BG", - "BH", - "BI", - "BJ", - "BL", - "BM", - "BN", - "BO", - "BQ", - "BR", - "BS", - "BT", - "BV", - "BW", - "BY", - "BZ", - "CA", - "CD", - "CF", - "CG", - "CH", - "CI", - "CK", - "CL", - "CM", - "CN", - "CO", - "CR", - "CV", - "CW", - "CY", - "CZ", - "DE", - "DJ", - "DK", - "DM", - "DO", - "DZ", - "EC", - "EE", - "EG", - "EH", - "ER", - "ES", - "ET", - "FI", - "FJ", - "FK", - "FO", - "FR", - "GA", - "GB", - "GD", - "GE", - "GF", - "GG", - "GH", - "GI", - "GL", - "GM", - "GN", - "GP", - "GQ", - "GR", - "GS", - "GT", - "GU", - "GW", - "GY", - "HK", - "HN", - "HR", - "HT", - "HU", - "ID", - "IE", - "IL", - "IM", - "IN", - "IO", - "IQ", - "IS", - "IT", - "JE", - "JM", - "JO", - "JP", - "KE", - "KG", - "KH", - "KI", - "KM", - "KN", - "KR", - "KW", - "KY", - "KZ", - "LA", - "LB", - "LC", - "LI", - "LK", - "LR", - "LS", - "LT", - "LU", - "LV", - "LY", - "MA", - "MC", - "MD", - "ME", - "MF", - "MG", - "MK", - "ML", - "MM", - "MN", - "MO", - "MQ", - "MR", - "MS", - "MT", - "MU", - "MV", - "MW", - "MX", - "MY", - "MZ", - "NA", - "NC", - "NE", - "NG", - "NI", - "NL", - "NO", - "NP", - "NR", - "NU", - "NZ", - "OM", - "PA", - "PE", - "PF", - "PG", - "PH", - "PK", - "PL", - "PM", - "PN", - "PR", - "PS", - "PT", - "PY", - "QA", - "RE", - "RO", - "RS", - "RU", - "RW", - "SA", - "SB", - "SC", - "SE", - "SG", - "SH", - "SI", - "SJ", - "SK", - "SL", - "SM", - "SN", - "SO", - "SR", - "SS", - "ST", - "SV", - "SX", - "SZ", - "TA", - "TC", - "TD", - "TF", - "TG", - "TH", - "TJ", - "TK", - "TL", - "TM", - "TN", - "TO", - "TR", - "TT", - "TV", - "TW", - "TZ", - "UA", - "UG", - "US", - "UY", - "UZ", - "VA", - "VC", - "VE", - "VG", - "VN", - "VU", - "WF", - "WS", - "XK", - "YE", - "YT", - "ZA", - "ZM", - "ZW", - "ZZ" - ], - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "allowed_countries" - ], - "title": "shipping_address_collection_params", - "type": "object" - }, - "shipping_options": { - "description": "The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link.", - "items": { - "properties": { - "shipping_rate": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "shipping_option_params", - "type": "object" - }, - "type": "array" - }, - "submit_type": { - "description": "Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`).", - "enum": [ - "auto", - "book", - "donate", - "pay" - ], - "type": "string" - }, - "subscription_data": { - "description": "When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`.", - "properties": { - "description": { - "maxLength": 500, - "type": "string" - }, - "trial_period_days": { - "type": "integer" - } - }, - "title": "subscription_data_params", - "type": "object" - }, - "tax_id_collection": { - "description": "Controls tax ID collection during checkout.", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "tax_id_collection_params", - "type": "object" - }, - "transfer_data": { - "description": "The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.", - "properties": { - "amount": { - "type": "integer" - }, - "destination": { - "type": "string" - } - }, - "required": [ - "destination" - ], - "title": "transfer_data_params", - "type": "object" - } - }, - "required": [ - "line_items" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/payment_link" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/payment_links/{payment_link}": { - "get": { - "description": "Retrieve a payment link.
", - "operationId": "GetPaymentLinksPaymentLink", - "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": "payment_link", - "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/payment_link" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates a payment link.
", - "operationId": "PostPaymentLinksPaymentLink", - "parameters": [ - { - "in": "path", - "name": "payment_link", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "after_completion": { - "explode": true, - "style": "deepObject" - }, - "automatic_tax": { - "explode": true, - "style": "deepObject" - }, - "custom_text": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "line_items": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "payment_method_types": { - "explode": true, - "style": "deepObject" - }, - "shipping_address_collection": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "active": { - "description": "Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated.", - "type": "boolean" - }, - "after_completion": { - "description": "Behavior after the purchase is complete.", - "properties": { - "hosted_confirmation": { - "properties": { - "custom_message": { - "maxLength": 500, - "type": "string" - } - }, - "title": "after_completion_confirmation_page_params", - "type": "object" - }, - "redirect": { - "properties": { - "url": { - "maxLength": 2048, - "type": "string" - } - }, - "required": [ - "url" - ], - "title": "after_completion_redirect_params", - "type": "object" - }, - "type": { - "enum": [ - "hosted_confirmation", - "redirect" - ], - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "after_completion_params", - "type": "object" - }, - "allow_promotion_codes": { - "description": "Enables user redeemable promotion codes.", - "type": "boolean" - }, - "automatic_tax": { - "description": "Configuration for automatic tax collection.", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "automatic_tax_params", - "type": "object" - }, - "billing_address_collection": { - "description": "Configuration for collecting the customer's billing address.", - "enum": [ - "auto", - "required" - ], - "type": "string" - }, - "custom_text": { - "description": "Display additional text for your customers using custom text.", - "properties": { - "shipping_address": { - "anyOf": [ - { - "properties": { - "message": { - "maxLength": 500, - "type": "string" - } - }, - "required": [ - "message" - ], - "title": "custom_text_position_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "submit": { - "anyOf": [ - { - "properties": { - "message": { - "maxLength": 500, - "type": "string" - } - }, - "required": [ - "message" - ], - "title": "custom_text_position_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "custom_text_param", - "type": "object" - }, - "customer_creation": { - "description": "Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers).", - "enum": [ - "always", - "if_required" - ], - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "line_items": { - "description": "The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported.", - "items": { - "properties": { - "adjustable_quantity": { - "properties": { - "enabled": { - "type": "boolean" - }, - "maximum": { - "type": "integer" - }, - "minimum": { - "type": "integer" - } - }, - "required": [ - "enabled" - ], - "title": "adjustable_quantity_params", - "type": "object" - }, - "id": { - "maxLength": 5000, - "type": "string" - }, - "quantity": { - "type": "integer" - } - }, - "required": [ - "id" - ], - "title": "line_items_update_params", - "type": "object" - }, - "type": "array" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link.", - "type": "object" - }, - "payment_method_collection": { - "description": "Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount.\n\nCan only be set in `subscription` mode.\n\nIf you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials).", - "enum": [ - "always", - "if_required" - ], - "type": "string" - }, - "payment_method_types": { - "anyOf": [ - { - "items": { - "enum": [ - "affirm", - "afterpay_clearpay", - "alipay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "blik", - "boleto", - "card", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "klarna", - "konbini", - "oxxo", - "p24", - "paynow", - "pix", - "promptpay", - "sepa_debit", - "sofort", - "us_bank_account", - "wechat_pay" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The list of payment method types that customers can use. Pass an empty string to enable automatic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods)." - }, - "shipping_address_collection": { - "anyOf": [ - { - "properties": { - "allowed_countries": { - "items": { - "enum": [ - "AC", - "AD", - "AE", - "AF", - "AG", - "AI", - "AL", - "AM", - "AO", - "AQ", - "AR", - "AT", - "AU", - "AW", - "AX", - "AZ", - "BA", - "BB", - "BD", - "BE", - "BF", - "BG", - "BH", - "BI", - "BJ", - "BL", - "BM", - "BN", - "BO", - "BQ", - "BR", - "BS", - "BT", - "BV", - "BW", - "BY", - "BZ", - "CA", - "CD", - "CF", - "CG", - "CH", - "CI", - "CK", - "CL", - "CM", - "CN", - "CO", - "CR", - "CV", - "CW", - "CY", - "CZ", - "DE", - "DJ", - "DK", - "DM", - "DO", - "DZ", - "EC", - "EE", - "EG", - "EH", - "ER", - "ES", - "ET", - "FI", - "FJ", - "FK", - "FO", - "FR", - "GA", - "GB", - "GD", - "GE", - "GF", - "GG", - "GH", - "GI", - "GL", - "GM", - "GN", - "GP", - "GQ", - "GR", - "GS", - "GT", - "GU", - "GW", - "GY", - "HK", - "HN", - "HR", - "HT", - "HU", - "ID", - "IE", - "IL", - "IM", - "IN", - "IO", - "IQ", - "IS", - "IT", - "JE", - "JM", - "JO", - "JP", - "KE", - "KG", - "KH", - "KI", - "KM", - "KN", - "KR", - "KW", - "KY", - "KZ", - "LA", - "LB", - "LC", - "LI", - "LK", - "LR", - "LS", - "LT", - "LU", - "LV", - "LY", - "MA", - "MC", - "MD", - "ME", - "MF", - "MG", - "MK", - "ML", - "MM", - "MN", - "MO", - "MQ", - "MR", - "MS", - "MT", - "MU", - "MV", - "MW", - "MX", - "MY", - "MZ", - "NA", - "NC", - "NE", - "NG", - "NI", - "NL", - "NO", - "NP", - "NR", - "NU", - "NZ", - "OM", - "PA", - "PE", - "PF", - "PG", - "PH", - "PK", - "PL", - "PM", - "PN", - "PR", - "PS", - "PT", - "PY", - "QA", - "RE", - "RO", - "RS", - "RU", - "RW", - "SA", - "SB", - "SC", - "SE", - "SG", - "SH", - "SI", - "SJ", - "SK", - "SL", - "SM", - "SN", - "SO", - "SR", - "SS", - "ST", - "SV", - "SX", - "SZ", - "TA", - "TC", - "TD", - "TF", - "TG", - "TH", - "TJ", - "TK", - "TL", - "TM", - "TN", - "TO", - "TR", - "TT", - "TV", - "TW", - "TZ", - "UA", - "UG", - "US", - "UY", - "UZ", - "VA", - "VC", - "VE", - "VG", - "VN", - "VU", - "WF", - "WS", - "XK", - "YE", - "YT", - "ZA", - "ZM", - "ZW", - "ZZ" - ], - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "allowed_countries" - ], - "title": "shipping_address_collection_params", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Configuration for collecting the customer's shipping address." - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/payment_link" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/payment_links/{payment_link}/line_items": { - "get": { - "description": "When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
", - "operationId": "GetPaymentLinksPaymentLinkLineItems", - "parameters": [ - { - "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" - }, - { - "in": "path", - "name": "payment_link", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/item" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "PaymentLinksResourceListLineItems", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/payment_methods": { - "get": { - "description": "Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the List a Customer’s PaymentMethods API instead.
", - "operationId": "GetPaymentMethods", - "parameters": [ - { - "description": "The ID of the customer whose PaymentMethods will be retrieved.", - "in": "query", - "name": "customer", - "required": false, - "schema": { - "maxLength": 5000, - "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": { - "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": "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": { - "type": "string" - }, - "style": "form" - }, - { - "description": "An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request.", - "in": "query", - "name": "type", - "required": false, - "schema": { - "enum": [ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "blik", - "boleto", - "card", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "klarna", - "konbini", - "link", - "oxxo", - "p24", - "paynow", - "pix", - "promptpay", - "sepa_debit", - "sofort", - "us_bank_account", - "wechat_pay" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "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/payment_method" - }, - "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/payment_methods", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "PaymentFlowsPaymentMethodList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a PaymentMethod object. Read the Stripe.js reference to learn how to create PaymentMethods via Stripe.js.
\n\nInstead of creating a PaymentMethod directly, we recommend using the PaymentIntents API to accept a payment immediately or the SetupIntent API to collect payment method details ahead of a future payment.
", - "operationId": "PostPaymentMethods", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "acss_debit": { - "explode": true, - "style": "deepObject" - }, - "affirm": { - "explode": true, - "style": "deepObject" - }, - "afterpay_clearpay": { - "explode": true, - "style": "deepObject" - }, - "alipay": { - "explode": true, - "style": "deepObject" - }, - "au_becs_debit": { - "explode": true, - "style": "deepObject" - }, - "bacs_debit": { - "explode": true, - "style": "deepObject" - }, - "bancontact": { - "explode": true, - "style": "deepObject" - }, - "billing_details": { - "explode": true, - "style": "deepObject" - }, - "blik": { - "explode": true, - "style": "deepObject" - }, - "boleto": { - "explode": true, - "style": "deepObject" - }, - "card": { - "explode": true, - "style": "deepObject" - }, - "customer_balance": { - "explode": true, - "style": "deepObject" - }, - "eps": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "fpx": { - "explode": true, - "style": "deepObject" - }, - "giropay": { - "explode": true, - "style": "deepObject" - }, - "grabpay": { - "explode": true, - "style": "deepObject" - }, - "ideal": { - "explode": true, - "style": "deepObject" - }, - "interac_present": { - "explode": true, - "style": "deepObject" - }, - "klarna": { - "explode": true, - "style": "deepObject" - }, - "konbini": { - "explode": true, - "style": "deepObject" - }, - "link": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "oxxo": { - "explode": true, - "style": "deepObject" - }, - "p24": { - "explode": true, - "style": "deepObject" - }, - "paynow": { - "explode": true, - "style": "deepObject" - }, - "pix": { - "explode": true, - "style": "deepObject" - }, - "promptpay": { - "explode": true, - "style": "deepObject" - }, - "radar_options": { - "explode": true, - "style": "deepObject" - }, - "sepa_debit": { - "explode": true, - "style": "deepObject" - }, - "sofort": { - "explode": true, - "style": "deepObject" - }, - "us_bank_account": { - "explode": true, - "style": "deepObject" - }, - "wechat_pay": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "acss_debit": { - "description": "If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.", - "properties": { - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "institution_number": { - "maxLength": 5000, - "type": "string" - }, - "transit_number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "account_number", - "institution_number", - "transit_number" - ], - "title": "payment_method_param", - "type": "object" - }, - "affirm": { - "description": "If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.", - "properties": { - }, - "title": "param", - "type": "object" - }, - "afterpay_clearpay": { - "description": "If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.", - "properties": { - }, - "title": "param", - "type": "object" - }, - "alipay": { - "description": "If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.", - "properties": { - }, - "title": "param", - "type": "object" - }, - "au_becs_debit": { - "description": "If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.", - "properties": { - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "bsb_number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "account_number", - "bsb_number" - ], - "title": "param", - "type": "object" - }, - "bacs_debit": { - "description": "If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.", - "properties": { - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "sort_code": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "param", - "type": "object" - }, - "bancontact": { - "description": "If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.", - "properties": { - }, - "title": "param", - "type": "object" - }, - "billing_details": { - "description": "Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.", - "properties": { - "address": { - "anyOf": [ - { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "billing_details_address", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "email": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "billing_details_inner_params", - "type": "object" - }, - "blik": { - "description": "If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.", - "properties": { - }, - "title": "param", - "type": "object" - }, - "boleto": { - "description": "If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.", - "properties": { - "tax_id": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "tax_id" - ], - "title": "param", - "type": "object" - }, - "card": { - "anyOf": [ - { - "properties": { - "cvc": { - "maxLength": 5000, - "type": "string" - }, - "exp_month": { - "type": "integer" - }, - "exp_year": { - "type": "integer" - }, - "number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "exp_month", - "exp_year", - "number" - ], - "title": "card_details_params", - "type": "object" - }, - { - "properties": { - "token": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "token" - ], - "title": "token_params", - "type": "object" - } - ], - "description": "If this is a `card` PaymentMethod, this hash contains the user's card details. For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: \"tok_visa\"}`. When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). We strongly recommend using Stripe.js instead of interacting with this API directly.", - "x-stripeBypassValidation": true - }, - "customer": { - "description": "The `Customer` to whom the original PaymentMethod is attached.", - "maxLength": 5000, - "type": "string" - }, - "customer_balance": { - "description": "If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.", - "properties": { - }, - "title": "param", - "type": "object" - }, - "eps": { - "description": "If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.", - "properties": { - "bank": { - "enum": [ - "arzte_und_apotheker_bank", - "austrian_anadi_bank_ag", - "bank_austria", - "bankhaus_carl_spangler", - "bankhaus_schelhammer_und_schattera_ag", - "bawag_psk_ag", - "bks_bank_ag", - "brull_kallmus_bank_ag", - "btv_vier_lander_bank", - "capital_bank_grawe_gruppe_ag", - "deutsche_bank_ag", - "dolomitenbank", - "easybank_ag", - "erste_bank_und_sparkassen", - "hypo_alpeadriabank_international_ag", - "hypo_bank_burgenland_aktiengesellschaft", - "hypo_noe_lb_fur_niederosterreich_u_wien", - "hypo_oberosterreich_salzburg_steiermark", - "hypo_tirol_bank_ag", - "hypo_vorarlberg_bank_ag", - "marchfelder_bank", - "oberbank_ag", - "raiffeisen_bankengruppe_osterreich", - "schoellerbank_ag", - "sparda_bank_wien", - "volksbank_gruppe", - "volkskreditbank_ag", - "vr_bank_braunau" - ], - "maxLength": 5000, - "type": "string" - } - }, - "title": "param", - "type": "object" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "fpx": { - "description": "If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.", - "properties": { - "bank": { - "enum": [ - "affin_bank", - "agrobank", - "alliance_bank", - "ambank", - "bank_islam", - "bank_muamalat", - "bank_of_china", - "bank_rakyat", - "bsn", - "cimb", - "deutsche_bank", - "hong_leong_bank", - "hsbc", - "kfh", - "maybank2e", - "maybank2u", - "ocbc", - "pb_enterprise", - "public_bank", - "rhb", - "standard_chartered", - "uob" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - } - }, - "required": [ - "bank" - ], - "title": "param", - "type": "object" - }, - "giropay": { - "description": "If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.", - "properties": { - }, - "title": "param", - "type": "object" - }, - "grabpay": { - "description": "If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.", - "properties": { - }, - "title": "param", - "type": "object" - }, - "ideal": { - "description": "If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.", - "properties": { - "bank": { - "enum": [ - "abn_amro", - "asn_bank", - "bunq", - "handelsbanken", - "ing", - "knab", - "moneyou", - "rabobank", - "regiobank", - "revolut", - "sns_bank", - "triodos_bank", - "van_lanschot" - ], - "maxLength": 5000, - "type": "string" - } - }, - "title": "param", - "type": "object" - }, - "interac_present": { - "description": "If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.", - "properties": { - }, - "title": "param", - "type": "object" - }, - "klarna": { - "description": "If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.", - "properties": { - "dob": { - "properties": { - "day": { - "type": "integer" - }, - "month": { - "type": "integer" - }, - "year": { - "type": "integer" - } - }, - "required": [ - "day", - "month", - "year" - ], - "title": "date_of_birth", - "type": "object" - } - }, - "title": "param", - "type": "object" - }, - "konbini": { - "description": "If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.", - "properties": { - }, - "title": "param", - "type": "object" - }, - "link": { - "description": "If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.", - "properties": { - }, - "title": "param", - "type": "object" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "oxxo": { - "description": "If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.", - "properties": { - }, - "title": "param", - "type": "object" - }, - "p24": { - "description": "If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.", - "properties": { - "bank": { - "enum": [ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "volkswagen_bank" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "param", - "type": "object" - }, - "payment_method": { - "description": "The PaymentMethod to share.", - "maxLength": 5000, - "type": "string" - }, - "paynow": { - "description": "If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.", - "properties": { - }, - "title": "param", - "type": "object" - }, - "pix": { - "description": "If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.", - "properties": { - }, - "title": "param", - "type": "object" - }, - "promptpay": { - "description": "If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.", - "properties": { - }, - "title": "param", - "type": "object" - }, - "radar_options": { - "description": "Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.", - "properties": { - "session": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "radar_options", - "type": "object" - }, - "sepa_debit": { - "description": "If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.", - "properties": { - "iban": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "iban" - ], - "title": "param", - "type": "object" - }, - "sofort": { - "description": "If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.", - "properties": { - "country": { - "enum": [ - "AT", - "BE", - "DE", - "ES", - "IT", - "NL" - ], - "type": "string" - } - }, - "required": [ - "country" - ], - "title": "param", - "type": "object" - }, - "type": { - "description": "The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.", - "enum": [ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "blik", - "boleto", - "card", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "klarna", - "konbini", - "link", - "oxxo", - "p24", - "paynow", - "pix", - "promptpay", - "sepa_debit", - "sofort", - "us_bank_account", - "wechat_pay" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "us_bank_account": { - "description": "If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.", - "properties": { - "account_holder_type": { - "enum": [ - "company", - "individual" - ], - "type": "string" - }, - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "account_type": { - "enum": [ - "checking", - "savings" - ], - "type": "string" - }, - "financial_connections_account": { - "maxLength": 5000, - "type": "string" - }, - "routing_number": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "payment_method_param", - "type": "object" - }, - "wechat_pay": { - "description": "If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.", - "properties": { - }, - "title": "param", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/payment_method" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/payment_methods/{payment_method}": { - "get": { - "description": "Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use Retrieve a Customer’s PaymentMethods
", - "operationId": "GetPaymentMethodsPaymentMethod", - "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": "payment_method", - "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/payment_method" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.
", - "operationId": "PostPaymentMethodsPaymentMethod", - "parameters": [ - { - "in": "path", - "name": "payment_method", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "billing_details": { - "explode": true, - "style": "deepObject" - }, - "card": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "link": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "us_bank_account": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "billing_details": { - "description": "Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.", - "properties": { - "address": { - "anyOf": [ - { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "billing_details_address", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "email": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "billing_details_inner_params", - "type": "object" - }, - "card": { - "description": "If this is a `card` PaymentMethod, this hash contains the user's card details.", - "properties": { - "exp_month": { - "type": "integer" - }, - "exp_year": { - "type": "integer" - } - }, - "title": "update_api_param", - "type": "object" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "link": { - "description": "If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.", - "properties": { - }, - "title": "param", - "type": "object" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "us_bank_account": { - "description": "If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.", - "properties": { - "account_holder_type": { - "enum": [ - "company", - "individual" - ], - "type": "string" - } - }, - "title": "update_param", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/payment_method" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/payment_methods/{payment_method}/attach": { - "post": { - "description": "Attaches a PaymentMethod object to a Customer.
\n\nTo attach a new PaymentMethod to a customer for future payments, we recommend you use a SetupIntent\nor a PaymentIntent with setup_future_usage.\nThese approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach
\nendpoint without first using a SetupIntent or PaymentIntent with setup_future_usage
does not optimize the PaymentMethod for\nfuture use, which makes later declines and payment friction more likely.\nSee Optimizing cards for future payments for more information about setting up\nfuture payments.
To use this PaymentMethod as the default for invoice or subscription payments,\nset invoice_settings.default_payment_method
,\non the Customer to the PaymentMethod’s ID.
Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.
", - "operationId": "PostPaymentMethodsPaymentMethodDetach", - "parameters": [ - { - "in": "path", - "name": "payment_method", - "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/payment_method" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/payouts": { - "get": { - "description": "Returns a list of existing payouts sent to third-party bank accounts or that Stripe has sent you. The payouts are returned in sorted order, with the most recently created payouts appearing first.
", - "operationId": "GetPayouts", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "arrival_date", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "The ID of an external account - only return payouts sent to this external account.", - "in": "query", - "name": "destination", - "required": false, - "schema": { - "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": "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" - }, - { - "description": "Only return payouts that have the given status: `pending`, `paid`, `failed`, or `canceled`.", - "in": "query", - "name": "status", - "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/payout" - }, - "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/payouts", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "PayoutList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "To send funds to your own bank account, you create a new payout object. Your Stripe balance must be able to cover the payout amount, or you’ll receive an “Insufficient Funds” error.
\n\nIf your API key is in test mode, money won’t actually be sent, though everything else will occur as if in live mode.
\n\nIf you are creating a manual payout on a Stripe account that uses multiple payment source types, you’ll need to specify the source type balance that the payout should draw from. The balance object details available and pending amounts by source type.
", - "operationId": "PostPayouts", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "A positive integer in cents representing how much to payout.", - "type": "integer" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "description": { - "description": "An arbitrary string attached to the object. Often useful for displaying to users.", - "maxLength": 5000, - "type": "string" - }, - "destination": { - "description": "The ID of a bank account or a card to send the payout to. If no destination is supplied, the default external account for the specified currency will be used.", - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "method": { - "description": "The method used to send this payout, which can be `standard` or `instant`. `instant` is only supported for payouts to debit cards. (See [Instant payouts for marketplaces for more information](https://stripe.com/blog/instant-payouts-for-marketplaces).)", - "enum": [ - "instant", - "standard" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "source_type": { - "description": "The balance type of your Stripe balance to draw this payout from. Balances for different payment sources are kept separately. You can find the amounts with the balances API. One of `bank_account`, `card`, or `fpx`.", - "enum": [ - "bank_account", - "card", - "fpx" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "statement_descriptor": { - "description": "A string to be displayed on the recipient's bank or card statement. This may be at most 22 characters. Attempting to use a `statement_descriptor` longer than 22 characters will return an error. Note: Most banks will truncate this information and/or display it inconsistently. Some may not display it at all.", - "maxLength": 22, - "type": "string", - "x-stripeBypassValidation": true - } - }, - "required": [ - "amount", - "currency" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/payout" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/payouts/{payout}": { - "get": { - "description": "Retrieves the details of an existing payout. Supply the unique payout ID from either a payout creation request or the payout list, and Stripe will return the corresponding payout information.
", - "operationId": "GetPayoutsPayout", - "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": "payout", - "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/payout" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the specified payout by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts only the metadata as arguments.
", - "operationId": "PostPayoutsPayout", - "parameters": [ - { - "in": "path", - "name": "payout", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "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" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/payout" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/payouts/{payout}/cancel": { - "post": { - "description": "A previously created payout can be canceled if it has not yet been paid out. Funds will be refunded to your available balance. You may not cancel automatic Stripe payouts.
", - "operationId": "PostPayoutsPayoutCancel", - "parameters": [ - { - "in": "path", - "name": "payout", - "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/payout" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/payouts/{payout}/reverse": { - "post": { - "description": "Reverses a payout by debiting the destination bank account. Only payouts for connected accounts to US bank accounts may be reversed at this time. If the payout is in the pending
status, /v1/payouts/:id/cancel
should be used instead.
By requesting a reversal via /v1/payouts/:id/reverse
, you confirm that the authorized signatory of the selected bank account has authorized the debit on the bank account and that no other authorization is required.
Returns a list of your plans.
", - "operationId": "GetPlans", - "parameters": [ - { - "description": "Only return plans that are active or inactive (e.g., pass `false` to list all inactive plans).", - "in": "query", - "name": "active", - "required": false, - "schema": { - "type": "boolean" - }, - "style": "form" - }, - { - "description": "A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.", - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": "Only return plans for the given product.", - "in": "query", - "name": "product", - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/plan" - }, - "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/plans", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "PlanList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.
", - "operationId": "PostPlans", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "product": { - "explode": true, - "style": "deepObject" - }, - "tiers": { - "explode": true, - "style": "deepObject" - }, - "transform_usage": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "active": { - "description": "Whether the plan is currently available for new subscriptions. Defaults to `true`.", - "type": "boolean" - }, - "aggregate_usage": { - "description": "Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`.", - "enum": [ - "last_during_period", - "last_ever", - "max", - "sum" - ], - "type": "string" - }, - "amount": { - "description": "A positive integer in cents (or local equivalent) (or 0 for a free plan) representing how much to charge on a recurring basis.", - "type": "integer" - }, - "amount_decimal": { - "description": "Same as `amount`, but accepts a decimal value with at most 12 decimal places. Only one of `amount` and `amount_decimal` can be set.", - "format": "decimal", - "type": "string" - }, - "billing_scheme": { - "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.", - "enum": [ - "per_unit", - "tiered" - ], - "type": "string" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "id": { - "description": "An identifier randomly generated by Stripe. Used to identify this plan when subscribing a customer. You can optionally override this ID, but the ID must be unique across all plans in your Stripe account. You can, however, use the same plan ID in both live and test modes.", - "maxLength": 5000, - "type": "string" - }, - "interval": { - "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).", - "type": "integer" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "nickname": { - "description": "A brief description of the plan, hidden from customers.", - "maxLength": 5000, - "type": "string" - }, - "product": { - "anyOf": [ - { - "description": "The product whose pricing the created plan will represent. This can either be the ID of an existing product, or a dictionary containing fields used to create a [service product](https://stripe.com/docs/api#product_object-type).", - "properties": { - "active": { - "type": "boolean" - }, - "id": { - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "statement_descriptor": { - "maxLength": 22, - "type": "string" - }, - "tax_code": { - "maxLength": 5000, - "type": "string" - }, - "unit_label": { - "maxLength": 12, - "type": "string" - } - }, - "required": [ - "name" - ], - "title": "inline_product_params", - "type": "object" - }, - { - "description": "The ID of the product whose pricing the created plan will represent.", - "maxLength": 5000, - "type": "string" - } - ] - }, - "tiers": { - "description": "Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`.", - "items": { - "properties": { - "flat_amount": { - "type": "integer" - }, - "flat_amount_decimal": { - "format": "decimal", - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - }, - "up_to": { - "anyOf": [ - { - "enum": [ - "inf" - ], - "maxLength": 5000, - "type": "string" - }, - { - "type": "integer" - } - ] - } - }, - "required": [ - "up_to" - ], - "title": "tier", - "type": "object" - }, - "type": "array" - }, - "tiers_mode": { - "description": "Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows.", - "enum": [ - "graduated", - "volume" - ], - "type": "string" - }, - "transform_usage": { - "description": "Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`.", - "properties": { - "divide_by": { - "type": "integer" - }, - "round": { - "enum": [ - "down", - "up" - ], - "type": "string" - } - }, - "required": [ - "divide_by", - "round" - ], - "title": "transform_usage_param", - "type": "object" - }, - "trial_period_days": { - "description": "Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan).", - "type": "integer" - }, - "usage_type": { - "description": "Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`.", - "enum": [ - "licensed", - "metered" - ], - "type": "string" - } - }, - "required": [ - "currency", - "interval" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/plan" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/plans/{plan}": { - "delete": { - "description": "Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected.
", - "operationId": "DeletePlansPlan", - "parameters": [ - { - "in": "path", - "name": "plan", - "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/deleted_plan" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "Retrieves the plan with the given ID.
", - "operationId": "GetPlansPlan", - "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": "plan", - "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/plan" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan’s ID, amount, currency, or billing cycle.
", - "operationId": "PostPlansPlan", - "parameters": [ - { - "in": "path", - "name": "plan", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "active": { - "description": "Whether the plan is currently available for new subscriptions.", - "type": "boolean" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "nickname": { - "description": "A brief description of the plan, hidden from customers.", - "maxLength": 5000, - "type": "string" - }, - "product": { - "description": "The product the plan belongs to. This cannot be changed once it has been used in a subscription or subscription schedule.", - "maxLength": 5000, - "type": "string" - }, - "trial_period_days": { - "description": "Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan).", - "type": "integer" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/plan" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/prices": { - "get": { - "description": "Returns a list of your prices.
", - "operationId": "GetPrices", - "parameters": [ - { - "description": "Only return prices that are active or inactive (e.g., pass `false` to list all inactive prices).", - "in": "query", - "name": "active", - "required": false, - "schema": { - "type": "boolean" - }, - "style": "form" - }, - { - "description": "A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.", - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "Only return prices for the given currency.", - "in": "query", - "name": "currency", - "required": false, - "schema": { - "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": "Only return the price with these lookup_keys, if any exist.", - "explode": true, - "in": "query", - "name": "lookup_keys", - "required": false, - "schema": { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "style": "deepObject" - }, - { - "description": "Only return prices for the given product.", - "in": "query", - "name": "product", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "Only return prices with these recurring fields.", - "explode": true, - "in": "query", - "name": "recurring", - "required": false, - "schema": { - "properties": { - "interval": { - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "usage_type": { - "enum": [ - "licensed", - "metered" - ], - "type": "string" - } - }, - "title": "all_prices_recurring_params", - "type": "object" - }, - "style": "deepObject" - }, - { - "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" - }, - { - "description": "Only return prices of type `recurring` or `one_time`.", - "in": "query", - "name": "type", - "required": false, - "schema": { - "enum": [ - "one_time", - "recurring" - ], - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/price" - }, - "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/prices", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "PriceList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a new price for an existing product. The price can be recurring or one-time.
", - "operationId": "PostPrices", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "currency_options": { - "explode": true, - "style": "deepObject" - }, - "custom_unit_amount": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "product_data": { - "explode": true, - "style": "deepObject" - }, - "recurring": { - "explode": true, - "style": "deepObject" - }, - "tiers": { - "explode": true, - "style": "deepObject" - }, - "transform_quantity": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "active": { - "description": "Whether the price can be used for new purchases. Defaults to `true`.", - "type": "boolean" - }, - "billing_scheme": { - "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.", - "enum": [ - "per_unit", - "tiered" - ], - "type": "string" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "currency_options": { - "additionalProperties": { - "properties": { - "custom_unit_amount": { - "properties": { - "enabled": { - "type": "boolean" - }, - "maximum": { - "type": "integer" - }, - "minimum": { - "type": "integer" - }, - "preset": { - "type": "integer" - } - }, - "required": [ - "enabled" - ], - "title": "custom_unit_amount", - "type": "object" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "tiers": { - "items": { - "properties": { - "flat_amount": { - "type": "integer" - }, - "flat_amount_decimal": { - "format": "decimal", - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - }, - "up_to": { - "anyOf": [ - { - "enum": [ - "inf" - ], - "maxLength": 5000, - "type": "string" - }, - { - "type": "integer" - } - ] - } - }, - "required": [ - "up_to" - ], - "title": "tier", - "type": "object" - }, - "type": "array" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "title": "currency_option", - "type": "object" - }, - "description": "Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).", - "type": "object" - }, - "custom_unit_amount": { - "description": "When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.", - "properties": { - "enabled": { - "type": "boolean" - }, - "maximum": { - "type": "integer" - }, - "minimum": { - "type": "integer" - }, - "preset": { - "type": "integer" - } - }, - "required": [ - "enabled" - ], - "title": "custom_unit_amount", - "type": "object" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "lookup_key": { - "description": "A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters.", - "maxLength": 200, - "type": "string" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "nickname": { - "description": "A brief description of the price, hidden from customers.", - "maxLength": 5000, - "type": "string" - }, - "product": { - "description": "The ID of the product that this price will belong to.", - "maxLength": 5000, - "type": "string" - }, - "product_data": { - "description": "These fields can be used to create a new product that this price will belong to.", - "properties": { - "active": { - "type": "boolean" - }, - "id": { - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "statement_descriptor": { - "maxLength": 22, - "type": "string" - }, - "tax_code": { - "maxLength": 5000, - "type": "string" - }, - "unit_label": { - "maxLength": 12, - "type": "string" - } - }, - "required": [ - "name" - ], - "title": "inline_product_params", - "type": "object" - }, - "recurring": { - "description": "The recurring components of a price such as `interval` and `usage_type`.", - "properties": { - "aggregate_usage": { - "enum": [ - "last_during_period", - "last_ever", - "max", - "sum" - ], - "type": "string" - }, - "interval": { - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - }, - "usage_type": { - "enum": [ - "licensed", - "metered" - ], - "type": "string" - } - }, - "required": [ - "interval" - ], - "title": "recurring", - "type": "object" - }, - "tax_behavior": { - "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "tiers": { - "description": "Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`.", - "items": { - "properties": { - "flat_amount": { - "type": "integer" - }, - "flat_amount_decimal": { - "format": "decimal", - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - }, - "up_to": { - "anyOf": [ - { - "enum": [ - "inf" - ], - "maxLength": 5000, - "type": "string" - }, - { - "type": "integer" - } - ] - } - }, - "required": [ - "up_to" - ], - "title": "tier", - "type": "object" - }, - "type": "array" - }, - "tiers_mode": { - "description": "Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows.", - "enum": [ - "graduated", - "volume" - ], - "type": "string" - }, - "transfer_lookup_key": { - "description": "If set to true, will atomically remove the lookup key from the existing price, and assign it to this price.", - "type": "boolean" - }, - "transform_quantity": { - "description": "Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`.", - "properties": { - "divide_by": { - "type": "integer" - }, - "round": { - "enum": [ - "down", - "up" - ], - "type": "string" - } - }, - "required": [ - "divide_by", - "round" - ], - "title": "transform_usage_param", - "type": "object" - }, - "unit_amount": { - "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `custom_unit_amount` is required, unless `billing_scheme=tiered`.", - "type": "integer" - }, - "unit_amount_decimal": { - "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/price" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/prices/search": { - "get": { - "description": "Search for prices you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
", - "operationId": "GetPricesSearch", - "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" - }, - { - "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": "A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.", - "in": "query", - "name": "page", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for prices](https://stripe.com/docs/search#query-fields-for-prices).", - "in": "query", - "name": "query", - "required": true, - "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/price" - }, - "type": "array" - }, - "has_more": { - "type": "boolean" - }, - "next_page": { - "maxLength": 5000, - "nullable": true, - "type": "string" - }, - "object": { - "description": "String representing the object's type. Objects of the same type share the same value.", - "enum": [ - "search_result" - ], - "type": "string" - }, - "total_count": { - "description": "The total number of objects that match the query, only accurate up to 10,000.", - "type": "integer" - }, - "url": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "SearchResult", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/prices/{price}": { - "get": { - "description": "Retrieves the price with the given ID.
", - "operationId": "GetPricesPrice", - "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": "price", - "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/price" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged.
", - "operationId": "PostPricesPrice", - "parameters": [ - { - "in": "path", - "name": "price", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "currency_options": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "active": { - "description": "Whether the price can be used for new purchases. Defaults to `true`.", - "type": "boolean" - }, - "currency_options": { - "anyOf": [ - { - "additionalProperties": { - "properties": { - "custom_unit_amount": { - "properties": { - "enabled": { - "type": "boolean" - }, - "maximum": { - "type": "integer" - }, - "minimum": { - "type": "integer" - }, - "preset": { - "type": "integer" - } - }, - "required": [ - "enabled" - ], - "title": "custom_unit_amount", - "type": "object" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "tiers": { - "items": { - "properties": { - "flat_amount": { - "type": "integer" - }, - "flat_amount_decimal": { - "format": "decimal", - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - }, - "up_to": { - "anyOf": [ - { - "enum": [ - "inf" - ], - "maxLength": 5000, - "type": "string" - }, - { - "type": "integer" - } - ] - } - }, - "required": [ - "up_to" - ], - "title": "tier", - "type": "object" - }, - "type": "array" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "title": "currency_option", - "type": "object" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies)." - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "lookup_key": { - "description": "A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters.", - "maxLength": 200, - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "nickname": { - "description": "A brief description of the price, hidden from customers.", - "maxLength": 5000, - "type": "string" - }, - "tax_behavior": { - "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "transfer_lookup_key": { - "description": "If set to true, will atomically remove the lookup key from the existing price, and assign it to this price.", - "type": "boolean" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/price" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/products": { - "get": { - "description": "Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.
", - "operationId": "GetProducts", - "parameters": [ - { - "description": "Only return products that are active or inactive (e.g., pass `false` to list all inactive products).", - "in": "query", - "name": "active", - "required": false, - "schema": { - "type": "boolean" - }, - "style": "form" - }, - { - "description": "Only return products that were created during the given date interval.", - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": "Only return products with the given IDs. Cannot be used with [starting_after](https://stripe.com/docs/api#list_products-starting_after) or [ending_before](https://stripe.com/docs/api#list_products-ending_before).", - "explode": true, - "in": "query", - "name": "ids", - "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": "Only return products that can be shipped (i.e., physical, not digital products).", - "in": "query", - "name": "shippable", - "required": false, - "schema": { - "type": "boolean" - }, - "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" - }, - { - "description": "Only return products with the given url.", - "in": "query", - "name": "url", - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/product" - }, - "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/products", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "ProductList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a new product object.
", - "operationId": "PostProducts", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "default_price_data": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "images": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "package_dimensions": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "active": { - "description": "Whether the product is currently available for purchase. Defaults to `true`.", - "type": "boolean" - }, - "default_price_data": { - "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object. This Price will be set as the default price for this product.", - "properties": { - "currency": { - "type": "string" - }, - "currency_options": { - "additionalProperties": { - "properties": { - "custom_unit_amount": { - "properties": { - "enabled": { - "type": "boolean" - }, - "maximum": { - "type": "integer" - }, - "minimum": { - "type": "integer" - }, - "preset": { - "type": "integer" - } - }, - "required": [ - "enabled" - ], - "title": "custom_unit_amount", - "type": "object" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "tiers": { - "items": { - "properties": { - "flat_amount": { - "type": "integer" - }, - "flat_amount_decimal": { - "format": "decimal", - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - }, - "up_to": { - "anyOf": [ - { - "enum": [ - "inf" - ], - "maxLength": 5000, - "type": "string" - }, - { - "type": "integer" - } - ] - } - }, - "required": [ - "up_to" - ], - "title": "tier", - "type": "object" - }, - "type": "array" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "title": "currency_option", - "type": "object" - }, - "type": "object" - }, - "recurring": { - "properties": { - "interval": { - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - } - }, - "required": [ - "interval" - ], - "title": "recurring_adhoc", - "type": "object" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency" - ], - "title": "price_data_without_product", - "type": "object" - }, - "description": { - "description": "The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.", - "maxLength": 40000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "id": { - "description": "An identifier will be randomly generated by Stripe. You can optionally override this ID, but the ID must be unique across all products in your Stripe account.", - "maxLength": 5000, - "type": "string" - }, - "images": { - "description": "A list of up to 8 URLs of images for this product, meant to be displayable to the customer.", - "items": { - "type": "string" - }, - "type": "array" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "name": { - "description": "The product's name, meant to be displayable to the customer.", - "maxLength": 5000, - "type": "string" - }, - "package_dimensions": { - "description": "The dimensions of this product for shipping purposes.", - "properties": { - "height": { - "type": "number" - }, - "length": { - "type": "number" - }, - "weight": { - "type": "number" - }, - "width": { - "type": "number" - } - }, - "required": [ - "height", - "length", - "weight", - "width" - ], - "title": "package_dimensions_specs", - "type": "object" - }, - "shippable": { - "description": "Whether this product is shipped (i.e., physical goods).", - "type": "boolean" - }, - "statement_descriptor": { - "description": "An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all.\n\nThis may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `\"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped.\n It must contain at least one letter.", - "maxLength": 22, - "type": "string" - }, - "tax_code": { - "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID.", - "type": "string" - }, - "unit_label": { - "description": "A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal.", - "maxLength": 12, - "type": "string" - }, - "url": { - "description": "A URL of a publicly-accessible webpage for this product.", - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/product" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/products/search": { - "get": { - "description": "Search for products you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
", - "operationId": "GetProductsSearch", - "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" - }, - { - "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": "A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.", - "in": "query", - "name": "page", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for products](https://stripe.com/docs/search#query-fields-for-products).", - "in": "query", - "name": "query", - "required": true, - "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/product" - }, - "type": "array" - }, - "has_more": { - "type": "boolean" - }, - "next_page": { - "maxLength": 5000, - "nullable": true, - "type": "string" - }, - "object": { - "description": "String representing the object's type. Objects of the same type share the same value.", - "enum": [ - "search_result" - ], - "type": "string" - }, - "total_count": { - "description": "The total number of objects that match the query, only accurate up to 10,000.", - "type": "integer" - }, - "url": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "SearchResult", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/products/{id}": { - "delete": { - "description": "Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good
is only possible if it has no SKUs associated with it.
Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information.
", - "operationId": "GetProductsId", - "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/product" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
", - "operationId": "PostProductsId", - "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" - }, - "images": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "package_dimensions": { - "explode": true, - "style": "deepObject" - }, - "tax_code": { - "explode": true, - "style": "deepObject" - }, - "url": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "active": { - "description": "Whether the product is available for purchase.", - "type": "boolean" - }, - "default_price": { - "description": "The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product.", - "maxLength": 5000, - "type": "string" - }, - "description": { - "description": "The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.", - "maxLength": 40000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "images": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "A list of up to 8 URLs of images for this product, meant to be displayable to the customer." - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "name": { - "description": "The product's name, meant to be displayable to the customer.", - "maxLength": 5000, - "type": "string" - }, - "package_dimensions": { - "anyOf": [ - { - "properties": { - "height": { - "type": "number" - }, - "length": { - "type": "number" - }, - "weight": { - "type": "number" - }, - "width": { - "type": "number" - } - }, - "required": [ - "height", - "length", - "weight", - "width" - ], - "title": "package_dimensions_specs", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The dimensions of this product for shipping purposes." - }, - "shippable": { - "description": "Whether this product is shipped (i.e., physical goods).", - "type": "boolean" - }, - "statement_descriptor": { - "description": "An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all.\n\nThis may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `\"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped.\n It must contain at least one letter. May only be set if `type=service`.", - "maxLength": 22, - "type": "string" - }, - "tax_code": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID." - }, - "unit_label": { - "description": "A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. May only be set if `type=service`.", - "maxLength": 12, - "type": "string" - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "A URL of a publicly-accessible webpage for this product." - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/product" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/promotion_codes": { - "get": { - "description": "Returns a list of your promotion codes.
", - "operationId": "GetPromotionCodes", - "parameters": [ - { - "description": "Filter promotion codes by whether they are active.", - "in": "query", - "name": "active", - "required": false, - "schema": { - "type": "boolean" - }, - "style": "form" - }, - { - "description": "Only return promotion codes that have this case-insensitive code.", - "in": "query", - "name": "code", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "Only return promotion codes for this coupon.", - "in": "query", - "name": "coupon", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.", - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "Only return promotion codes that are restricted to this customer.", - "in": "query", - "name": "customer", - "required": false, - "schema": { - "maxLength": 5000, - "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": "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/promotion_code" - }, - "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/promotion_codes", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "PromotionCodesResourcePromotionCodeList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date.
", - "operationId": "PostPromotionCodes", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "restrictions": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "active": { - "description": "Whether the promotion code is currently active.", - "type": "boolean" - }, - "code": { - "description": "The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. If left blank, we will generate one automatically.", - "maxLength": 500, - "type": "string" - }, - "coupon": { - "description": "The coupon for this promotion code.", - "maxLength": 5000, - "type": "string" - }, - "customer": { - "description": "The customer that this promotion code can be used by. If not set, the promotion code can be used by all customers.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "expires_at": { - "description": "The timestamp at which this promotion code will expire. If the coupon has specified a `redeems_by`, then this value cannot be after the coupon's `redeems_by`.", - "format": "unix-time", - "type": "integer" - }, - "max_redemptions": { - "description": "A positive integer specifying the number of times the promotion code can be redeemed. If the coupon has specified a `max_redemptions`, then this value cannot be greater than the coupon's `max_redemptions`.", - "type": "integer" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "restrictions": { - "description": "Settings that restrict the redemption of the promotion code.", - "properties": { - "currency_options": { - "additionalProperties": { - "properties": { - "minimum_amount": { - "type": "integer" - } - }, - "title": "currency_option", - "type": "object" - }, - "type": "object" - }, - "first_time_transaction": { - "type": "boolean" - }, - "minimum_amount": { - "type": "integer" - }, - "minimum_amount_currency": { - "type": "string" - } - }, - "title": "restrictions_params", - "type": "object" - } - }, - "required": [ - "coupon" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/promotion_code" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/promotion_codes/{promotion_code}": { - "get": { - "description": "Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code
use list with the desired code
.
Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable.
", - "operationId": "PostPromotionCodesPromotionCode", - "parameters": [ - { - "in": "path", - "name": "promotion_code", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "restrictions": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "active": { - "description": "Whether the promotion code is currently active. A promotion code can only be reactivated when the coupon is still valid and the promotion code is otherwise redeemable.", - "type": "boolean" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "restrictions": { - "description": "Settings that restrict the redemption of the promotion code.", - "properties": { - "currency_options": { - "additionalProperties": { - "properties": { - "minimum_amount": { - "type": "integer" - } - }, - "title": "currency_option", - "type": "object" - }, - "type": "object" - } - }, - "title": "restrictions_params", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/promotion_code" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/quotes": { - "get": { - "description": "Returns a list of your quotes.
", - "operationId": "GetQuotes", - "parameters": [ - { - "description": "The ID of the customer whose quotes will be retrieved.", - "in": "query", - "name": "customer", - "required": false, - "schema": { - "maxLength": 5000, - "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": "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" - }, - { - "description": "The status of the quote.", - "in": "query", - "name": "status", - "required": false, - "schema": { - "enum": [ - "accepted", - "canceled", - "draft", - "open" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "style": "form" - }, - { - "description": "Provides a list of quotes that are associated with the specified test clock. The response will not include quotes with test clocks if this and the customer parameter is not set.", - "in": "query", - "name": "test_clock", - "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/quote" - }, - "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/quotes", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "QuotesResourceQuoteList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "A quote models prices and services for a customer. Default options for header
, description
, footer
, and expires_at
can be set in the dashboard via the quote template.
Retrieves the quote with the given ID.
", - "operationId": "GetQuotesQuote", - "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": "quote", - "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/quote" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "A quote models prices and services for a customer.
", - "operationId": "PostQuotesQuote", - "parameters": [ - { - "in": "path", - "name": "quote", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "application_fee_amount": { - "explode": true, - "style": "deepObject" - }, - "application_fee_percent": { - "explode": true, - "style": "deepObject" - }, - "automatic_tax": { - "explode": true, - "style": "deepObject" - }, - "default_tax_rates": { - "explode": true, - "style": "deepObject" - }, - "discounts": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "invoice_settings": { - "explode": true, - "style": "deepObject" - }, - "line_items": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "on_behalf_of": { - "explode": true, - "style": "deepObject" - }, - "subscription_data": { - "explode": true, - "style": "deepObject" - }, - "transfer_data": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "application_fee_amount": { - "anyOf": [ - { - "type": "integer" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field." - }, - "application_fee_percent": { - "anyOf": [ - { - "type": "number" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field." - }, - "automatic_tax": { - "description": "Settings for automatic tax lookup for this quote and resulting invoices and subscriptions.", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "automatic_tax_param", - "type": "object" - }, - "collection_method": { - "description": "Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`.", - "enum": [ - "charge_automatically", - "send_invoice" - ], - "type": "string" - }, - "customer": { - "description": "The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.", - "maxLength": 5000, - "type": "string" - }, - "default_tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The tax rates that will apply to any line item that does not have `tax_rates` set." - }, - "description": { - "description": "A description that will be displayed on the quote PDF.", - "maxLength": 500, - "type": "string" - }, - "discounts": { - "anyOf": [ - { - "items": { - "properties": { - "coupon": { - "maxLength": 5000, - "type": "string" - }, - "discount": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "discounts_data_param", - "type": "object" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The discounts applied to the quote. You can only set up to one discount." - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "expires_at": { - "description": "A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch.", - "format": "unix-time", - "type": "integer" - }, - "footer": { - "description": "A footer that will be displayed on the quote PDF.", - "maxLength": 500, - "type": "string" - }, - "header": { - "description": "A header that will be displayed on the quote PDF.", - "maxLength": 50, - "type": "string" - }, - "invoice_settings": { - "description": "All invoices will be billed using the specified settings.", - "properties": { - "days_until_due": { - "type": "integer" - } - }, - "title": "quote_param", - "type": "object" - }, - "line_items": { - "description": "A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.", - "items": { - "properties": { - "id": { - "maxLength": 5000, - "type": "string" - }, - "price": { - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "recurring": { - "properties": { - "interval": { - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - } - }, - "required": [ - "interval" - ], - "title": "recurring_adhoc", - "type": "object" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product" - ], - "title": "price_data", - "type": "object" - }, - "quantity": { - "type": "integer" - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "line_item_update_params", - "type": "object" - }, - "type": "array" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "on_behalf_of": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The account on behalf of which to charge." - }, - "subscription_data": { - "description": "When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created.", - "properties": { - "description": { - "maxLength": 500, - "type": "string" - }, - "effective_date": { - "anyOf": [ - { - "enum": [ - "current_period_end" - ], - "maxLength": 5000, - "type": "string" - }, - { - "format": "unix-time", - "type": "integer" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "trial_period_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "subscription_data_update_params", - "type": "object" - }, - "transfer_data": { - "anyOf": [ - { - "properties": { - "amount": { - "type": "integer" - }, - "amount_percent": { - "type": "number" - }, - "destination": { - "type": "string" - } - }, - "required": [ - "destination" - ], - "title": "transfer_data_specs", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The data with which to automatically create a Transfer for each of the invoices." - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/quote" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/quotes/{quote}/accept": { - "post": { - "description": "Accepts the specified quote.
", - "operationId": "PostQuotesQuoteAccept", - "parameters": [ - { - "in": "path", - "name": "quote", - "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/quote" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/quotes/{quote}/cancel": { - "post": { - "description": "Cancels the quote.
", - "operationId": "PostQuotesQuoteCancel", - "parameters": [ - { - "in": "path", - "name": "quote", - "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/quote" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/quotes/{quote}/computed_upfront_line_items": { - "get": { - "description": "When retrieving a quote, there is an includable computed.upfront.line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
", - "operationId": "GetQuotesQuoteComputedUpfrontLineItems", - "parameters": [ - { - "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" - }, - { - "in": "path", - "name": "quote", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/item" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "QuotesResourceListLineItems", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/quotes/{quote}/finalize": { - "post": { - "description": "Finalizes the quote.
", - "operationId": "PostQuotesQuoteFinalize", - "parameters": [ - { - "in": "path", - "name": "quote", - "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" - }, - "expires_at": { - "description": "A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch.", - "format": "unix-time", - "type": "integer" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/quote" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/quotes/{quote}/line_items": { - "get": { - "description": "When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
", - "operationId": "GetQuotesQuoteLineItems", - "parameters": [ - { - "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" - }, - { - "in": "path", - "name": "quote", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/item" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "QuotesResourceListLineItems", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/quotes/{quote}/pdf": { - "get": { - "description": "Download the PDF for a finalized quote
", - "operationId": "GetQuotesQuotePdf", - "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": "quote", - "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/pdf": { - "schema": { - "format": "binary", - "type": "string" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/radar/early_fraud_warnings": { - "get": { - "description": "Returns a list of early fraud warnings.
", - "operationId": "GetRadarEarlyFraudWarnings", - "parameters": [ - { - "description": "Only return early fraud warnings for the charge specified by this charge ID.", - "in": "query", - "name": "charge", - "required": false, - "schema": { - "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": "Only return early fraud warnings for charges that were created by the PaymentIntent specified by this PaymentIntent ID.", - "in": "query", - "name": "payment_intent", - "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/radar.early_fraud_warning" - }, - "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/radar/early_fraud_warnings", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "RadarEarlyFraudWarningList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/radar/early_fraud_warnings/{early_fraud_warning}": { - "get": { - "description": "Retrieves the details of an early fraud warning that has previously been created.
\n\nPlease refer to the early fraud warning object reference for more details.
", - "operationId": "GetRadarEarlyFraudWarningsEarlyFraudWarning", - "parameters": [ - { - "in": "path", - "name": "early_fraud_warning", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/radar.early_fraud_warning" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/radar/value_list_items": { - "get": { - "description": "Returns a list of ValueListItem
objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
Creates a new ValueListItem
object, which is added to the specified parent value list.
Deletes a ValueListItem
object, removing it from its parent value list.
Retrieves a ValueListItem
object.
Returns a list of ValueList
objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
Creates a new ValueList
object, which can then be referenced in rules.
Deletes a ValueList
object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules.
Retrieves a ValueList
object.
Updates a ValueList
object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type
is immutable.
Returns a list of all refunds you’ve previously created. The refunds are returned in sorted order, with the most recent refunds appearing first. For convenience, the 10 most recent refunds are always available by default on the charge object.
", - "operationId": "GetRefunds", - "parameters": [ - { - "description": "Only return refunds for the charge specified by this charge ID.", - "in": "query", - "name": "charge", - "required": false, - "schema": { - "type": "string" - }, - "style": "form" - }, - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": { - "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": "Only return refunds for the PaymentIntent specified by this ID.", - "in": "query", - "name": "payment_intent", - "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": { - "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/refund" - }, - "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/refunds", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "APIMethodRefundList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Create a refund.
", - "operationId": "PostRefunds", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "A positive integer representing how much to refund.", - "type": "integer" - }, - "charge": { - "maxLength": 5000, - "type": "string" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "customer": { - "description": "Customer whose customer balance to refund from.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "instructions_email": { - "description": "Address to send refund email, use customer email if not specified", - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "origin": { - "description": "Origin of the refund", - "enum": [ - "customer_balance" - ], - "type": "string" - }, - "payment_intent": { - "maxLength": 5000, - "type": "string" - }, - "reason": { - "enum": [ - "duplicate", - "fraudulent", - "requested_by_customer" - ], - "maxLength": 5000, - "type": "string" - }, - "refund_application_fee": { - "type": "boolean" - }, - "reverse_transfer": { - "type": "boolean" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/refund" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/refunds/{refund}": { - "get": { - "description": "Retrieves the details of an existing refund.
", - "operationId": "GetRefundsRefund", - "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": "refund", - "required": true, - "schema": { - "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/refund" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the specified refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
\n\nThis request only accepts metadata
as an argument.
Cancels a refund with a status of requires_action
.
Refunds in other states cannot be canceled, and only refunds for payment methods that require customer action will enter the requires_action
state.
Returns a list of Report Runs, with the most recent appearing first.
", - "operationId": "GetReportingReportRuns", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": "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/reporting.report_run" - }, - "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/reporting/report_runs", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "FinancialReportingFinanceReportRunList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a new object and begin running the report. (Certain report types require a live-mode API key.)
", - "operationId": "PostReportingReportRuns", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "parameters": { - "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" - }, - "parameters": { - "description": "Parameters specifying how the report should be run. Different Report Types have different required and optional parameters, listed in the [API Access to Reports](https://stripe.com/docs/reporting/statements/api) documentation.", - "properties": { - "columns": { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "connected_account": { - "type": "string" - }, - "currency": { - "type": "string" - }, - "interval_end": { - "format": "unix-time", - "type": "integer" - }, - "interval_start": { - "format": "unix-time", - "type": "integer" - }, - "payout": { - "type": "string" - }, - "reporting_category": { - "enum": [ - "advance", - "advance_funding", - "anticipation_repayment", - "charge", - "charge_failure", - "connect_collection_transfer", - "connect_reserved_funds", - "contribution", - "dispute", - "dispute_reversal", - "fee", - "financing_paydown", - "financing_paydown_reversal", - "financing_payout", - "financing_payout_reversal", - "issuing_authorization_hold", - "issuing_authorization_release", - "issuing_dispute", - "issuing_transaction", - "network_cost", - "other_adjustment", - "partial_capture_reversal", - "payout", - "payout_reversal", - "platform_earning", - "platform_earning_refund", - "refund", - "refund_failure", - "risk_reserved_funds", - "tax", - "topup", - "topup_reversal", - "transfer", - "transfer_reversal" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "timezone": { - "enum": [ - "Africa/Abidjan", - "Africa/Accra", - "Africa/Addis_Ababa", - "Africa/Algiers", - "Africa/Asmara", - "Africa/Asmera", - "Africa/Bamako", - "Africa/Bangui", - "Africa/Banjul", - "Africa/Bissau", - "Africa/Blantyre", - "Africa/Brazzaville", - "Africa/Bujumbura", - "Africa/Cairo", - "Africa/Casablanca", - "Africa/Ceuta", - "Africa/Conakry", - "Africa/Dakar", - "Africa/Dar_es_Salaam", - "Africa/Djibouti", - "Africa/Douala", - "Africa/El_Aaiun", - "Africa/Freetown", - "Africa/Gaborone", - "Africa/Harare", - "Africa/Johannesburg", - "Africa/Juba", - "Africa/Kampala", - "Africa/Khartoum", - "Africa/Kigali", - "Africa/Kinshasa", - "Africa/Lagos", - "Africa/Libreville", - "Africa/Lome", - "Africa/Luanda", - "Africa/Lubumbashi", - "Africa/Lusaka", - "Africa/Malabo", - "Africa/Maputo", - "Africa/Maseru", - "Africa/Mbabane", - "Africa/Mogadishu", - "Africa/Monrovia", - "Africa/Nairobi", - "Africa/Ndjamena", - "Africa/Niamey", - "Africa/Nouakchott", - "Africa/Ouagadougou", - "Africa/Porto-Novo", - "Africa/Sao_Tome", - "Africa/Timbuktu", - "Africa/Tripoli", - "Africa/Tunis", - "Africa/Windhoek", - "America/Adak", - "America/Anchorage", - "America/Anguilla", - "America/Antigua", - "America/Araguaina", - "America/Argentina/Buenos_Aires", - "America/Argentina/Catamarca", - "America/Argentina/ComodRivadavia", - "America/Argentina/Cordoba", - "America/Argentina/Jujuy", - "America/Argentina/La_Rioja", - "America/Argentina/Mendoza", - "America/Argentina/Rio_Gallegos", - "America/Argentina/Salta", - "America/Argentina/San_Juan", - "America/Argentina/San_Luis", - "America/Argentina/Tucuman", - "America/Argentina/Ushuaia", - "America/Aruba", - "America/Asuncion", - "America/Atikokan", - "America/Atka", - "America/Bahia", - "America/Bahia_Banderas", - "America/Barbados", - "America/Belem", - "America/Belize", - "America/Blanc-Sablon", - "America/Boa_Vista", - "America/Bogota", - "America/Boise", - "America/Buenos_Aires", - "America/Cambridge_Bay", - "America/Campo_Grande", - "America/Cancun", - "America/Caracas", - "America/Catamarca", - "America/Cayenne", - "America/Cayman", - "America/Chicago", - "America/Chihuahua", - "America/Coral_Harbour", - "America/Cordoba", - "America/Costa_Rica", - "America/Creston", - "America/Cuiaba", - "America/Curacao", - "America/Danmarkshavn", - "America/Dawson", - "America/Dawson_Creek", - "America/Denver", - "America/Detroit", - "America/Dominica", - "America/Edmonton", - "America/Eirunepe", - "America/El_Salvador", - "America/Ensenada", - "America/Fort_Nelson", - "America/Fort_Wayne", - "America/Fortaleza", - "America/Glace_Bay", - "America/Godthab", - "America/Goose_Bay", - "America/Grand_Turk", - "America/Grenada", - "America/Guadeloupe", - "America/Guatemala", - "America/Guayaquil", - "America/Guyana", - "America/Halifax", - "America/Havana", - "America/Hermosillo", - "America/Indiana/Indianapolis", - "America/Indiana/Knox", - "America/Indiana/Marengo", - "America/Indiana/Petersburg", - "America/Indiana/Tell_City", - "America/Indiana/Vevay", - "America/Indiana/Vincennes", - "America/Indiana/Winamac", - "America/Indianapolis", - "America/Inuvik", - "America/Iqaluit", - "America/Jamaica", - "America/Jujuy", - "America/Juneau", - "America/Kentucky/Louisville", - "America/Kentucky/Monticello", - "America/Knox_IN", - "America/Kralendijk", - "America/La_Paz", - "America/Lima", - "America/Los_Angeles", - "America/Louisville", - "America/Lower_Princes", - "America/Maceio", - "America/Managua", - "America/Manaus", - "America/Marigot", - "America/Martinique", - "America/Matamoros", - "America/Mazatlan", - "America/Mendoza", - "America/Menominee", - "America/Merida", - "America/Metlakatla", - "America/Mexico_City", - "America/Miquelon", - "America/Moncton", - "America/Monterrey", - "America/Montevideo", - "America/Montreal", - "America/Montserrat", - "America/Nassau", - "America/New_York", - "America/Nipigon", - "America/Nome", - "America/Noronha", - "America/North_Dakota/Beulah", - "America/North_Dakota/Center", - "America/North_Dakota/New_Salem", - "America/Nuuk", - "America/Ojinaga", - "America/Panama", - "America/Pangnirtung", - "America/Paramaribo", - "America/Phoenix", - "America/Port-au-Prince", - "America/Port_of_Spain", - "America/Porto_Acre", - "America/Porto_Velho", - "America/Puerto_Rico", - "America/Punta_Arenas", - "America/Rainy_River", - "America/Rankin_Inlet", - "America/Recife", - "America/Regina", - "America/Resolute", - "America/Rio_Branco", - "America/Rosario", - "America/Santa_Isabel", - "America/Santarem", - "America/Santiago", - "America/Santo_Domingo", - "America/Sao_Paulo", - "America/Scoresbysund", - "America/Shiprock", - "America/Sitka", - "America/St_Barthelemy", - "America/St_Johns", - "America/St_Kitts", - "America/St_Lucia", - "America/St_Thomas", - "America/St_Vincent", - "America/Swift_Current", - "America/Tegucigalpa", - "America/Thule", - "America/Thunder_Bay", - "America/Tijuana", - "America/Toronto", - "America/Tortola", - "America/Vancouver", - "America/Virgin", - "America/Whitehorse", - "America/Winnipeg", - "America/Yakutat", - "America/Yellowknife", - "Antarctica/Casey", - "Antarctica/Davis", - "Antarctica/DumontDUrville", - "Antarctica/Macquarie", - "Antarctica/Mawson", - "Antarctica/McMurdo", - "Antarctica/Palmer", - "Antarctica/Rothera", - "Antarctica/South_Pole", - "Antarctica/Syowa", - "Antarctica/Troll", - "Antarctica/Vostok", - "Arctic/Longyearbyen", - "Asia/Aden", - "Asia/Almaty", - "Asia/Amman", - "Asia/Anadyr", - "Asia/Aqtau", - "Asia/Aqtobe", - "Asia/Ashgabat", - "Asia/Ashkhabad", - "Asia/Atyrau", - "Asia/Baghdad", - "Asia/Bahrain", - "Asia/Baku", - "Asia/Bangkok", - "Asia/Barnaul", - "Asia/Beirut", - "Asia/Bishkek", - "Asia/Brunei", - "Asia/Calcutta", - "Asia/Chita", - "Asia/Choibalsan", - "Asia/Chongqing", - "Asia/Chungking", - "Asia/Colombo", - "Asia/Dacca", - "Asia/Damascus", - "Asia/Dhaka", - "Asia/Dili", - "Asia/Dubai", - "Asia/Dushanbe", - "Asia/Famagusta", - "Asia/Gaza", - "Asia/Harbin", - "Asia/Hebron", - "Asia/Ho_Chi_Minh", - "Asia/Hong_Kong", - "Asia/Hovd", - "Asia/Irkutsk", - "Asia/Istanbul", - "Asia/Jakarta", - "Asia/Jayapura", - "Asia/Jerusalem", - "Asia/Kabul", - "Asia/Kamchatka", - "Asia/Karachi", - "Asia/Kashgar", - "Asia/Kathmandu", - "Asia/Katmandu", - "Asia/Khandyga", - "Asia/Kolkata", - "Asia/Krasnoyarsk", - "Asia/Kuala_Lumpur", - "Asia/Kuching", - "Asia/Kuwait", - "Asia/Macao", - "Asia/Macau", - "Asia/Magadan", - "Asia/Makassar", - "Asia/Manila", - "Asia/Muscat", - "Asia/Nicosia", - "Asia/Novokuznetsk", - "Asia/Novosibirsk", - "Asia/Omsk", - "Asia/Oral", - "Asia/Phnom_Penh", - "Asia/Pontianak", - "Asia/Pyongyang", - "Asia/Qatar", - "Asia/Qostanay", - "Asia/Qyzylorda", - "Asia/Rangoon", - "Asia/Riyadh", - "Asia/Saigon", - "Asia/Sakhalin", - "Asia/Samarkand", - "Asia/Seoul", - "Asia/Shanghai", - "Asia/Singapore", - "Asia/Srednekolymsk", - "Asia/Taipei", - "Asia/Tashkent", - "Asia/Tbilisi", - "Asia/Tehran", - "Asia/Tel_Aviv", - "Asia/Thimbu", - "Asia/Thimphu", - "Asia/Tokyo", - "Asia/Tomsk", - "Asia/Ujung_Pandang", - "Asia/Ulaanbaatar", - "Asia/Ulan_Bator", - "Asia/Urumqi", - "Asia/Ust-Nera", - "Asia/Vientiane", - "Asia/Vladivostok", - "Asia/Yakutsk", - "Asia/Yangon", - "Asia/Yekaterinburg", - "Asia/Yerevan", - "Atlantic/Azores", - "Atlantic/Bermuda", - "Atlantic/Canary", - "Atlantic/Cape_Verde", - "Atlantic/Faeroe", - "Atlantic/Faroe", - "Atlantic/Jan_Mayen", - "Atlantic/Madeira", - "Atlantic/Reykjavik", - "Atlantic/South_Georgia", - "Atlantic/St_Helena", - "Atlantic/Stanley", - "Australia/ACT", - "Australia/Adelaide", - "Australia/Brisbane", - "Australia/Broken_Hill", - "Australia/Canberra", - "Australia/Currie", - "Australia/Darwin", - "Australia/Eucla", - "Australia/Hobart", - "Australia/LHI", - "Australia/Lindeman", - "Australia/Lord_Howe", - "Australia/Melbourne", - "Australia/NSW", - "Australia/North", - "Australia/Perth", - "Australia/Queensland", - "Australia/South", - "Australia/Sydney", - "Australia/Tasmania", - "Australia/Victoria", - "Australia/West", - "Australia/Yancowinna", - "Brazil/Acre", - "Brazil/DeNoronha", - "Brazil/East", - "Brazil/West", - "CET", - "CST6CDT", - "Canada/Atlantic", - "Canada/Central", - "Canada/Eastern", - "Canada/Mountain", - "Canada/Newfoundland", - "Canada/Pacific", - "Canada/Saskatchewan", - "Canada/Yukon", - "Chile/Continental", - "Chile/EasterIsland", - "Cuba", - "EET", - "EST", - "EST5EDT", - "Egypt", - "Eire", - "Etc/GMT", - "Etc/GMT+0", - "Etc/GMT+1", - "Etc/GMT+10", - "Etc/GMT+11", - "Etc/GMT+12", - "Etc/GMT+2", - "Etc/GMT+3", - "Etc/GMT+4", - "Etc/GMT+5", - "Etc/GMT+6", - "Etc/GMT+7", - "Etc/GMT+8", - "Etc/GMT+9", - "Etc/GMT-0", - "Etc/GMT-1", - "Etc/GMT-10", - "Etc/GMT-11", - "Etc/GMT-12", - "Etc/GMT-13", - "Etc/GMT-14", - "Etc/GMT-2", - "Etc/GMT-3", - "Etc/GMT-4", - "Etc/GMT-5", - "Etc/GMT-6", - "Etc/GMT-7", - "Etc/GMT-8", - "Etc/GMT-9", - "Etc/GMT0", - "Etc/Greenwich", - "Etc/UCT", - "Etc/UTC", - "Etc/Universal", - "Etc/Zulu", - "Europe/Amsterdam", - "Europe/Andorra", - "Europe/Astrakhan", - "Europe/Athens", - "Europe/Belfast", - "Europe/Belgrade", - "Europe/Berlin", - "Europe/Bratislava", - "Europe/Brussels", - "Europe/Bucharest", - "Europe/Budapest", - "Europe/Busingen", - "Europe/Chisinau", - "Europe/Copenhagen", - "Europe/Dublin", - "Europe/Gibraltar", - "Europe/Guernsey", - "Europe/Helsinki", - "Europe/Isle_of_Man", - "Europe/Istanbul", - "Europe/Jersey", - "Europe/Kaliningrad", - "Europe/Kiev", - "Europe/Kirov", - "Europe/Kyiv", - "Europe/Lisbon", - "Europe/Ljubljana", - "Europe/London", - "Europe/Luxembourg", - "Europe/Madrid", - "Europe/Malta", - "Europe/Mariehamn", - "Europe/Minsk", - "Europe/Monaco", - "Europe/Moscow", - "Europe/Nicosia", - "Europe/Oslo", - "Europe/Paris", - "Europe/Podgorica", - "Europe/Prague", - "Europe/Riga", - "Europe/Rome", - "Europe/Samara", - "Europe/San_Marino", - "Europe/Sarajevo", - "Europe/Saratov", - "Europe/Simferopol", - "Europe/Skopje", - "Europe/Sofia", - "Europe/Stockholm", - "Europe/Tallinn", - "Europe/Tirane", - "Europe/Tiraspol", - "Europe/Ulyanovsk", - "Europe/Uzhgorod", - "Europe/Vaduz", - "Europe/Vatican", - "Europe/Vienna", - "Europe/Vilnius", - "Europe/Volgograd", - "Europe/Warsaw", - "Europe/Zagreb", - "Europe/Zaporozhye", - "Europe/Zurich", - "Factory", - "GB", - "GB-Eire", - "GMT", - "GMT+0", - "GMT-0", - "GMT0", - "Greenwich", - "HST", - "Hongkong", - "Iceland", - "Indian/Antananarivo", - "Indian/Chagos", - "Indian/Christmas", - "Indian/Cocos", - "Indian/Comoro", - "Indian/Kerguelen", - "Indian/Mahe", - "Indian/Maldives", - "Indian/Mauritius", - "Indian/Mayotte", - "Indian/Reunion", - "Iran", - "Israel", - "Jamaica", - "Japan", - "Kwajalein", - "Libya", - "MET", - "MST", - "MST7MDT", - "Mexico/BajaNorte", - "Mexico/BajaSur", - "Mexico/General", - "NZ", - "NZ-CHAT", - "Navajo", - "PRC", - "PST8PDT", - "Pacific/Apia", - "Pacific/Auckland", - "Pacific/Bougainville", - "Pacific/Chatham", - "Pacific/Chuuk", - "Pacific/Easter", - "Pacific/Efate", - "Pacific/Enderbury", - "Pacific/Fakaofo", - "Pacific/Fiji", - "Pacific/Funafuti", - "Pacific/Galapagos", - "Pacific/Gambier", - "Pacific/Guadalcanal", - "Pacific/Guam", - "Pacific/Honolulu", - "Pacific/Johnston", - "Pacific/Kanton", - "Pacific/Kiritimati", - "Pacific/Kosrae", - "Pacific/Kwajalein", - "Pacific/Majuro", - "Pacific/Marquesas", - "Pacific/Midway", - "Pacific/Nauru", - "Pacific/Niue", - "Pacific/Norfolk", - "Pacific/Noumea", - "Pacific/Pago_Pago", - "Pacific/Palau", - "Pacific/Pitcairn", - "Pacific/Pohnpei", - "Pacific/Ponape", - "Pacific/Port_Moresby", - "Pacific/Rarotonga", - "Pacific/Saipan", - "Pacific/Samoa", - "Pacific/Tahiti", - "Pacific/Tarawa", - "Pacific/Tongatapu", - "Pacific/Truk", - "Pacific/Wake", - "Pacific/Wallis", - "Pacific/Yap", - "Poland", - "Portugal", - "ROC", - "ROK", - "Singapore", - "Turkey", - "UCT", - "US/Alaska", - "US/Aleutian", - "US/Arizona", - "US/Central", - "US/East-Indiana", - "US/Eastern", - "US/Hawaii", - "US/Indiana-Starke", - "US/Michigan", - "US/Mountain", - "US/Pacific", - "US/Pacific-New", - "US/Samoa", - "UTC", - "Universal", - "W-SU", - "WET", - "Zulu" - ], - "maxLength": 5000, - "type": "string" - } - }, - "title": "run_parameter_specs", - "type": "object" - }, - "report_type": { - "description": "The ID of the [report type](https://stripe.com/docs/reporting/statements/api#report-types) to run, such as `\"balance.summary.1\"`.", - "type": "string" - } - }, - "required": [ - "report_type" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/reporting.report_run" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/reporting/report_runs/{report_run}": { - "get": { - "description": "Retrieves the details of an existing Report Run.
", - "operationId": "GetReportingReportRunsReportRun", - "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": "report_run", - "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/reporting.report_run" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/reporting/report_types": { - "get": { - "description": "Returns a full list of Report Types.
", - "operationId": "GetReportingReportTypes", - "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": { - "description": "", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/reporting.report_type" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "FinancialReportingFinanceReportTypeList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/reporting/report_types/{report_type}": { - "get": { - "description": "Retrieves the details of a Report Type. (Certain report types require a live-mode API key.)
", - "operationId": "GetReportingReportTypesReportType", - "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": "report_type", - "required": true, - "schema": { - "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/reporting.report_type" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/reviews": { - "get": { - "description": "Returns a list of Review
objects that have open
set to true
. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
Retrieves a Review
object.
Approves a Review
object, closing it and removing it from the list of reviews.
Returns a list of SetupAttempts associated with a provided SetupIntent.
", - "operationId": "GetSetupAttempts", - "parameters": [ - { - "description": "A filter on the list, based on the object `created` field. The value\ncan be a string with an integer Unix timestamp, or it can be a\ndictionary with a number of different query options.", - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": "Only return SetupAttempts created by the SetupIntent specified by\nthis ID.", - "in": "query", - "name": "setup_intent", - "required": true, - "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/setup_attempt" - }, - "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/setup_attempts", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "PaymentFlowsSetupIntentSetupAttemptList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/setup_intents": { - "get": { - "description": "Returns a list of SetupIntents.
", - "operationId": "GetSetupIntents", - "parameters": [ - { - "description": "If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.\n\nIt can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.", - "in": "query", - "name": "attach_to_self", - "required": false, - "schema": { - "type": "boolean" - }, - "style": "form" - }, - { - "description": "A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.", - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "Only return SetupIntents for the customer specified by this customer ID.", - "in": "query", - "name": "customer", - "required": false, - "schema": { - "maxLength": 5000, - "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": "Only return SetupIntents associated with the specified payment method.", - "in": "query", - "name": "payment_method", - "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/setup_intent" - }, - "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/setup_intents", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "PaymentFlowsSetupIntentList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a SetupIntent object.
\n\nAfter the SetupIntent is created, attach a payment method and confirm\nto collect any required permissions to charge the payment method later.
", - "operationId": "PostSetupIntents", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "flow_directions": { - "explode": true, - "style": "deepObject" - }, - "mandate_data": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "payment_method_data": { - "explode": true, - "style": "deepObject" - }, - "payment_method_options": { - "explode": true, - "style": "deepObject" - }, - "payment_method_types": { - "explode": true, - "style": "deepObject" - }, - "single_use": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "attach_to_self": { - "description": "If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.\n\nIt can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.", - "type": "boolean" - }, - "confirm": { - "description": "Set to `true` to attempt to confirm this SetupIntent immediately. This parameter defaults to `false`. If the payment method attached is a card, a return_url may be provided in case additional authentication is required.", - "type": "boolean" - }, - "customer": { - "description": "ID of the Customer this SetupIntent belongs to, if one exists.\n\nIf present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.", - "maxLength": 5000, - "type": "string" - }, - "description": { - "description": "An arbitrary string attached to the object. Often useful for displaying to users.", - "maxLength": 1000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "flow_directions": { - "description": "Indicates the directions of money movement for which this payment method is intended to be used.\n\nInclude `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.", - "items": { - "enum": [ - "inbound", - "outbound" - ], - "type": "string" - }, - "type": "array" - }, - "mandate_data": { - "description": "This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm).", - "properties": { - "customer_acceptance": { - "properties": { - "accepted_at": { - "format": "unix-time", - "type": "integer" - }, - "offline": { - "properties": { - }, - "title": "offline_param", - "type": "object" - }, - "online": { - "properties": { - "ip_address": { - "type": "string" - }, - "user_agent": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "ip_address", - "user_agent" - ], - "title": "online_param", - "type": "object" - }, - "type": { - "enum": [ - "offline", - "online" - ], - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "customer_acceptance_param", - "type": "object" - } - }, - "required": [ - "customer_acceptance" - ], - "title": "secret_key_param", - "type": "object" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "on_behalf_of": { - "description": "The Stripe account ID for which this SetupIntent is created.", - "type": "string" - }, - "payment_method": { - "description": "ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.", - "maxLength": 5000, - "type": "string" - }, - "payment_method_data": { - "description": "When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method)\nvalue in the SetupIntent.", - "properties": { - "acss_debit": { - "properties": { - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "institution_number": { - "maxLength": 5000, - "type": "string" - }, - "transit_number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "account_number", - "institution_number", - "transit_number" - ], - "title": "payment_method_param", - "type": "object" - }, - "affirm": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "afterpay_clearpay": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "alipay": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "au_becs_debit": { - "properties": { - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "bsb_number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "account_number", - "bsb_number" - ], - "title": "param", - "type": "object" - }, - "bacs_debit": { - "properties": { - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "sort_code": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "param", - "type": "object" - }, - "bancontact": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "billing_details": { - "properties": { - "address": { - "anyOf": [ - { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "billing_details_address", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "email": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "billing_details_inner_params", - "type": "object" - }, - "blik": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "boleto": { - "properties": { - "tax_id": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "tax_id" - ], - "title": "param", - "type": "object" - }, - "customer_balance": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "eps": { - "properties": { - "bank": { - "enum": [ - "arzte_und_apotheker_bank", - "austrian_anadi_bank_ag", - "bank_austria", - "bankhaus_carl_spangler", - "bankhaus_schelhammer_und_schattera_ag", - "bawag_psk_ag", - "bks_bank_ag", - "brull_kallmus_bank_ag", - "btv_vier_lander_bank", - "capital_bank_grawe_gruppe_ag", - "deutsche_bank_ag", - "dolomitenbank", - "easybank_ag", - "erste_bank_und_sparkassen", - "hypo_alpeadriabank_international_ag", - "hypo_bank_burgenland_aktiengesellschaft", - "hypo_noe_lb_fur_niederosterreich_u_wien", - "hypo_oberosterreich_salzburg_steiermark", - "hypo_tirol_bank_ag", - "hypo_vorarlberg_bank_ag", - "marchfelder_bank", - "oberbank_ag", - "raiffeisen_bankengruppe_osterreich", - "schoellerbank_ag", - "sparda_bank_wien", - "volksbank_gruppe", - "volkskreditbank_ag", - "vr_bank_braunau" - ], - "maxLength": 5000, - "type": "string" - } - }, - "title": "param", - "type": "object" - }, - "fpx": { - "properties": { - "bank": { - "enum": [ - "affin_bank", - "agrobank", - "alliance_bank", - "ambank", - "bank_islam", - "bank_muamalat", - "bank_of_china", - "bank_rakyat", - "bsn", - "cimb", - "deutsche_bank", - "hong_leong_bank", - "hsbc", - "kfh", - "maybank2e", - "maybank2u", - "ocbc", - "pb_enterprise", - "public_bank", - "rhb", - "standard_chartered", - "uob" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - } - }, - "required": [ - "bank" - ], - "title": "param", - "type": "object" - }, - "giropay": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "grabpay": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "ideal": { - "properties": { - "bank": { - "enum": [ - "abn_amro", - "asn_bank", - "bunq", - "handelsbanken", - "ing", - "knab", - "moneyou", - "rabobank", - "regiobank", - "revolut", - "sns_bank", - "triodos_bank", - "van_lanschot" - ], - "maxLength": 5000, - "type": "string" - } - }, - "title": "param", - "type": "object" - }, - "interac_present": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "klarna": { - "properties": { - "dob": { - "properties": { - "day": { - "type": "integer" - }, - "month": { - "type": "integer" - }, - "year": { - "type": "integer" - } - }, - "required": [ - "day", - "month", - "year" - ], - "title": "date_of_birth", - "type": "object" - } - }, - "title": "param", - "type": "object" - }, - "konbini": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "link": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "oxxo": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "p24": { - "properties": { - "bank": { - "enum": [ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "volkswagen_bank" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "param", - "type": "object" - }, - "paynow": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "pix": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "promptpay": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "radar_options": { - "properties": { - "session": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "radar_options", - "type": "object" - }, - "sepa_debit": { - "properties": { - "iban": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "iban" - ], - "title": "param", - "type": "object" - }, - "sofort": { - "properties": { - "country": { - "enum": [ - "AT", - "BE", - "DE", - "ES", - "IT", - "NL" - ], - "type": "string" - } - }, - "required": [ - "country" - ], - "title": "param", - "type": "object" - }, - "type": { - "enum": [ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "blik", - "boleto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "klarna", - "konbini", - "link", - "oxxo", - "p24", - "paynow", - "pix", - "promptpay", - "sepa_debit", - "sofort", - "us_bank_account", - "wechat_pay" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "us_bank_account": { - "properties": { - "account_holder_type": { - "enum": [ - "company", - "individual" - ], - "type": "string" - }, - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "account_type": { - "enum": [ - "checking", - "savings" - ], - "type": "string" - }, - "financial_connections_account": { - "maxLength": 5000, - "type": "string" - }, - "routing_number": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "payment_method_param", - "type": "object" - }, - "wechat_pay": { - "properties": { - }, - "title": "param", - "type": "object" - } - }, - "required": [ - "type" - ], - "title": "payment_method_data_params", - "type": "object" - }, - "payment_method_options": { - "description": "Payment-method-specific configuration for this SetupIntent.", - "properties": { - "acss_debit": { - "properties": { - "currency": { - "enum": [ - "cad", - "usd" - ], - "type": "string" - }, - "mandate_options": { - "properties": { - "custom_mandate_url": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "default_for": { - "items": { - "enum": [ - "invoice", - "subscription" - ], - "type": "string" - }, - "type": "array" - }, - "interval_description": { - "maxLength": 500, - "type": "string" - }, - "payment_schedule": { - "enum": [ - "combined", - "interval", - "sporadic" - ], - "type": "string" - }, - "transaction_type": { - "enum": [ - "business", - "personal" - ], - "type": "string" - } - }, - "title": "setup_intent_payment_method_options_mandate_options_param", - "type": "object" - }, - "verification_method": { - "enum": [ - "automatic", - "instant", - "microdeposits" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "setup_intent_payment_method_options_param", - "type": "object" - }, - "blik": { - "properties": { - "code": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "setup_intent_payment_method_options_param", - "type": "object" - }, - "card": { - "properties": { - "mandate_options": { - "properties": { - "amount": { - "type": "integer" - }, - "amount_type": { - "enum": [ - "fixed", - "maximum" - ], - "type": "string" - }, - "currency": { - "type": "string" - }, - "description": { - "maxLength": 200, - "type": "string" - }, - "end_date": { - "format": "unix-time", - "type": "integer" - }, - "interval": { - "enum": [ - "day", - "month", - "sporadic", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - }, - "reference": { - "maxLength": 80, - "type": "string" - }, - "start_date": { - "format": "unix-time", - "type": "integer" - }, - "supported_types": { - "items": { - "enum": [ - "india" - ], - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "amount", - "amount_type", - "currency", - "interval", - "reference", - "start_date" - ], - "title": "setup_intent_mandate_options_param", - "type": "object" - }, - "network": { - "enum": [ - "amex", - "cartes_bancaires", - "diners", - "discover", - "interac", - "jcb", - "mastercard", - "unionpay", - "unknown", - "visa" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "request_three_d_secure": { - "enum": [ - "any", - "automatic" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "setup_intent_param", - "type": "object" - }, - "link": { - "properties": { - "persistent_token": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "setup_intent_payment_method_options_param", - "type": "object" - }, - "sepa_debit": { - "properties": { - "mandate_options": { - "properties": { - }, - "title": "payment_method_options_mandate_options_param", - "type": "object" - } - }, - "title": "setup_intent_payment_method_options_param", - "type": "object" - }, - "us_bank_account": { - "properties": { - "financial_connections": { - "properties": { - "permissions": { - "items": { - "enum": [ - "balances", - "ownership", - "payment_method", - "transactions" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - }, - "return_url": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "linked_account_options_param", - "type": "object" - }, - "networks": { - "properties": { - "requested": { - "items": { - "enum": [ - "ach", - "us_domestic_wire" - ], - "type": "string" - }, - "type": "array" - } - }, - "title": "networks_options_param", - "type": "object" - }, - "verification_method": { - "enum": [ - "automatic", - "instant", - "microdeposits" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "setup_intent_payment_method_options_param", - "type": "object" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "payment_method_types": { - "description": "The list of payment method types (e.g. card) that this SetupIntent is allowed to use. If this is not provided, defaults to [\"card\"].", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "return_url": { - "description": "The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm).", - "type": "string" - }, - "single_use": { - "description": "If this hash is populated, this SetupIntent will generate a single_use Mandate on success.", - "properties": { - "amount": { - "type": "integer" - }, - "currency": { - "type": "string" - } - }, - "required": [ - "amount", - "currency" - ], - "title": "setup_intent_single_use_params", - "type": "object" - }, - "usage": { - "description": "Indicates how the payment method is intended to be used in the future. If not provided, this value defaults to `off_session`.", - "enum": [ - "off_session", - "on_session" - ], - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/setup_intent" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/setup_intents/{intent}": { - "get": { - "description": "Retrieves the details of a SetupIntent that has previously been created.
\n\nClient-side retrieval using a publishable key is allowed when the client_secret
is provided in the query string.
When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the SetupIntent object reference for more details.
", - "operationId": "GetSetupIntentsIntent", - "parameters": [ - { - "description": "The client secret of the SetupIntent. Required if a publishable key is used to retrieve the SetupIntent.", - "in": "query", - "name": "client_secret", - "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" - }, - { - "in": "path", - "name": "intent", - "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/setup_intent" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates a SetupIntent object.
", - "operationId": "PostSetupIntentsIntent", - "parameters": [ - { - "in": "path", - "name": "intent", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "flow_directions": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "payment_method_data": { - "explode": true, - "style": "deepObject" - }, - "payment_method_options": { - "explode": true, - "style": "deepObject" - }, - "payment_method_types": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "attach_to_self": { - "description": "If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.\n\nIt can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.", - "type": "boolean" - }, - "customer": { - "description": "ID of the Customer this SetupIntent belongs to, if one exists.\n\nIf present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.", - "maxLength": 5000, - "type": "string" - }, - "description": { - "description": "An arbitrary string attached to the object. Often useful for displaying to users.", - "maxLength": 1000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "flow_directions": { - "description": "Indicates the directions of money movement for which this payment method is intended to be used.\n\nInclude `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.", - "items": { - "enum": [ - "inbound", - "outbound" - ], - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "payment_method": { - "description": "ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent.", - "maxLength": 5000, - "type": "string" - }, - "payment_method_data": { - "description": "When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method)\nvalue in the SetupIntent.", - "properties": { - "acss_debit": { - "properties": { - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "institution_number": { - "maxLength": 5000, - "type": "string" - }, - "transit_number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "account_number", - "institution_number", - "transit_number" - ], - "title": "payment_method_param", - "type": "object" - }, - "affirm": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "afterpay_clearpay": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "alipay": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "au_becs_debit": { - "properties": { - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "bsb_number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "account_number", - "bsb_number" - ], - "title": "param", - "type": "object" - }, - "bacs_debit": { - "properties": { - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "sort_code": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "param", - "type": "object" - }, - "bancontact": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "billing_details": { - "properties": { - "address": { - "anyOf": [ - { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "billing_details_address", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "email": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "billing_details_inner_params", - "type": "object" - }, - "blik": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "boleto": { - "properties": { - "tax_id": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "tax_id" - ], - "title": "param", - "type": "object" - }, - "customer_balance": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "eps": { - "properties": { - "bank": { - "enum": [ - "arzte_und_apotheker_bank", - "austrian_anadi_bank_ag", - "bank_austria", - "bankhaus_carl_spangler", - "bankhaus_schelhammer_und_schattera_ag", - "bawag_psk_ag", - "bks_bank_ag", - "brull_kallmus_bank_ag", - "btv_vier_lander_bank", - "capital_bank_grawe_gruppe_ag", - "deutsche_bank_ag", - "dolomitenbank", - "easybank_ag", - "erste_bank_und_sparkassen", - "hypo_alpeadriabank_international_ag", - "hypo_bank_burgenland_aktiengesellschaft", - "hypo_noe_lb_fur_niederosterreich_u_wien", - "hypo_oberosterreich_salzburg_steiermark", - "hypo_tirol_bank_ag", - "hypo_vorarlberg_bank_ag", - "marchfelder_bank", - "oberbank_ag", - "raiffeisen_bankengruppe_osterreich", - "schoellerbank_ag", - "sparda_bank_wien", - "volksbank_gruppe", - "volkskreditbank_ag", - "vr_bank_braunau" - ], - "maxLength": 5000, - "type": "string" - } - }, - "title": "param", - "type": "object" - }, - "fpx": { - "properties": { - "bank": { - "enum": [ - "affin_bank", - "agrobank", - "alliance_bank", - "ambank", - "bank_islam", - "bank_muamalat", - "bank_of_china", - "bank_rakyat", - "bsn", - "cimb", - "deutsche_bank", - "hong_leong_bank", - "hsbc", - "kfh", - "maybank2e", - "maybank2u", - "ocbc", - "pb_enterprise", - "public_bank", - "rhb", - "standard_chartered", - "uob" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - } - }, - "required": [ - "bank" - ], - "title": "param", - "type": "object" - }, - "giropay": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "grabpay": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "ideal": { - "properties": { - "bank": { - "enum": [ - "abn_amro", - "asn_bank", - "bunq", - "handelsbanken", - "ing", - "knab", - "moneyou", - "rabobank", - "regiobank", - "revolut", - "sns_bank", - "triodos_bank", - "van_lanschot" - ], - "maxLength": 5000, - "type": "string" - } - }, - "title": "param", - "type": "object" - }, - "interac_present": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "klarna": { - "properties": { - "dob": { - "properties": { - "day": { - "type": "integer" - }, - "month": { - "type": "integer" - }, - "year": { - "type": "integer" - } - }, - "required": [ - "day", - "month", - "year" - ], - "title": "date_of_birth", - "type": "object" - } - }, - "title": "param", - "type": "object" - }, - "konbini": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "link": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "oxxo": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "p24": { - "properties": { - "bank": { - "enum": [ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "volkswagen_bank" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "param", - "type": "object" - }, - "paynow": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "pix": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "promptpay": { - "properties": { - }, - "title": "param", - "type": "object" - }, - "radar_options": { - "properties": { - "session": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "radar_options", - "type": "object" - }, - "sepa_debit": { - "properties": { - "iban": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "iban" - ], - "title": "param", - "type": "object" - }, - "sofort": { - "properties": { - "country": { - "enum": [ - "AT", - "BE", - "DE", - "ES", - "IT", - "NL" - ], - "type": "string" - } - }, - "required": [ - "country" - ], - "title": "param", - "type": "object" - }, - "type": { - "enum": [ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "blik", - "boleto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "klarna", - "konbini", - "link", - "oxxo", - "p24", - "paynow", - "pix", - "promptpay", - "sepa_debit", - "sofort", - "us_bank_account", - "wechat_pay" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "us_bank_account": { - "properties": { - "account_holder_type": { - "enum": [ - "company", - "individual" - ], - "type": "string" - }, - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "account_type": { - "enum": [ - "checking", - "savings" - ], - "type": "string" - }, - "financial_connections_account": { - "maxLength": 5000, - "type": "string" - }, - "routing_number": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "payment_method_param", - "type": "object" - }, - "wechat_pay": { - "properties": { - }, - "title": "param", - "type": "object" - } - }, - "required": [ - "type" - ], - "title": "payment_method_data_params", - "type": "object" - }, - "payment_method_options": { - "description": "Payment-method-specific configuration for this SetupIntent.", - "properties": { - "acss_debit": { - "properties": { - "currency": { - "enum": [ - "cad", - "usd" - ], - "type": "string" - }, - "mandate_options": { - "properties": { - "custom_mandate_url": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "default_for": { - "items": { - "enum": [ - "invoice", - "subscription" - ], - "type": "string" - }, - "type": "array" - }, - "interval_description": { - "maxLength": 500, - "type": "string" - }, - "payment_schedule": { - "enum": [ - "combined", - "interval", - "sporadic" - ], - "type": "string" - }, - "transaction_type": { - "enum": [ - "business", - "personal" - ], - "type": "string" - } - }, - "title": "setup_intent_payment_method_options_mandate_options_param", - "type": "object" - }, - "verification_method": { - "enum": [ - "automatic", - "instant", - "microdeposits" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "setup_intent_payment_method_options_param", - "type": "object" - }, - "blik": { - "properties": { - "code": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "setup_intent_payment_method_options_param", - "type": "object" - }, - "card": { - "properties": { - "mandate_options": { - "properties": { - "amount": { - "type": "integer" - }, - "amount_type": { - "enum": [ - "fixed", - "maximum" - ], - "type": "string" - }, - "currency": { - "type": "string" - }, - "description": { - "maxLength": 200, - "type": "string" - }, - "end_date": { - "format": "unix-time", - "type": "integer" - }, - "interval": { - "enum": [ - "day", - "month", - "sporadic", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - }, - "reference": { - "maxLength": 80, - "type": "string" - }, - "start_date": { - "format": "unix-time", - "type": "integer" - }, - "supported_types": { - "items": { - "enum": [ - "india" - ], - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "amount", - "amount_type", - "currency", - "interval", - "reference", - "start_date" - ], - "title": "setup_intent_mandate_options_param", - "type": "object" - }, - "network": { - "enum": [ - "amex", - "cartes_bancaires", - "diners", - "discover", - "interac", - "jcb", - "mastercard", - "unionpay", - "unknown", - "visa" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "request_three_d_secure": { - "enum": [ - "any", - "automatic" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "setup_intent_param", - "type": "object" - }, - "link": { - "properties": { - "persistent_token": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "setup_intent_payment_method_options_param", - "type": "object" - }, - "sepa_debit": { - "properties": { - "mandate_options": { - "properties": { - }, - "title": "payment_method_options_mandate_options_param", - "type": "object" - } - }, - "title": "setup_intent_payment_method_options_param", - "type": "object" - }, - "us_bank_account": { - "properties": { - "financial_connections": { - "properties": { - "permissions": { - "items": { - "enum": [ - "balances", - "ownership", - "payment_method", - "transactions" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - }, - "return_url": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "linked_account_options_param", - "type": "object" - }, - "networks": { - "properties": { - "requested": { - "items": { - "enum": [ - "ach", - "us_domestic_wire" - ], - "type": "string" - }, - "type": "array" - } - }, - "title": "networks_options_param", - "type": "object" - }, - "verification_method": { - "enum": [ - "automatic", - "instant", - "microdeposits" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "setup_intent_payment_method_options_param", - "type": "object" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - "payment_method_types": { - "description": "The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. If this is not provided, defaults to [\"card\"].", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/setup_intent" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/setup_intents/{intent}/cancel": { - "post": { - "description": "A SetupIntent object can be canceled when it is in one of these statuses: requires_payment_method
, requires_confirmation
, or requires_action
.
Once canceled, setup is abandoned and any operations on the SetupIntent will fail with an error.
", - "operationId": "PostSetupIntentsIntentCancel", - "parameters": [ - { - "in": "path", - "name": "intent", - "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": { - "cancellation_reason": { - "description": "Reason for canceling this SetupIntent. Possible values are `abandoned`, `requested_by_customer`, or `duplicate`", - "enum": [ - "abandoned", - "duplicate", - "requested_by_customer" - ], - "maxLength": 5000, - "type": "string" - }, - "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/setup_intent" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/setup_intents/{intent}/confirm": { - "post": { - "description": "Confirm that your customer intends to set up the current or\nprovided payment method. For example, you would confirm a SetupIntent\nwhen a customer hits the “Save” button on a payment method management\npage on your website.
\n\nIf the selected payment method does not require any additional\nsteps from the customer, the SetupIntent will transition to the\nsucceeded
status.
Otherwise, it will transition to the requires_action
status and\nsuggest additional actions via next_action
. If setup fails,\nthe SetupIntent will transition to the\nrequires_payment_method
status.
Verifies microdeposits on a SetupIntent object.
", - "operationId": "PostSetupIntentsIntentVerifyMicrodeposits", - "parameters": [ - { - "in": "path", - "name": "intent", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "amounts": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amounts": { - "description": "Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.", - "items": { - "type": "integer" - }, - "type": "array" - }, - "client_secret": { - "description": "The client secret of the SetupIntent.", - "maxLength": 5000, - "type": "string" - }, - "descriptor_code": { - "description": "A six-character code starting with SM present in the microdeposit sent to the bank account.", - "maxLength": 5000, - "type": "string" - }, - "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/setup_intent" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/shipping_rates": { - "get": { - "description": "Returns a list of your shipping rates.
", - "operationId": "GetShippingRates", - "parameters": [ - { - "description": "Only return shipping rates that are active or inactive.", - "in": "query", - "name": "active", - "required": false, - "schema": { - "type": "boolean" - }, - "style": "form" - }, - { - "description": "A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.", - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "Only return shipping rates for the given currency.", - "in": "query", - "name": "currency", - "required": false, - "schema": { - "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": "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/shipping_rate" - }, - "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/shipping_rates", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "ShippingResourcesShippingRateList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a new shipping rate object.
", - "operationId": "PostShippingRates", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "delivery_estimate": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "fixed_amount": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "delivery_estimate": { - "description": "The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.", - "properties": { - "maximum": { - "properties": { - "unit": { - "enum": [ - "business_day", - "day", - "hour", - "month", - "week" - ], - "type": "string" - }, - "value": { - "type": "integer" - } - }, - "required": [ - "unit", - "value" - ], - "title": "delivery_estimate_bound", - "type": "object" - }, - "minimum": { - "properties": { - "unit": { - "enum": [ - "business_day", - "day", - "hour", - "month", - "week" - ], - "type": "string" - }, - "value": { - "type": "integer" - } - }, - "required": [ - "unit", - "value" - ], - "title": "delivery_estimate_bound", - "type": "object" - } - }, - "title": "delivery_estimate", - "type": "object" - }, - "display_name": { - "description": "The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.", - "maxLength": 100, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "fixed_amount": { - "description": "Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.", - "properties": { - "amount": { - "type": "integer" - }, - "currency": { - "type": "string" - }, - "currency_options": { - "additionalProperties": { - "properties": { - "amount": { - "type": "integer" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - } - }, - "required": [ - "amount" - ], - "title": "currency_option", - "type": "object" - }, - "type": "object" - } - }, - "required": [ - "amount", - "currency" - ], - "title": "fixed_amount", - "type": "object" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "tax_behavior": { - "description": "Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.", - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "tax_code": { - "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.", - "type": "string" - }, - "type": { - "description": "The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now.", - "enum": [ - "fixed_amount" - ], - "type": "string" - } - }, - "required": [ - "display_name" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/shipping_rate" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/shipping_rates/{shipping_rate_token}": { - "get": { - "description": "Returns the shipping rate object with the given ID.
", - "operationId": "GetShippingRatesShippingRateToken", - "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": "shipping_rate_token", - "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/shipping_rate" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates an existing shipping rate object.
", - "operationId": "PostShippingRatesShippingRateToken", - "parameters": [ - { - "in": "path", - "name": "shipping_rate_token", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "fixed_amount": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "active": { - "description": "Whether the shipping rate can be used for new purchases. Defaults to `true`.", - "type": "boolean" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "fixed_amount": { - "description": "Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.", - "properties": { - "currency_options": { - "additionalProperties": { - "properties": { - "amount": { - "type": "integer" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - } - }, - "title": "currency_option_update", - "type": "object" - }, - "type": "object" - } - }, - "title": "fixed_amount_update", - "type": "object" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "tax_behavior": { - "description": "Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.", - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/shipping_rate" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/sigma/scheduled_query_runs": { - "get": { - "description": "Returns a list of scheduled query runs.
", - "operationId": "GetSigmaScheduledQueryRuns", - "parameters": [ - { - "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": "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/scheduled_query_run" - }, - "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/sigma/scheduled_query_runs", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "SigmaScheduledQueryRunList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/sigma/scheduled_query_runs/{scheduled_query_run}": { - "get": { - "description": "Retrieves the details of an scheduled query run.
", - "operationId": "GetSigmaScheduledQueryRunsScheduledQueryRun", - "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": "scheduled_query_run", - "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/scheduled_query_run" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/sources": { - "post": { - "description": "Creates a new source object.
", - "operationId": "PostSources", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "mandate": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "owner": { - "explode": true, - "style": "deepObject" - }, - "receiver": { - "explode": true, - "style": "deepObject" - }, - "redirect": { - "explode": true, - "style": "deepObject" - }, - "source_order": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. Not supported for `receiver` type sources, where charge amount may not be specified until funds land.", - "type": "integer" - }, - "currency": { - "description": "Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready.", - "type": "string" - }, - "customer": { - "description": "The `Customer` to whom the original source is attached to. Must be set when the original source is not a `Source` (e.g., `Card`).", - "maxLength": 500, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "flow": { - "description": "The authentication `flow` of the source to create. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. It is generally inferred unless a type supports multiple flows.", - "enum": [ - "code_verification", - "none", - "receiver", - "redirect" - ], - "maxLength": 5000, - "type": "string" - }, - "mandate": { - "description": "Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status.", - "properties": { - "acceptance": { - "properties": { - "date": { - "format": "unix-time", - "type": "integer" - }, - "ip": { - "type": "string" - }, - "offline": { - "properties": { - "contact_email": { - "type": "string" - } - }, - "required": [ - "contact_email" - ], - "title": "mandate_offline_acceptance_params", - "type": "object" - }, - "online": { - "properties": { - "date": { - "format": "unix-time", - "type": "integer" - }, - "ip": { - "type": "string" - }, - "user_agent": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "mandate_online_acceptance_params", - "type": "object" - }, - "status": { - "enum": [ - "accepted", - "pending", - "refused", - "revoked" - ], - "maxLength": 5000, - "type": "string" - }, - "type": { - "enum": [ - "offline", - "online" - ], - "maxLength": 5000, - "type": "string" - }, - "user_agent": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "status" - ], - "title": "mandate_acceptance_params", - "type": "object" - }, - "amount": { - "anyOf": [ - { - "type": "integer" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "currency": { - "type": "string" - }, - "interval": { - "enum": [ - "one_time", - "scheduled", - "variable" - ], - "maxLength": 5000, - "type": "string" - }, - "notification_method": { - "enum": [ - "deprecated_none", - "email", - "manual", - "none", - "stripe_email" - ], - "maxLength": 5000, - "type": "string" - } - }, - "title": "mandate_params", - "type": "object" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "original_source": { - "description": "The source to share.", - "maxLength": 5000, - "type": "string" - }, - "owner": { - "description": "Information about the owner of the payment instrument that may be used or required by particular source types.", - "properties": { - "address": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "source_address", - "type": "object" - }, - "email": { - "type": "string" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "owner", - "type": "object" - }, - "receiver": { - "description": "Optional parameters for the receiver flow. Can be set only if the source is a receiver (`flow` is `receiver`).", - "properties": { - "refund_attributes_method": { - "enum": [ - "email", - "manual", - "none" - ], - "maxLength": 5000, - "type": "string" - } - }, - "title": "receiver_params", - "type": "object" - }, - "redirect": { - "description": "Parameters required for the redirect flow. Required if the source is authenticated by a redirect (`flow` is `redirect`).", - "properties": { - "return_url": { - "type": "string" - } - }, - "required": [ - "return_url" - ], - "title": "redirect_params", - "type": "object" - }, - "source_order": { - "description": "Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it.", - "properties": { - "items": { - "items": { - "properties": { - "amount": { - "type": "integer" - }, - "currency": { - "type": "string" - }, - "description": { - "maxLength": 1000, - "type": "string" - }, - "parent": { - "maxLength": 5000, - "type": "string" - }, - "quantity": { - "type": "integer" - }, - "type": { - "enum": [ - "discount", - "shipping", - "sku", - "tax" - ], - "maxLength": 5000, - "type": "string" - } - }, - "title": "order_item_specs", - "type": "object" - }, - "type": "array" - }, - "shipping": { - "properties": { - "address": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "line1" - ], - "title": "address", - "type": "object" - }, - "carrier": { - "maxLength": 5000, - "type": "string" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "maxLength": 5000, - "type": "string" - }, - "tracking_number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "address" - ], - "title": "order_shipping", - "type": "object" - } - }, - "title": "shallow_order_specs", - "type": "object" - }, - "statement_descriptor": { - "description": "An arbitrary string to be displayed on your customer's statement. As an example, if your website is `RunClub` and the item you're charging for is a race ticket, you may want to specify a `statement_descriptor` of `RunClub 5K race ticket.` While many payment types will display this information, some may not display it at all.", - "maxLength": 5000, - "type": "string" - }, - "token": { - "description": "An optional token used to create the source. When passed, token properties will override source parameters.", - "maxLength": 5000, - "type": "string" - }, - "type": { - "description": "The `type` of the source to create. Required unless `customer` and `original_source` are specified (see the [Cloning card Sources](https://stripe.com/docs/sources/connect#cloning-card-sources) guide)", - "maxLength": 5000, - "type": "string" - }, - "usage": { - "enum": [ - "reusable", - "single_use" - ], - "maxLength": 5000, - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/source" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/sources/{source}": { - "get": { - "description": "Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information.
", - "operationId": "GetSourcesSource", - "parameters": [ - { - "description": "The client secret of the source. Required if a publishable key is used to retrieve the source.", - "in": "query", - "name": "client_secret", - "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" - }, - { - "in": "path", - "name": "source", - "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/source" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
\n\nThis request accepts the metadata
and owner
as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our payment method guides for more detail.
Retrieves a new Source MandateNotification.
", - "operationId": "GetSourcesSourceMandateNotificationsMandateNotification", - "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": "mandate_notification", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "source", - "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/source_mandate_notification" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/sources/{source}/source_transactions": { - "get": { - "description": "List source transactions for a given source.
", - "operationId": "GetSourcesSourceSourceTransactions", - "parameters": [ - { - "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" - }, - { - "in": "path", - "name": "source", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/source_transaction" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "ApmsSourcesSourceTransactionList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/sources/{source}/source_transactions/{source_transaction}": { - "get": { - "description": "Retrieve an existing source transaction object. Supply the unique source ID from a source creation request and the source transaction ID and Stripe will return the corresponding up-to-date source object information.
", - "operationId": "GetSourcesSourceSourceTransactionsSourceTransaction", - "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": "source", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "source_transaction", - "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/source_transaction" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/sources/{source}/verify": { - "post": { - "description": "Verify a given source.
", - "operationId": "PostSourcesSourceVerify", - "parameters": [ - { - "in": "path", - "name": "source", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "values": { - "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" - }, - "values": { - "description": "The values needed to verify the source.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "values" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/source" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/subscription_items": { - "get": { - "description": "Returns a list of your subscription items for a given subscription.
", - "operationId": "GetSubscriptionItems", - "parameters": [ - { - "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": { - "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": "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": { - "type": "string" - }, - "style": "form" - }, - { - "description": "The ID of the subscription whose items will be retrieved.", - "in": "query", - "name": "subscription", - "required": true, - "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/subscription_item" - }, - "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/subscription_items", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "SubscriptionsItemsSubscriptionItemList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Adds a new item to an existing subscription. No existing items will be changed or replaced.
", - "operationId": "PostSubscriptionItems", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "billing_thresholds": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "price_data": { - "explode": true, - "style": "deepObject" - }, - "tax_rates": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "billing_thresholds": { - "anyOf": [ - { - "properties": { - "usage_gte": { - "type": "integer" - } - }, - "required": [ - "usage_gte" - ], - "title": "item_billing_thresholds_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds." - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "payment_behavior": { - "description": "Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior.\n\nUse `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method.\n\nUse `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes).\n\nUse `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.", - "enum": [ - "allow_incomplete", - "default_incomplete", - "error_if_incomplete", - "pending_if_incomplete" - ], - "type": "string" - }, - "price": { - "description": "The ID of the price object.", - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "recurring": { - "properties": { - "interval": { - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - } - }, - "required": [ - "interval" - ], - "title": "recurring_adhoc", - "type": "object" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product", - "recurring" - ], - "title": "recurring_price_data", - "type": "object" - }, - "proration_behavior": { - "description": "Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes.", - "enum": [ - "always_invoice", - "create_prorations", - "none" - ], - "type": "string" - }, - "proration_date": { - "description": "If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint.", - "format": "unix-time", - "type": "integer" - }, - "quantity": { - "description": "The quantity you'd like to apply to the subscription item you're creating.", - "type": "integer" - }, - "subscription": { - "description": "The identifier of the subscription to modify.", - "maxLength": 5000, - "type": "string" - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates." - } - }, - "required": [ - "subscription" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/subscription_item" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/subscription_items/{item}": { - "delete": { - "description": "Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription.
", - "operationId": "DeleteSubscriptionItemsItem", - "parameters": [ - { - "in": "path", - "name": "item", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - }, - "schema": { - "additionalProperties": false, - "properties": { - "clear_usage": { - "description": "Delete all usage for the given subscription item. Allowed only when the current plan's `usage_type` is `metered`.", - "type": "boolean" - }, - "proration_behavior": { - "description": "Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes.", - "enum": [ - "always_invoice", - "create_prorations", - "none" - ], - "type": "string" - }, - "proration_date": { - "description": "If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint.", - "format": "unix-time", - "type": "integer" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/deleted_subscription_item" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "Retrieves the subscription item with the given ID.
", - "operationId": "GetSubscriptionItemsItem", - "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": "item", - "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/subscription_item" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the plan or quantity of an item on a current subscription.
", - "operationId": "PostSubscriptionItemsItem", - "parameters": [ - { - "in": "path", - "name": "item", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "billing_thresholds": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "price_data": { - "explode": true, - "style": "deepObject" - }, - "tax_rates": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "billing_thresholds": { - "anyOf": [ - { - "properties": { - "usage_gte": { - "type": "integer" - } - }, - "required": [ - "usage_gte" - ], - "title": "item_billing_thresholds_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds." - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "off_session": { - "description": "Indicates if a customer is on or off-session while an invoice payment is attempted.", - "type": "boolean" - }, - "payment_behavior": { - "description": "Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior.\n\nUse `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method.\n\nUse `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes).\n\nUse `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.", - "enum": [ - "allow_incomplete", - "default_incomplete", - "error_if_incomplete", - "pending_if_incomplete" - ], - "type": "string" - }, - "price": { - "description": "The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided.", - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "recurring": { - "properties": { - "interval": { - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - } - }, - "required": [ - "interval" - ], - "title": "recurring_adhoc", - "type": "object" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product", - "recurring" - ], - "title": "recurring_price_data", - "type": "object" - }, - "proration_behavior": { - "description": "Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes.", - "enum": [ - "always_invoice", - "create_prorations", - "none" - ], - "type": "string" - }, - "proration_date": { - "description": "If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint.", - "format": "unix-time", - "type": "integer" - }, - "quantity": { - "description": "The quantity you'd like to apply to the subscription item you're creating.", - "type": "integer" - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates." - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/subscription_item" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/subscription_items/{subscription_item}/usage_record_summaries": { - "get": { - "description": "For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that’s been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September).
\n\nThe list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn’t ended yet. Since new usage records can still be added, the returned summary information for the subscription item’s ID should be seen as unstable until the subscription billing period ends.
", - "operationId": "GetSubscriptionItemsSubscriptionItemUsageRecordSummaries", - "parameters": [ - { - "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": "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" - }, - { - "in": "path", - "name": "subscription_item", - "required": true, - "schema": { - "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": { - "description": "", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/usage_record_summary" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "UsageEventsResourceUsageRecordSummaryList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/subscription_items/{subscription_item}/usage_records": { - "post": { - "description": "Creates a usage record for a specified subscription item and date, and fills it with a quantity.
\n\nUsage records provide quantity
information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the metered billing plan, Stripe helps you send accurate invoices to your customers.
The default calculation for usage is to add up all the quantity
values of the usage records within a billing period. You can change this default behavior with the billing plan’s aggregate_usage
parameter. When there is more than one usage record with the same timestamp, Stripe adds the quantity
values together. In most cases, this is the desired resolution, however, you can change this behavior with the action
parameter.
The default pricing model for metered billing is per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing model.
", - "operationId": "PostSubscriptionItemsSubscriptionItemUsageRecords", - "parameters": [ - { - "in": "path", - "name": "subscription_item", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "timestamp": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "action": { - "description": "Valid values are `increment` (default) or `set`. When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. The `set` action will overwrite the usage quantity at that timestamp. If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value.", - "enum": [ - "increment", - "set" - ], - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "quantity": { - "description": "The usage quantity for the specified timestamp.", - "type": "integer" - }, - "timestamp": { - "anyOf": [ - { - "enum": [ - "now" - ], - "maxLength": 5000, - "type": "string" - }, - { - "type": "integer" - } - ], - "description": "The timestamp for the usage event. This timestamp must be within the current billing period of the subscription of the provided `subscription_item`, and must not be in the future. When passing `\"now\"`, Stripe records usage for the current time. Default is `\"now\"` if a value is not provided." - } - }, - "required": [ - "quantity" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/usage_record" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/subscription_schedules": { - "get": { - "description": "Retrieves the list of your subscription schedules.
", - "operationId": "GetSubscriptionSchedules", - "parameters": [ - { - "description": "Only return subscription schedules that were created canceled the given date interval.", - "explode": true, - "in": "query", - "name": "canceled_at", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "Only return subscription schedules that completed during the given date interval.", - "explode": true, - "in": "query", - "name": "completed_at", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "Only return subscription schedules that were created during the given date interval.", - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "Only return subscription schedules for the given customer.", - "in": "query", - "name": "customer", - "required": false, - "schema": { - "maxLength": 5000, - "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": "Only return subscription schedules that were released during the given date interval.", - "explode": true, - "in": "query", - "name": "released_at", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "Only return subscription schedules that have not started yet.", - "in": "query", - "name": "scheduled", - "required": false, - "schema": { - "type": "boolean" - }, - "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/subscription_schedule" - }, - "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/subscription_schedules", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "SubscriptionSchedulesResourceScheduleList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.
", - "operationId": "PostSubscriptionSchedules", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "default_settings": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "phases": { - "explode": true, - "style": "deepObject" - }, - "start_date": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "customer": { - "description": "The identifier of the customer to create the subscription schedule for.", - "maxLength": 5000, - "type": "string" - }, - "default_settings": { - "description": "Object representing the subscription schedule's default settings.", - "properties": { - "application_fee_percent": { - "type": "number" - }, - "automatic_tax": { - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "automatic_tax_config", - "type": "object" - }, - "billing_cycle_anchor": { - "enum": [ - "automatic", - "phase_start" - ], - "type": "string" - }, - "billing_thresholds": { - "anyOf": [ - { - "properties": { - "amount_gte": { - "type": "integer" - }, - "reset_billing_cycle_anchor": { - "type": "boolean" - } - }, - "title": "billing_thresholds_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "collection_method": { - "enum": [ - "charge_automatically", - "send_invoice" - ], - "type": "string" - }, - "default_payment_method": { - "maxLength": 5000, - "type": "string" - }, - "description": { - "maxLength": 500, - "type": "string" - }, - "invoice_settings": { - "properties": { - "days_until_due": { - "type": "integer" - } - }, - "title": "subscription_schedules_param", - "type": "object" - }, - "on_behalf_of": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "transfer_data": { - "anyOf": [ - { - "properties": { - "amount_percent": { - "type": "number" - }, - "destination": { - "type": "string" - } - }, - "required": [ - "destination" - ], - "title": "transfer_data_specs", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "default_settings_params", - "type": "object" - }, - "end_behavior": { - "description": "Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription.", - "enum": [ - "cancel", - "none", - "release", - "renew" - ], - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "from_subscription": { - "description": "Migrate an existing subscription to be managed by a subscription schedule. If this parameter is set, a subscription schedule will be created using the subscription's item(s), set to auto-renew using the subscription's interval. When using this parameter, other parameters (such as phase values) cannot be set. To create a subscription schedule with other modifications, we recommend making two separate API calls.", - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "phases": { - "description": "List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase.", - "items": { - "properties": { - "add_invoice_items": { - "items": { - "properties": { - "price": { - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product" - ], - "title": "one_time_price_data_with_negative_amounts", - "type": "object" - }, - "quantity": { - "type": "integer" - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "add_invoice_item_entry", - "type": "object" - }, - "type": "array" - }, - "application_fee_percent": { - "type": "number" - }, - "automatic_tax": { - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "automatic_tax_config", - "type": "object" - }, - "billing_cycle_anchor": { - "enum": [ - "automatic", - "phase_start" - ], - "type": "string" - }, - "billing_thresholds": { - "anyOf": [ - { - "properties": { - "amount_gte": { - "type": "integer" - }, - "reset_billing_cycle_anchor": { - "type": "boolean" - } - }, - "title": "billing_thresholds_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "collection_method": { - "enum": [ - "charge_automatically", - "send_invoice" - ], - "type": "string" - }, - "coupon": { - "maxLength": 5000, - "type": "string" - }, - "currency": { - "type": "string" - }, - "default_payment_method": { - "maxLength": 5000, - "type": "string" - }, - "default_tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "description": { - "maxLength": 500, - "type": "string" - }, - "end_date": { - "format": "unix-time", - "type": "integer" - }, - "invoice_settings": { - "properties": { - "days_until_due": { - "type": "integer" - } - }, - "title": "subscription_schedules_param", - "type": "object" - }, - "items": { - "items": { - "properties": { - "billing_thresholds": { - "anyOf": [ - { - "properties": { - "usage_gte": { - "type": "integer" - } - }, - "required": [ - "usage_gte" - ], - "title": "item_billing_thresholds_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "price": { - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "recurring": { - "properties": { - "interval": { - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - } - }, - "required": [ - "interval" - ], - "title": "recurring_adhoc", - "type": "object" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product", - "recurring" - ], - "title": "recurring_price_data", - "type": "object" - }, - "quantity": { - "type": "integer" - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "configuration_item_params", - "type": "object" - }, - "type": "array" - }, - "iterations": { - "type": "integer" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "on_behalf_of": { - "type": "string" - }, - "proration_behavior": { - "enum": [ - "always_invoice", - "create_prorations", - "none" - ], - "type": "string" - }, - "transfer_data": { - "properties": { - "amount_percent": { - "type": "number" - }, - "destination": { - "type": "string" - } - }, - "required": [ - "destination" - ], - "title": "transfer_data_specs", - "type": "object" - }, - "trial": { - "type": "boolean" - }, - "trial_end": { - "format": "unix-time", - "type": "integer" - } - }, - "required": [ - "items" - ], - "title": "phase_configuration_params", - "type": "object" - }, - "type": "array" - }, - "start_date": { - "anyOf": [ - { - "type": "integer" - }, - { - "enum": [ - "now" - ], - "maxLength": 5000, - "type": "string" - } - ], - "description": "When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on." - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/subscription_schedule" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/subscription_schedules/{schedule}": { - "get": { - "description": "Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation.
", - "operationId": "GetSubscriptionSchedulesSchedule", - "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": "schedule", - "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/subscription_schedule" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates an existing subscription schedule.
", - "operationId": "PostSubscriptionSchedulesSchedule", - "parameters": [ - { - "in": "path", - "name": "schedule", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "default_settings": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "phases": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "default_settings": { - "description": "Object representing the subscription schedule's default settings.", - "properties": { - "application_fee_percent": { - "type": "number" - }, - "automatic_tax": { - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "automatic_tax_config", - "type": "object" - }, - "billing_cycle_anchor": { - "enum": [ - "automatic", - "phase_start" - ], - "type": "string" - }, - "billing_thresholds": { - "anyOf": [ - { - "properties": { - "amount_gte": { - "type": "integer" - }, - "reset_billing_cycle_anchor": { - "type": "boolean" - } - }, - "title": "billing_thresholds_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "collection_method": { - "enum": [ - "charge_automatically", - "send_invoice" - ], - "type": "string" - }, - "default_payment_method": { - "maxLength": 5000, - "type": "string" - }, - "description": { - "maxLength": 500, - "type": "string" - }, - "invoice_settings": { - "properties": { - "days_until_due": { - "type": "integer" - } - }, - "title": "subscription_schedules_param", - "type": "object" - }, - "on_behalf_of": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "transfer_data": { - "anyOf": [ - { - "properties": { - "amount_percent": { - "type": "number" - }, - "destination": { - "type": "string" - } - }, - "required": [ - "destination" - ], - "title": "transfer_data_specs", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "default_settings_params", - "type": "object" - }, - "end_behavior": { - "description": "Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription.", - "enum": [ - "cancel", - "none", - "release", - "renew" - ], - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "phases": { - "description": "List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted.", - "items": { - "properties": { - "add_invoice_items": { - "items": { - "properties": { - "price": { - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product" - ], - "title": "one_time_price_data_with_negative_amounts", - "type": "object" - }, - "quantity": { - "type": "integer" - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "add_invoice_item_entry", - "type": "object" - }, - "type": "array" - }, - "application_fee_percent": { - "type": "number" - }, - "automatic_tax": { - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "automatic_tax_config", - "type": "object" - }, - "billing_cycle_anchor": { - "enum": [ - "automatic", - "phase_start" - ], - "type": "string" - }, - "billing_thresholds": { - "anyOf": [ - { - "properties": { - "amount_gte": { - "type": "integer" - }, - "reset_billing_cycle_anchor": { - "type": "boolean" - } - }, - "title": "billing_thresholds_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "collection_method": { - "enum": [ - "charge_automatically", - "send_invoice" - ], - "type": "string" - }, - "coupon": { - "maxLength": 5000, - "type": "string" - }, - "default_payment_method": { - "maxLength": 5000, - "type": "string" - }, - "default_tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "description": { - "maxLength": 500, - "type": "string" - }, - "end_date": { - "anyOf": [ - { - "type": "integer" - }, - { - "enum": [ - "now" - ], - "maxLength": 5000, - "type": "string" - } - ] - }, - "invoice_settings": { - "properties": { - "days_until_due": { - "type": "integer" - } - }, - "title": "subscription_schedules_param", - "type": "object" - }, - "items": { - "items": { - "properties": { - "billing_thresholds": { - "anyOf": [ - { - "properties": { - "usage_gte": { - "type": "integer" - } - }, - "required": [ - "usage_gte" - ], - "title": "item_billing_thresholds_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "price": { - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "recurring": { - "properties": { - "interval": { - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - } - }, - "required": [ - "interval" - ], - "title": "recurring_adhoc", - "type": "object" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product", - "recurring" - ], - "title": "recurring_price_data", - "type": "object" - }, - "quantity": { - "type": "integer" - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "configuration_item_params", - "type": "object" - }, - "type": "array" - }, - "iterations": { - "type": "integer" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "on_behalf_of": { - "type": "string" - }, - "proration_behavior": { - "enum": [ - "always_invoice", - "create_prorations", - "none" - ], - "type": "string" - }, - "start_date": { - "anyOf": [ - { - "type": "integer" - }, - { - "enum": [ - "now" - ], - "maxLength": 5000, - "type": "string" - } - ] - }, - "transfer_data": { - "properties": { - "amount_percent": { - "type": "number" - }, - "destination": { - "type": "string" - } - }, - "required": [ - "destination" - ], - "title": "transfer_data_specs", - "type": "object" - }, - "trial": { - "type": "boolean" - }, - "trial_end": { - "anyOf": [ - { - "type": "integer" - }, - { - "enum": [ - "now" - ], - "maxLength": 5000, - "type": "string" - } - ] - } - }, - "required": [ - "items" - ], - "title": "phase_configuration_params", - "type": "object" - }, - "type": "array" - }, - "proration_behavior": { - "description": "If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`.", - "enum": [ - "always_invoice", - "create_prorations", - "none" - ], - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/subscription_schedule" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/subscription_schedules/{schedule}/cancel": { - "post": { - "description": "Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started
or active
.
Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started
or active
. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription
property and set the subscription’s ID to the released_subscription
property.
By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled
.
Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions.
\n\nWhen you create a subscription with collection_method=charge_automatically
, the first invoice is finalized as part of the request.\nThe payment_behavior
parameter determines the exact behavior of the initial payment.
To start subscriptions where the first invoice always begins in a draft
status, use subscription schedules instead.\nSchedules provide the flexibility to model more complex billing configurations that change over time.
Search for subscriptions you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
", - "operationId": "GetSubscriptionsSearch", - "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" - }, - { - "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": "A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.", - "in": "query", - "name": "page", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for subscriptions](https://stripe.com/docs/search#query-fields-for-subscriptions).", - "in": "query", - "name": "query", - "required": true, - "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/subscription" - }, - "type": "array" - }, - "has_more": { - "type": "boolean" - }, - "next_page": { - "maxLength": 5000, - "nullable": true, - "type": "string" - }, - "object": { - "description": "String representing the object's type. Objects of the same type share the same value.", - "enum": [ - "search_result" - ], - "type": "string" - }, - "total_count": { - "description": "The total number of objects that match the query, only accurate up to 10,000.", - "type": "integer" - }, - "url": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "SearchResult", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/subscriptions/{subscription_exposed_id}": { - "delete": { - "description": "Cancels a customer’s subscription immediately. The customer will not be charged again for the subscription.
\n\nNote, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
\n\nBy default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
", - "operationId": "DeleteSubscriptionsSubscriptionExposedId", - "parameters": [ - { - "in": "path", - "name": "subscription_exposed_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" - }, - "invoice_now": { - "description": "Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items.", - "type": "boolean" - }, - "prorate": { - "description": "Will generate a proration invoice item that credits remaining unused time until the subscription period end.", - "type": "boolean" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/subscription" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "Retrieves the subscription with the given ID.
", - "operationId": "GetSubscriptionsSubscriptionExposedId", - "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": "subscription_exposed_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/subscription" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates an existing subscription on a customer to match the specified parameters. When changing plans or quantities, we will optionally prorate the price we charge next month to make up for any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint.
", - "operationId": "PostSubscriptionsSubscriptionExposedId", - "parameters": [ - { - "in": "path", - "name": "subscription_exposed_id", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "add_invoice_items": { - "explode": true, - "style": "deepObject" - }, - "automatic_tax": { - "explode": true, - "style": "deepObject" - }, - "billing_thresholds": { - "explode": true, - "style": "deepObject" - }, - "cancel_at": { - "explode": true, - "style": "deepObject" - }, - "default_tax_rates": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "items": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "on_behalf_of": { - "explode": true, - "style": "deepObject" - }, - "pause_collection": { - "explode": true, - "style": "deepObject" - }, - "payment_settings": { - "explode": true, - "style": "deepObject" - }, - "pending_invoice_item_interval": { - "explode": true, - "style": "deepObject" - }, - "transfer_data": { - "explode": true, - "style": "deepObject" - }, - "trial_end": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "add_invoice_items": { - "description": "A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items.", - "items": { - "properties": { - "price": { - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product" - ], - "title": "one_time_price_data_with_negative_amounts", - "type": "object" - }, - "quantity": { - "type": "integer" - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "add_invoice_item_entry", - "type": "object" - }, - "type": "array" - }, - "application_fee_percent": { - "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).", - "type": "number" - }, - "automatic_tax": { - "description": "Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed.", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "required": [ - "enabled" - ], - "title": "automatic_tax_config", - "type": "object" - }, - "billing_cycle_anchor": { - "description": "Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).", - "enum": [ - "now", - "unchanged" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "billing_thresholds": { - "anyOf": [ - { - "properties": { - "amount_gte": { - "type": "integer" - }, - "reset_billing_cycle_anchor": { - "type": "boolean" - } - }, - "title": "billing_thresholds_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds." - }, - "cancel_at": { - "anyOf": [ - { - "format": "unix-time", - "type": "integer" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period." - }, - "cancel_at_period_end": { - "description": "Boolean indicating whether this subscription should cancel at the end of the current period.", - "type": "boolean" - }, - "collection_method": { - "description": "Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`.", - "enum": [ - "charge_automatically", - "send_invoice" - ], - "type": "string" - }, - "coupon": { - "description": "The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription.", - "maxLength": 5000, - "type": "string" - }, - "days_until_due": { - "description": "Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`.", - "type": "integer" - }, - "default_payment_method": { - "description": "ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).", - "maxLength": 5000, - "type": "string" - }, - "default_source": { - "description": "ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).", - "maxLength": 5000, - "type": "string" - }, - "default_tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. Pass an empty string to remove previously-defined tax rates." - }, - "description": { - "description": "The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces.", - "maxLength": 500, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "items": { - "description": "A list of up to 20 subscription items, each with an attached price.", - "items": { - "properties": { - "billing_thresholds": { - "anyOf": [ - { - "properties": { - "usage_gte": { - "type": "integer" - } - }, - "required": [ - "usage_gte" - ], - "title": "item_billing_thresholds_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "clear_usage": { - "type": "boolean" - }, - "deleted": { - "type": "boolean" - }, - "id": { - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "price": { - "maxLength": 5000, - "type": "string" - }, - "price_data": { - "properties": { - "currency": { - "type": "string" - }, - "product": { - "maxLength": 5000, - "type": "string" - }, - "recurring": { - "properties": { - "interval": { - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - } - }, - "required": [ - "interval" - ], - "title": "recurring_adhoc", - "type": "object" - }, - "tax_behavior": { - "enum": [ - "exclusive", - "inclusive", - "unspecified" - ], - "type": "string" - }, - "unit_amount": { - "type": "integer" - }, - "unit_amount_decimal": { - "format": "decimal", - "type": "string" - } - }, - "required": [ - "currency", - "product", - "recurring" - ], - "title": "recurring_price_data", - "type": "object" - }, - "quantity": { - "type": "integer" - }, - "tax_rates": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "subscription_item_update_params", - "type": "object" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "off_session": { - "description": "Indicates if a customer is on or off-session while an invoice payment is attempted.", - "type": "boolean" - }, - "on_behalf_of": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The account on behalf of which to charge, for each of the subscription's invoices." - }, - "pause_collection": { - "anyOf": [ - { - "properties": { - "behavior": { - "enum": [ - "keep_as_draft", - "mark_uncollectible", - "void" - ], - "type": "string" - }, - "resumes_at": { - "format": "unix-time", - "type": "integer" - } - }, - "required": [ - "behavior" - ], - "title": "pause_collection_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "If specified, payment collection for this subscription will be paused." - }, - "payment_behavior": { - "description": "Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior.\n\nUse `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method.\n\nUse `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes).\n\nUse `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.", - "enum": [ - "allow_incomplete", - "default_incomplete", - "error_if_incomplete", - "pending_if_incomplete" - ], - "type": "string" - }, - "payment_settings": { - "description": "Payment settings to pass to invoices created by the subscription.", - "properties": { - "payment_method_options": { - "properties": { - "acss_debit": { - "anyOf": [ - { - "properties": { - "mandate_options": { - "properties": { - "transaction_type": { - "enum": [ - "business", - "personal" - ], - "type": "string" - } - }, - "title": "mandate_options_param", - "type": "object" - }, - "verification_method": { - "enum": [ - "automatic", - "instant", - "microdeposits" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "bancontact": { - "anyOf": [ - { - "properties": { - "preferred_language": { - "enum": [ - "de", - "en", - "fr", - "nl" - ], - "type": "string" - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "card": { - "anyOf": [ - { - "properties": { - "mandate_options": { - "properties": { - "amount": { - "type": "integer" - }, - "amount_type": { - "enum": [ - "fixed", - "maximum" - ], - "type": "string" - }, - "description": { - "maxLength": 200, - "type": "string" - } - }, - "title": "mandate_options_param", - "type": "object" - }, - "network": { - "enum": [ - "amex", - "cartes_bancaires", - "diners", - "discover", - "interac", - "jcb", - "mastercard", - "unionpay", - "unknown", - "visa" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "request_three_d_secure": { - "enum": [ - "any", - "automatic" - ], - "type": "string" - } - }, - "title": "subscription_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "customer_balance": { - "anyOf": [ - { - "properties": { - "bank_transfer": { - "properties": { - "eu_bank_transfer": { - "properties": { - "country": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "country" - ], - "title": "eu_bank_transfer_param", - "type": "object" - }, - "type": { - "type": "string" - } - }, - "title": "bank_transfer_param", - "type": "object" - }, - "funding_type": { - "type": "string" - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "konbini": { - "anyOf": [ - { - "properties": { - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "us_bank_account": { - "anyOf": [ - { - "properties": { - "financial_connections": { - "properties": { - "permissions": { - "items": { - "enum": [ - "balances", - "ownership", - "payment_method", - "transactions" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - } - }, - "title": "invoice_linked_account_options_param", - "type": "object" - }, - "verification_method": { - "enum": [ - "automatic", - "instant", - "microdeposits" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "title": "invoice_payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "payment_method_options", - "type": "object" - }, - "payment_method_types": { - "anyOf": [ - { - "items": { - "enum": [ - "ach_credit_transfer", - "ach_debit", - "acss_debit", - "au_becs_debit", - "bacs_debit", - "bancontact", - "boleto", - "card", - "customer_balance", - "fpx", - "giropay", - "grabpay", - "ideal", - "konbini", - "link", - "paynow", - "promptpay", - "sepa_debit", - "sofort", - "us_bank_account", - "wechat_pay" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "save_default_payment_method": { - "enum": [ - "off", - "on_subscription" - ], - "type": "string" - } - }, - "title": "payment_settings", - "type": "object" - }, - "pending_invoice_item_interval": { - "anyOf": [ - { - "properties": { - "interval": { - "enum": [ - "day", - "month", - "week", - "year" - ], - "type": "string" - }, - "interval_count": { - "type": "integer" - } - }, - "required": [ - "interval" - ], - "title": "pending_invoice_item_interval_params", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval." - }, - "promotion_code": { - "description": "The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription.", - "maxLength": 5000, - "type": "string" - }, - "proration_behavior": { - "description": "Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes.", - "enum": [ - "always_invoice", - "create_prorations", - "none" - ], - "type": "string" - }, - "proration_date": { - "description": "If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations.", - "format": "unix-time", - "type": "integer" - }, - "transfer_data": { - "anyOf": [ - { - "properties": { - "amount_percent": { - "type": "number" - }, - "destination": { - "type": "string" - } - }, - "required": [ - "destination" - ], - "title": "transfer_data_specs", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. This will be unset if you POST an empty value." - }, - "trial_end": { - "anyOf": [ - { - "enum": [ - "now" - ], - "maxLength": 5000, - "type": "string" - }, - { - "format": "unix-time", - "type": "integer" - } - ], - "description": "Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`." - }, - "trial_from_plan": { - "description": "Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.", - "type": "boolean" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/subscription" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/subscriptions/{subscription_exposed_id}/discount": { - "delete": { - "description": "Removes the currently applied discount on a subscription.
", - "operationId": "DeleteSubscriptionsSubscriptionExposedIdDiscount", - "parameters": [ - { - "in": "path", - "name": "subscription_exposed_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/deleted_discount" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/tax_codes": { - "get": { - "description": "A list of all tax codes available to add to Products in order to allow specific tax calculations.
", - "operationId": "GetTaxCodes", - "parameters": [ - { - "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": { - "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": "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": { - "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/tax_code" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "TaxProductResourceTaxCodeList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/tax_codes/{id}": { - "get": { - "description": "Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information.
", - "operationId": "GetTaxCodesId", - "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/tax_code" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/tax_rates": { - "get": { - "description": "Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first.
", - "operationId": "GetTaxRates", - "parameters": [ - { - "description": "Optional flag to filter by tax rates that are either active or inactive (archived).", - "in": "query", - "name": "active", - "required": false, - "schema": { - "type": "boolean" - }, - "style": "form" - }, - { - "description": "Optional range for filtering created date.", - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": "Optional flag to filter by tax rates that are inclusive (or those that are not inclusive).", - "in": "query", - "name": "inclusive", - "required": false, - "schema": { - "type": "boolean" - }, - "style": "form" - }, - { - "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": "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/tax_rate" - }, - "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/tax_rates", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "TaxRatesList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a new tax rate.
", - "operationId": "PostTaxRates", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "active": { - "description": "Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set.", - "type": "boolean" - }, - "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" - }, - "description": { - "description": "An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.", - "maxLength": 5000, - "type": "string" - }, - "display_name": { - "description": "The display name of the tax rate, which will be shown to users.", - "maxLength": 50, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "inclusive": { - "description": "This specifies if the tax rate is inclusive or exclusive.", - "type": "boolean" - }, - "jurisdiction": { - "description": "The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.", - "maxLength": 50, - "type": "string" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "percentage": { - "description": "This represents the tax rate percent out of 100.", - "type": "number" - }, - "state": { - "description": "[ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, \"NY\" for New York, United States.", - "maxLength": 2, - "type": "string" - }, - "tax_type": { - "description": "The high-level tax type, such as `vat` or `sales_tax`.", - "enum": [ - "gst", - "hst", - "jct", - "pst", - "qst", - "rst", - "sales_tax", - "vat" - ], - "type": "string" - } - }, - "required": [ - "display_name", - "inclusive", - "percentage" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/tax_rate" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/tax_rates/{tax_rate}": { - "get": { - "description": "Retrieves a tax rate with the given ID
", - "operationId": "GetTaxRatesTaxRate", - "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": "tax_rate", - "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/tax_rate" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates an existing tax rate.
", - "operationId": "PostTaxRatesTaxRate", - "parameters": [ - { - "in": "path", - "name": "tax_rate", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "active": { - "description": "Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set.", - "type": "boolean" - }, - "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" - }, - "description": { - "description": "An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.", - "maxLength": 5000, - "type": "string" - }, - "display_name": { - "description": "The display name of the tax rate, which will be shown to users.", - "maxLength": 50, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "jurisdiction": { - "description": "The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.", - "maxLength": 50, - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "state": { - "description": "[ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, \"NY\" for New York, United States.", - "maxLength": 2, - "type": "string" - }, - "tax_type": { - "description": "The high-level tax type, such as `vat` or `sales_tax`.", - "enum": [ - "gst", - "hst", - "jct", - "pst", - "qst", - "rst", - "sales_tax", - "vat" - ], - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/tax_rate" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/terminal/configurations": { - "get": { - "description": "Returns a list of Configuration
objects.
Creates a new Configuration
object.
Deletes a Configuration
object.
Retrieves a Configuration
object.
Updates a new Configuration
object.
To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token.
", - "operationId": "PostTerminalConnectionTokens", - "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" - }, - "location": { - "description": "The id of the location that this connection token is scoped to. If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://stripe.com/docs/terminal/fleet/locations#connection-tokens).", - "maxLength": 5000, - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/terminal.connection_token" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/terminal/locations": { - "get": { - "description": "Returns a list of Location
objects.
Creates a new Location
object.\nFor further details, including which address fields are required in each country, see the Manage locations guide.
Deletes a Location
object.
Retrieves a Location
object.
Updates a Location
object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Returns a list of Reader
objects.
Creates a new Reader
object.
Deletes a Reader
object.
Retrieves a Reader
object.
Updates a Reader
object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Cancels the current reader action.
", - "operationId": "PostTerminalReadersReaderCancelAction", - "parameters": [ - { - "in": "path", - "name": "reader", - "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/terminal.reader" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/terminal/readers/{reader}/process_payment_intent": { - "post": { - "description": "Initiates a payment flow on a Reader.
", - "operationId": "PostTerminalReadersReaderProcessPaymentIntent", - "parameters": [ - { - "in": "path", - "name": "reader", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "process_config": { - "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" - }, - "payment_intent": { - "description": "PaymentIntent ID", - "maxLength": 5000, - "type": "string" - }, - "process_config": { - "description": "Configuration overrides", - "properties": { - "skip_tipping": { - "type": "boolean" - }, - "tipping": { - "properties": { - "amount_eligible": { - "type": "integer" - } - }, - "title": "tipping_config", - "type": "object" - } - }, - "title": "process_config", - "type": "object" - } - }, - "required": [ - "payment_intent" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/terminal.reader" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/terminal/readers/{reader}/process_setup_intent": { - "post": { - "description": "Initiates a setup intent flow on a Reader.
", - "operationId": "PostTerminalReadersReaderProcessSetupIntent", - "parameters": [ - { - "in": "path", - "name": "reader", - "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": { - "customer_consent_collected": { - "description": "Customer Consent Collected", - "type": "boolean" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "setup_intent": { - "description": "SetupIntent ID", - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "customer_consent_collected", - "setup_intent" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/terminal.reader" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/terminal/readers/{reader}/set_reader_display": { - "post": { - "description": "Sets reader display to show cart details.
", - "operationId": "PostTerminalReadersReaderSetReaderDisplay", - "parameters": [ - { - "in": "path", - "name": "reader", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "cart": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "cart": { - "description": "Cart", - "properties": { - "currency": { - "type": "string" - }, - "line_items": { - "items": { - "properties": { - "amount": { - "type": "integer" - }, - "description": { - "maxLength": 5000, - "type": "string" - }, - "quantity": { - "type": "integer" - } - }, - "required": [ - "amount", - "description", - "quantity" - ], - "title": "line_item", - "type": "object" - }, - "type": "array" - }, - "tax": { - "type": "integer" - }, - "total": { - "type": "integer" - } - }, - "required": [ - "currency", - "line_items", - "total" - ], - "title": "cart", - "type": "object" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "type": { - "description": "Type", - "enum": [ - "cart" - ], - "type": "string" - } - }, - "required": [ - "type" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/terminal.reader" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/test_helpers/customers/{customer}/fund_cash_balance": { - "post": { - "description": "Create an incoming testmode bank transfer
", - "operationId": "PostTestHelpersCustomersCustomerFundCashBalance", - "parameters": [ - { - "in": "path", - "name": "customer", - "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": { - "amount": { - "description": "Amount to be used for this test cash balance transaction. A positive integer representing how much to fund in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to fund $1.00 or 100 to fund ¥100, a zero-decimal currency).", - "type": "integer" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "reference": { - "description": "A description of the test funding. This simulates free-text references supplied by customers when making bank transfers to their cash balance. You can use this to test how Stripe's [reconciliation algorithm](https://stripe.com/docs/payments/customer-balance/reconciliation) applies to different user inputs.", - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "amount", - "currency" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/customer_cash_balance_transaction" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/test_helpers/issuing/cards/{card}/shipping/deliver": { - "post": { - "description": "Updates the shipping status of the specified Issuing Card
object to delivered
.
Updates the shipping status of the specified Issuing Card
object to failure
.
Updates the shipping status of the specified Issuing Card
object to returned
.
Updates the shipping status of the specified Issuing Card
object to shipped
.
Expire a refund with a status of requires_action
.
Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
", - "operationId": "PostTestHelpersTerminalReadersReaderPresentPaymentMethod", - "parameters": [ - { - "in": "path", - "name": "reader", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "card_present": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "card_present": { - "description": "Simulated data for the card_present payment method", - "properties": { - "number": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "card_present", - "type": "object" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "type": { - "description": "Simulated payment type", - "enum": [ - "card_present" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/terminal.reader" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/test_helpers/test_clocks": { - "get": { - "description": "Returns a list of your test clocks.
", - "operationId": "GetTestHelpersTestClocks", - "parameters": [ - { - "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": "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/test_helpers.test_clock" - }, - "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/test_helpers/test_clocks", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "BillingClocksResourceBillingClockList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a new test clock that can be attached to new customers and quotes.
", - "operationId": "PostTestHelpersTestClocks", - "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" - }, - "frozen_time": { - "description": "The initial frozen time for this test clock.", - "format": "unix-time", - "type": "integer" - }, - "name": { - "description": "The name for this test clock.", - "maxLength": 300, - "type": "string" - } - }, - "required": [ - "frozen_time" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/test_helpers.test_clock" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/test_helpers/test_clocks/{test_clock}": { - "delete": { - "description": "Deletes a test clock.
", - "operationId": "DeleteTestHelpersTestClocksTestClock", - "parameters": [ - { - "in": "path", - "name": "test_clock", - "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/deleted_test_helpers.test_clock" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "Retrieves a test clock.
", - "operationId": "GetTestHelpersTestClocksTestClock", - "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": "test_clock", - "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/test_helpers.test_clock" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/test_helpers/test_clocks/{test_clock}/advance": { - "post": { - "description": "Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready
.
Transitions a test mode created InboundTransfer to the failed
status. The InboundTransfer must already be in the processing
state.
Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded
state.
Transitions a test mode created InboundTransfer to the succeeded
status. The InboundTransfer must already be in the processing
state.
Transitions a test mode created OutboundPayment to the failed
status. The OutboundPayment must already be in the processing
state.
Transitions a test mode created OutboundPayment to the posted
status. The OutboundPayment must already be in the processing
state.
Transitions a test mode created OutboundPayment to the returned
status. The OutboundPayment must already be in the processing
state.
Transitions a test mode created OutboundTransfer to the failed
status. The OutboundTransfer must already be in the processing
state.
Transitions a test mode created OutboundTransfer to the posted
status. The OutboundTransfer must already be in the processing
state.
Transitions a test mode created OutboundTransfer to the returned
status. The OutboundTransfer must already be in the processing
state.
Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can’t directly create ReceivedCredits initiated by third parties.
", - "operationId": "PostTestHelpersTreasuryReceivedCredits", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "initiating_payment_method_details": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "Amount (in cents) to be transferred.", - "type": "integer" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "description": { - "description": "An arbitrary string attached to the object. Often useful for displaying to users.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "financial_account": { - "description": "The FinancialAccount to send funds to.", - "type": "string" - }, - "initiating_payment_method_details": { - "description": "Initiating payment method details for the object.", - "properties": { - "type": { - "enum": [ - "us_bank_account" - ], - "type": "string" - }, - "us_bank_account": { - "properties": { - "account_holder_name": { - "maxLength": 5000, - "type": "string" - }, - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "routing_number": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "us_bank_account_source_params", - "type": "object" - } - }, - "required": [ - "type" - ], - "title": "source_params", - "type": "object" - }, - "network": { - "description": "The rails used for the object.", - "enum": [ - "ach", - "us_domestic_wire" - ], - "type": "string" - } - }, - "required": [ - "amount", - "currency", - "financial_account", - "network" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/treasury.received_credit" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/test_helpers/treasury/received_debits": { - "post": { - "description": "Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can’t directly create ReceivedDebits initiated by third parties.
", - "operationId": "PostTestHelpersTreasuryReceivedDebits", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "initiating_payment_method_details": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "Amount (in cents) to be transferred.", - "type": "integer" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "description": { - "description": "An arbitrary string attached to the object. Often useful for displaying to users.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "financial_account": { - "description": "The FinancialAccount to pull funds from.", - "type": "string" - }, - "initiating_payment_method_details": { - "description": "Initiating payment method details for the object.", - "properties": { - "type": { - "enum": [ - "us_bank_account" - ], - "type": "string" - }, - "us_bank_account": { - "properties": { - "account_holder_name": { - "maxLength": 5000, - "type": "string" - }, - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "routing_number": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "us_bank_account_source_params", - "type": "object" - } - }, - "required": [ - "type" - ], - "title": "source_params", - "type": "object" - }, - "network": { - "description": "The rails used for the object.", - "enum": [ - "ach" - ], - "type": "string" - } - }, - "required": [ - "amount", - "currency", - "financial_account", - "network" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/treasury.received_debit" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/tokens": { - "post": { - "description": "Creates a single-use token that represents a bank account’s details.\nThis token can be used with any API method in place of a bank account dictionary. This token can be used only once, by attaching it to a Custom account.
", - "operationId": "PostTokens", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "account": { - "explode": true, - "style": "deepObject" - }, - "bank_account": { - "explode": true, - "style": "deepObject" - }, - "card": { - "explode": true, - "style": "deepObject" - }, - "cvc_update": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "person": { - "explode": true, - "style": "deepObject" - }, - "pii": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "account": { - "description": "Information for the account this token will represent.", - "properties": { - "business_type": { - "enum": [ - "company", - "government_entity", - "individual", - "non_profit" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "company": { - "properties": { - "address": { - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "address_kana": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kana_specs", - "type": "object" - }, - "address_kanji": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kanji_specs", - "type": "object" - }, - "directors_provided": { - "type": "boolean" - }, - "executives_provided": { - "type": "boolean" - }, - "name": { - "maxLength": 100, - "type": "string" - }, - "name_kana": { - "maxLength": 100, - "type": "string" - }, - "name_kanji": { - "maxLength": 100, - "type": "string" - }, - "owners_provided": { - "type": "boolean" - }, - "ownership_declaration": { - "properties": { - "date": { - "format": "unix-time", - "type": "integer" - }, - "ip": { - "type": "string" - }, - "user_agent": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "company_ownership_declaration", - "type": "object" - }, - "ownership_declaration_shown_and_signed": { - "type": "boolean" - }, - "phone": { - "maxLength": 5000, - "type": "string" - }, - "registration_number": { - "maxLength": 5000, - "type": "string" - }, - "structure": { - "enum": [ - "", - "free_zone_establishment", - "free_zone_llc", - "government_instrumentality", - "governmental_unit", - "incorporated_non_profit", - "limited_liability_partnership", - "llc", - "multi_member_llc", - "private_company", - "private_corporation", - "private_partnership", - "public_company", - "public_corporation", - "public_partnership", - "single_member_llc", - "sole_establishment", - "sole_proprietorship", - "tax_exempt_government_instrumentality", - "unincorporated_association", - "unincorporated_non_profit" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "tax_id": { - "maxLength": 5000, - "type": "string" - }, - "tax_id_registrar": { - "maxLength": 5000, - "type": "string" - }, - "vat_id": { - "maxLength": 5000, - "type": "string" - }, - "verification": { - "properties": { - "document": { - "properties": { - "back": { - "maxLength": 500, - "type": "string" - }, - "front": { - "maxLength": 500, - "type": "string" - } - }, - "title": "verification_document_specs", - "type": "object" - } - }, - "title": "verification_specs", - "type": "object" - } - }, - "title": "connect_js_account_token_company_specs", - "type": "object" - }, - "individual": { - "properties": { - "address": { - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "address_kana": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kana_specs", - "type": "object" - }, - "address_kanji": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kanji_specs", - "type": "object" - }, - "dob": { - "anyOf": [ - { - "properties": { - "day": { - "type": "integer" - }, - "month": { - "type": "integer" - }, - "year": { - "type": "integer" - } - }, - "required": [ - "day", - "month", - "year" - ], - "title": "date_of_birth_specs", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "email": { - "type": "string" - }, - "first_name": { - "maxLength": 100, - "type": "string" - }, - "first_name_kana": { - "maxLength": 5000, - "type": "string" - }, - "first_name_kanji": { - "maxLength": 5000, - "type": "string" - }, - "full_name_aliases": { - "anyOf": [ - { - "items": { - "maxLength": 300, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "gender": { - "type": "string" - }, - "id_number": { - "maxLength": 5000, - "type": "string" - }, - "id_number_secondary": { - "maxLength": 5000, - "type": "string" - }, - "last_name": { - "maxLength": 100, - "type": "string" - }, - "last_name_kana": { - "maxLength": 5000, - "type": "string" - }, - "last_name_kanji": { - "maxLength": 5000, - "type": "string" - }, - "maiden_name": { - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "phone": { - "type": "string" - }, - "political_exposure": { - "enum": [ - "existing", - "none" - ], - "type": "string" - }, - "registered_address": { - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "ssn_last_4": { - "maxLength": 5000, - "type": "string" - }, - "verification": { - "properties": { - "additional_document": { - "properties": { - "back": { - "maxLength": 500, - "type": "string" - }, - "front": { - "maxLength": 500, - "type": "string" - } - }, - "title": "person_verification_document_specs", - "type": "object" - }, - "document": { - "properties": { - "back": { - "maxLength": 500, - "type": "string" - }, - "front": { - "maxLength": 500, - "type": "string" - } - }, - "title": "person_verification_document_specs", - "type": "object" - } - }, - "title": "person_verification_specs", - "type": "object" - } - }, - "title": "individual_specs", - "type": "object" - }, - "tos_shown_and_accepted": { - "type": "boolean" - } - }, - "title": "connect_js_account_token_specs", - "type": "object" - }, - "bank_account": { - "description": "The bank account this token will represent.", - "properties": { - "account_holder_name": { - "maxLength": 5000, - "type": "string" - }, - "account_holder_type": { - "enum": [ - "company", - "individual" - ], - "maxLength": 5000, - "type": "string" - }, - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "account_type": { - "enum": [ - "checking", - "futsu", - "savings", - "toza" - ], - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "currency": { - "type": "string" - }, - "routing_number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "account_number", - "country" - ], - "title": "token_create_bank_account", - "type": "object", - "x-stripeBypassValidation": true - }, - "card": { - "anyOf": [ - { - "properties": { - "address_city": { - "maxLength": 5000, - "type": "string" - }, - "address_country": { - "maxLength": 5000, - "type": "string" - }, - "address_line1": { - "maxLength": 5000, - "type": "string" - }, - "address_line2": { - "maxLength": 5000, - "type": "string" - }, - "address_state": { - "maxLength": 5000, - "type": "string" - }, - "address_zip": { - "maxLength": 5000, - "type": "string" - }, - "currency": { - "maxLength": 5000, - "type": "string" - }, - "cvc": { - "maxLength": 5000, - "type": "string" - }, - "exp_month": { - "maxLength": 5000, - "type": "string" - }, - "exp_year": { - "maxLength": 5000, - "type": "string" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "exp_month", - "exp_year", - "number" - ], - "title": "credit_card_specs", - "type": "object" - }, - { - "maxLength": 5000, - "type": "string" - } - ], - "x-stripeBypassValidation": true - }, - "customer": { - "description": "The customer (owned by the application's account) for which to create a token. This can be used only with an [OAuth access token](https://stripe.com/docs/connect/standard-accounts) or [Stripe-Account header](https://stripe.com/docs/connect/authentication). For more details, see [Cloning Saved Payment Methods](https://stripe.com/docs/connect/cloning-saved-payment-methods).", - "maxLength": 5000, - "type": "string" - }, - "cvc_update": { - "description": "The updated CVC value this token will represent.", - "properties": { - "cvc": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "cvc" - ], - "title": "cvc_params", - "type": "object" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "person": { - "description": "Information for the person this token will represent.", - "properties": { - "address": { - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "address_kana": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kana_specs", - "type": "object" - }, - "address_kanji": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - }, - "town": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "japan_address_kanji_specs", - "type": "object" - }, - "dob": { - "anyOf": [ - { - "properties": { - "day": { - "type": "integer" - }, - "month": { - "type": "integer" - }, - "year": { - "type": "integer" - } - }, - "required": [ - "day", - "month", - "year" - ], - "title": "date_of_birth_specs", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "documents": { - "properties": { - "company_authorization": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "passport": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - }, - "visa": { - "properties": { - "files": { - "items": { - "maxLength": 500, - "type": "string" - }, - "type": "array" - } - }, - "title": "documents_param", - "type": "object" - } - }, - "title": "person_documents_specs", - "type": "object" - }, - "email": { - "type": "string" - }, - "first_name": { - "maxLength": 5000, - "type": "string" - }, - "first_name_kana": { - "maxLength": 5000, - "type": "string" - }, - "first_name_kanji": { - "maxLength": 5000, - "type": "string" - }, - "full_name_aliases": { - "anyOf": [ - { - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "gender": { - "type": "string" - }, - "id_number": { - "maxLength": 5000, - "type": "string" - }, - "id_number_secondary": { - "maxLength": 5000, - "type": "string" - }, - "last_name": { - "maxLength": 5000, - "type": "string" - }, - "last_name_kana": { - "maxLength": 5000, - "type": "string" - }, - "last_name_kanji": { - "maxLength": 5000, - "type": "string" - }, - "maiden_name": { - "maxLength": 5000, - "type": "string" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "nationality": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "type": "string" - }, - "political_exposure": { - "maxLength": 5000, - "type": "string" - }, - "registered_address": { - "properties": { - "city": { - "maxLength": 100, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 200, - "type": "string" - }, - "line2": { - "maxLength": 200, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "address_specs", - "type": "object" - }, - "relationship": { - "properties": { - "director": { - "type": "boolean" - }, - "executive": { - "type": "boolean" - }, - "owner": { - "type": "boolean" - }, - "percent_ownership": { - "anyOf": [ - { - "type": "number" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "representative": { - "type": "boolean" - }, - "title": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "relationship_specs", - "type": "object" - }, - "ssn_last_4": { - "type": "string" - }, - "verification": { - "properties": { - "additional_document": { - "properties": { - "back": { - "maxLength": 500, - "type": "string" - }, - "front": { - "maxLength": 500, - "type": "string" - } - }, - "title": "person_verification_document_specs", - "type": "object" - }, - "document": { - "properties": { - "back": { - "maxLength": 500, - "type": "string" - }, - "front": { - "maxLength": 500, - "type": "string" - } - }, - "title": "person_verification_document_specs", - "type": "object" - } - }, - "title": "person_verification_specs", - "type": "object" - } - }, - "title": "person_token_specs", - "type": "object" - }, - "pii": { - "description": "The PII this token will represent.", - "properties": { - "id_number": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "pii_token_specs", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/token" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/tokens/{token}": { - "get": { - "description": "Retrieves the token with the given ID.
", - "operationId": "GetTokensToken", - "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": "token", - "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/token" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/topups": { - "get": { - "description": "Returns a list of top-ups.
", - "operationId": "GetTopups", - "parameters": [ - { - "description": "A positive integer representing how much to transfer.", - "explode": true, - "in": "query", - "name": "amount", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.", - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": "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" - }, - { - "description": "Only return top-ups that have the given status. One of `canceled`, `failed`, `pending` or `succeeded`.", - "in": "query", - "name": "status", - "required": false, - "schema": { - "enum": [ - "canceled", - "failed", - "pending", - "succeeded" - ], - "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/topup" - }, - "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/topups", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "TopupList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Top up the balance of an account
", - "operationId": "PostTopups", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "A positive integer representing how much to transfer.", - "type": "integer" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "description": { - "description": "An arbitrary string attached to the object. Often useful for displaying to users.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "source": { - "description": "The ID of a source to transfer funds from. For most users, this should be left unspecified which will use the bank account that was set up in the dashboard for the specified currency. In test mode, this can be a test bank token (see [Testing Top-ups](https://stripe.com/docs/connect/testing#testing-top-ups)).", - "maxLength": 5000, - "type": "string" - }, - "statement_descriptor": { - "description": "Extra information about a top-up for the source's bank statement. Limited to 15 ASCII characters.", - "maxLength": 15, - "type": "string" - }, - "transfer_group": { - "description": "A string that identifies this top-up as part of a group.", - "type": "string" - } - }, - "required": [ - "amount", - "currency" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/topup" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/topups/{topup}": { - "get": { - "description": "Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information.
", - "operationId": "GetTopupsTopup", - "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": "topup", - "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/topup" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the metadata of a top-up. Other top-up details are not editable by design.
", - "operationId": "PostTopupsTopup", - "parameters": [ - { - "in": "path", - "name": "topup", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "description": { - "description": "An arbitrary string attached to the object. Often useful for displaying to users.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/topup" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/topups/{topup}/cancel": { - "post": { - "description": "Cancels a top-up. Only pending top-ups can be canceled.
", - "operationId": "PostTopupsTopupCancel", - "parameters": [ - { - "in": "path", - "name": "topup", - "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/topup" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/transfers": { - "get": { - "description": "Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first.
", - "operationId": "GetTransfers", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "Only return transfers for the destination specified by this account ID.", - "in": "query", - "name": "destination", - "required": false, - "schema": { - "maxLength": 5000, - "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": "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" - }, - { - "description": "Only return transfers with the specified transfer group.", - "in": "query", - "name": "transfer_group", - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/transfer" - }, - "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/transfers", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "TransferList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "To send funds from your Stripe account to a connected account, you create a new transfer object. Your Stripe balance must be able to cover the transfer amount, or you’ll receive an “Insufficient Funds” error.
", - "operationId": "PostTransfers", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "A positive integer in cents (or local equivalent) representing how much to transfer.", - "type": "integer" - }, - "currency": { - "description": "3-letter [ISO code for currency](https://stripe.com/docs/payouts).", - "type": "string" - }, - "description": { - "description": "An arbitrary string attached to the object. Often useful for displaying to users.", - "maxLength": 5000, - "type": "string" - }, - "destination": { - "description": "The ID of a connected Stripe account. See the Connect documentation for details.", - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "source_transaction": { - "description": "You can use this parameter to transfer funds from a charge before they are added to your available balance. A pending balance will transfer immediately but the funds will not become available until the original charge becomes available. [See the Connect documentation](https://stripe.com/docs/connect/charges-transfers#transfer-availability) for details.", - "type": "string" - }, - "source_type": { - "description": "The source balance to use for this transfer. One of `bank_account`, `card`, or `fpx`. For most users, this will default to `card`.", - "enum": [ - "bank_account", - "card", - "fpx" - ], - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "transfer_group": { - "description": "A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/charges-transfers#transfer-options) for details.", - "type": "string" - } - }, - "required": [ - "currency", - "destination" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/transfer" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/transfers/{id}/reversals": { - "get": { - "description": "You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit
and starting_after
parameters to page through additional reversals.
When you create a new reversal, you must specify a transfer to create it on.
\n\nWhen reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed.
\n\nOnce entirely reversed, a transfer can’t be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer.
", - "operationId": "PostTransfersIdReversals", - "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" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "A positive integer in cents (or local equivalent) representing how much of this transfer to reverse. Can only reverse up to the unreversed amount remaining of the transfer. Partial transfer reversals are only allowed for transfers to Stripe Accounts. Defaults to the entire transfer amount.", - "type": "integer" - }, - "description": { - "description": "An arbitrary string which you can attach to a reversal object. It is displayed alongside the reversal in the Dashboard. This will be unset if you POST an empty value.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "refund_application_fee": { - "description": "Boolean indicating whether the application fee should be refunded when reversing this transfer. If a full transfer reversal is given, the full application fee will be refunded. Otherwise, the application fee will be refunded with an amount proportional to the amount of the transfer reversed.", - "type": "boolean" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/transfer_reversal" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/transfers/{transfer}": { - "get": { - "description": "Retrieves the details of an existing transfer. Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information.
", - "operationId": "GetTransfersTransfer", - "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": "transfer", - "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/transfer" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
\n\nThis request accepts only metadata as an argument.
", - "operationId": "PostTransfersTransfer", - "parameters": [ - { - "in": "path", - "name": "transfer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "description": { - "description": "An arbitrary string attached to the object. Often useful for displaying to users.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/transfer" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/transfers/{transfer}/reversals/{id}": { - "get": { - "description": "By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer.
", - "operationId": "GetTransfersTransferReversalsId", - "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" - }, - { - "in": "path", - "name": "transfer", - "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/transfer_reversal" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
\n\nThis request only accepts metadata and description as arguments.
", - "operationId": "PostTransfersTransferReversalsId", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "in": "path", - "name": "transfer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "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" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/transfer_reversal" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/credit_reversals": { - "get": { - "description": "Returns a list of CreditReversals.
", - "operationId": "GetTreasuryCreditReversals", - "parameters": [ - { - "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": "Returns objects associated with this FinancialAccount.", - "in": "query", - "name": "financial_account", - "required": true, - "schema": { - "type": "string" - }, - "style": "form" - }, - { - "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": "Only return CreditReversals for the ReceivedCredit ID.", - "in": "query", - "name": "received_credit", - "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" - }, - { - "description": "Only return CreditReversals for a given status.", - "in": "query", - "name": "status", - "required": false, - "schema": { - "enum": [ - "canceled", - "posted", - "processing" - ], - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/treasury.credit_reversal" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "TreasuryReceivedCreditsResourceCreditReversalList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Reverses a ReceivedCredit and creates a CreditReversal object.
", - "operationId": "PostTreasuryCreditReversals", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "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" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "received_credit": { - "description": "The ReceivedCredit to reverse.", - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "received_credit" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/treasury.credit_reversal" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/credit_reversals/{credit_reversal}": { - "get": { - "description": "Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list
", - "operationId": "GetTreasuryCreditReversalsCreditReversal", - "parameters": [ - { - "in": "path", - "name": "credit_reversal", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/treasury.credit_reversal" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/debit_reversals": { - "get": { - "description": "Returns a list of DebitReversals.
", - "operationId": "GetTreasuryDebitReversals", - "parameters": [ - { - "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": "Returns objects associated with this FinancialAccount.", - "in": "query", - "name": "financial_account", - "required": true, - "schema": { - "type": "string" - }, - "style": "form" - }, - { - "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": "Only return DebitReversals for the ReceivedDebit ID.", - "in": "query", - "name": "received_debit", - "required": false, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "form" - }, - { - "description": "Only return DebitReversals for a given resolution.", - "in": "query", - "name": "resolution", - "required": false, - "schema": { - "enum": [ - "lost", - "won" - ], - "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" - }, - { - "description": "Only return DebitReversals for a given status.", - "in": "query", - "name": "status", - "required": false, - "schema": { - "enum": [ - "canceled", - "completed", - "processing" - ], - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/treasury.debit_reversal" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "TreasuryReceivedDebitsResourceDebitReversalList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Reverses a ReceivedDebit and creates a DebitReversal object.
", - "operationId": "PostTreasuryDebitReversals", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "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" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "received_debit": { - "description": "The ReceivedDebit to reverse.", - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "received_debit" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/treasury.debit_reversal" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/debit_reversals/{debit_reversal}": { - "get": { - "description": "Retrieves a DebitReversal object.
", - "operationId": "GetTreasuryDebitReversalsDebitReversal", - "parameters": [ - { - "in": "path", - "name": "debit_reversal", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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/treasury.debit_reversal" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/financial_accounts": { - "get": { - "description": "Returns a list of FinancialAccounts.
", - "operationId": "GetTreasuryFinancialAccounts", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "description": "An object ID cursor for use in pagination.", - "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 ranging from 1 to 100 (defaults to 10).", - "in": "query", - "name": "limit", - "required": false, - "schema": { - "type": "integer" - }, - "style": "form" - }, - { - "description": "An object ID cursor for use in pagination.", - "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/treasury.financial_account" - }, - "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/treasury/financial_accounts", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "TreasuryFinancialAccountsResourceFinancialAccountList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount.
", - "operationId": "PostTreasuryFinancialAccounts", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "features": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "platform_restrictions": { - "explode": true, - "style": "deepObject" - }, - "supported_currencies": { - "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" - }, - "features": { - "description": "Encodes whether a FinancialAccount has access to a particular feature. Stripe or the platform can control features via the requested field.", - "properties": { - "card_issuing": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - }, - "deposit_insurance": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - }, - "financial_addresses": { - "properties": { - "aba": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - } - }, - "title": "financial_addresses", - "type": "object" - }, - "inbound_transfers": { - "properties": { - "ach": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access_with_ach_details", - "type": "object" - } - }, - "title": "inbound_transfers", - "type": "object" - }, - "intra_stripe_flows": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - }, - "outbound_payments": { - "properties": { - "ach": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access_with_ach_details", - "type": "object" - }, - "us_domestic_wire": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - } - }, - "title": "outbound_payments", - "type": "object" - }, - "outbound_transfers": { - "properties": { - "ach": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access_with_ach_details", - "type": "object" - }, - "us_domestic_wire": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - } - }, - "title": "outbound_transfers", - "type": "object" - } - }, - "title": "feature_access", - "type": "object" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "platform_restrictions": { - "description": "The set of functionalities that the platform can restrict on the FinancialAccount.", - "properties": { - "inbound_flows": { - "enum": [ - "restricted", - "unrestricted" - ], - "type": "string" - }, - "outbound_flows": { - "enum": [ - "restricted", - "unrestricted" - ], - "type": "string" - } - }, - "title": "platform_restrictions", - "type": "object" - }, - "supported_currencies": { - "description": "The currencies the FinancialAccount can hold a balance in.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "supported_currencies" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/treasury.financial_account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/financial_accounts/{financial_account}": { - "get": { - "description": "Retrieves the details of a FinancialAccount.
", - "operationId": "GetTreasuryFinancialAccountsFinancialAccount", - "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": "financial_account", - "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/treasury.financial_account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the details of a FinancialAccount.
", - "operationId": "PostTreasuryFinancialAccountsFinancialAccount", - "parameters": [ - { - "in": "path", - "name": "financial_account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "features": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "platform_restrictions": { - "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" - }, - "features": { - "description": "Encodes whether a FinancialAccount has access to a particular feature, with a status enum and associated `status_details`. Stripe or the platform may control features via the requested field.", - "properties": { - "card_issuing": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - }, - "deposit_insurance": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - }, - "financial_addresses": { - "properties": { - "aba": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - } - }, - "title": "financial_addresses", - "type": "object" - }, - "inbound_transfers": { - "properties": { - "ach": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access_with_ach_details", - "type": "object" - } - }, - "title": "inbound_transfers", - "type": "object" - }, - "intra_stripe_flows": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - }, - "outbound_payments": { - "properties": { - "ach": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access_with_ach_details", - "type": "object" - }, - "us_domestic_wire": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - } - }, - "title": "outbound_payments", - "type": "object" - }, - "outbound_transfers": { - "properties": { - "ach": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access_with_ach_details", - "type": "object" - }, - "us_domestic_wire": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - } - }, - "title": "outbound_transfers", - "type": "object" - } - }, - "title": "feature_access", - "type": "object" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "platform_restrictions": { - "description": "The set of functionalities that the platform can restrict on the FinancialAccount.", - "properties": { - "inbound_flows": { - "enum": [ - "restricted", - "unrestricted" - ], - "type": "string" - }, - "outbound_flows": { - "enum": [ - "restricted", - "unrestricted" - ], - "type": "string" - } - }, - "title": "platform_restrictions", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/treasury.financial_account" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/financial_accounts/{financial_account}/features": { - "get": { - "description": "Retrieves Features information associated with the FinancialAccount.
", - "operationId": "GetTreasuryFinancialAccountsFinancialAccountFeatures", - "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": "financial_account", - "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/treasury.financial_account_features" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the Features associated with a FinancialAccount.
", - "operationId": "PostTreasuryFinancialAccountsFinancialAccountFeatures", - "parameters": [ - { - "in": "path", - "name": "financial_account", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "card_issuing": { - "explode": true, - "style": "deepObject" - }, - "deposit_insurance": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "financial_addresses": { - "explode": true, - "style": "deepObject" - }, - "inbound_transfers": { - "explode": true, - "style": "deepObject" - }, - "intra_stripe_flows": { - "explode": true, - "style": "deepObject" - }, - "outbound_payments": { - "explode": true, - "style": "deepObject" - }, - "outbound_transfers": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "card_issuing": { - "description": "Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount.", - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - }, - "deposit_insurance": { - "description": "Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount.", - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "financial_addresses": { - "description": "Contains Features that add FinancialAddresses to the FinancialAccount.", - "properties": { - "aba": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - } - }, - "title": "financial_addresses", - "type": "object" - }, - "inbound_transfers": { - "description": "Contains settings related to adding funds to a FinancialAccount from another Account with the same owner.", - "properties": { - "ach": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access_with_ach_details", - "type": "object" - } - }, - "title": "inbound_transfers", - "type": "object" - }, - "intra_stripe_flows": { - "description": "Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment).", - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - }, - "outbound_payments": { - "description": "Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money.", - "properties": { - "ach": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access_with_ach_details", - "type": "object" - }, - "us_domestic_wire": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - } - }, - "title": "outbound_payments", - "type": "object" - }, - "outbound_transfers": { - "description": "Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner.", - "properties": { - "ach": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access_with_ach_details", - "type": "object" - }, - "us_domestic_wire": { - "properties": { - "requested": { - "type": "boolean" - } - }, - "required": [ - "requested" - ], - "title": "access", - "type": "object" - } - }, - "title": "outbound_transfers", - "type": "object" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/treasury.financial_account_features" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/inbound_transfers": { - "get": { - "description": "Returns a list of InboundTransfers sent from the specified FinancialAccount.
", - "operationId": "GetTreasuryInboundTransfers", - "parameters": [ - { - "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": "Returns objects associated with this FinancialAccount.", - "in": "query", - "name": "financial_account", - "required": true, - "schema": { - "type": "string" - }, - "style": "form" - }, - { - "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": "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" - }, - { - "description": "Only return InboundTransfers that have the given status: `processing`, `succeeded`, `failed` or `canceled`.", - "in": "query", - "name": "status", - "required": false, - "schema": { - "enum": [ - "canceled", - "failed", - "processing", - "succeeded" - ], - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/treasury.inbound_transfer" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "TreasuryInboundTransfersResourceInboundTransferList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates an InboundTransfer.
", - "operationId": "PostTreasuryInboundTransfers", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "Amount (in cents) to be transferred.", - "type": "integer" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "description": { - "description": "An arbitrary string attached to the object. Often useful for displaying to users.", - "maxLength": 5000, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "financial_account": { - "description": "The FinancialAccount to send funds to.", - "type": "string" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "origin_payment_method": { - "description": "The origin payment method to be debited for the InboundTransfer.", - "maxLength": 5000, - "type": "string" - }, - "statement_descriptor": { - "description": "The complete description that appears on your customers' statements. Maximum 10 characters.", - "maxLength": 10, - "type": "string" - } - }, - "required": [ - "amount", - "currency", - "financial_account", - "origin_payment_method" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/treasury.inbound_transfer" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/inbound_transfers/{id}": { - "get": { - "description": "Retrieves the details of an existing InboundTransfer.
", - "operationId": "GetTreasuryInboundTransfersId", - "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/treasury.inbound_transfer" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel": { - "post": { - "description": "Cancels an InboundTransfer.
", - "operationId": "PostTreasuryInboundTransfersInboundTransferCancel", - "parameters": [ - { - "in": "path", - "name": "inbound_transfer", - "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/treasury.inbound_transfer" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/outbound_payments": { - "get": { - "description": "Returns a list of OutboundPayments sent from the specified FinancialAccount.
", - "operationId": "GetTreasuryOutboundPayments", - "parameters": [ - { - "description": "Only return OutboundPayments sent to this customer.", - "in": "query", - "name": "customer", - "required": false, - "schema": { - "maxLength": 5000, - "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": "Returns objects associated with this FinancialAccount.", - "in": "query", - "name": "financial_account", - "required": true, - "schema": { - "type": "string" - }, - "style": "form" - }, - { - "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": "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" - }, - { - "description": "Only return OutboundPayments that have the given status: `processing`, `failed`, `posted`, `returned`, or `canceled`.", - "in": "query", - "name": "status", - "required": false, - "schema": { - "enum": [ - "canceled", - "failed", - "posted", - "processing", - "returned" - ], - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/treasury.outbound_payment" - }, - "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/treasury/outbound_payments", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "TreasuryOutboundPaymentsResourceOutboundPaymentList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates an OutboundPayment.
", - "operationId": "PostTreasuryOutboundPayments", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "destination_payment_method_data": { - "explode": true, - "style": "deepObject" - }, - "destination_payment_method_options": { - "explode": true, - "style": "deepObject" - }, - "end_user_details": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "Amount (in cents) to be transferred.", - "type": "integer" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "customer": { - "description": "ID of the customer to whom the OutboundPayment is sent. Must match the Customer attached to the `destination_payment_method` passed in.", - "maxLength": 5000, - "type": "string" - }, - "description": { - "description": "An arbitrary string attached to the object. Often useful for displaying to users.", - "maxLength": 5000, - "type": "string" - }, - "destination_payment_method": { - "description": "The PaymentMethod to use as the payment instrument for the OutboundPayment. Exclusive with `destination_payment_method_data`.", - "maxLength": 5000, - "type": "string" - }, - "destination_payment_method_data": { - "description": "Hash used to generate the PaymentMethod to be used for this OutboundPayment. Exclusive with `destination_payment_method`.", - "properties": { - "billing_details": { - "properties": { - "address": { - "anyOf": [ - { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "billing_details_address", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "email": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "billing_details_inner_params", - "type": "object" - }, - "financial_account": { - "type": "string" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "type": { - "enum": [ - "financial_account", - "us_bank_account" - ], - "type": "string" - }, - "us_bank_account": { - "properties": { - "account_holder_type": { - "enum": [ - "company", - "individual" - ], - "type": "string" - }, - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "account_type": { - "enum": [ - "checking", - "savings" - ], - "type": "string" - }, - "financial_connections_account": { - "maxLength": 5000, - "type": "string" - }, - "routing_number": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "payment_method_param", - "type": "object" - } - }, - "required": [ - "type" - ], - "title": "payment_method_data", - "type": "object" - }, - "destination_payment_method_options": { - "description": "Payment method-specific configuration for this OutboundPayment.", - "properties": { - "us_bank_account": { - "anyOf": [ - { - "properties": { - "network": { - "enum": [ - "ach", - "us_domestic_wire" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "payment_method_options", - "type": "object" - }, - "end_user_details": { - "description": "End user details.", - "properties": { - "ip_address": { - "type": "string" - }, - "present": { - "type": "boolean" - } - }, - "required": [ - "present" - ], - "title": "end_user_details_params", - "type": "object" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "financial_account": { - "description": "The FinancialAccount to pull funds from.", - "type": "string" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "statement_descriptor": { - "description": "The description that appears on the receiving end for this OutboundPayment (for example, bank statement for external bank transfer). Maximum 10 characters for `ach` payments, 140 characters for `wire` payments, or 500 characters for `stripe` network transfers. The default value is `payment`.", - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "amount", - "currency", - "financial_account" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/treasury.outbound_payment" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/outbound_payments/{id}": { - "get": { - "description": "Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list.
", - "operationId": "GetTreasuryOutboundPaymentsId", - "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/treasury.outbound_payment" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/outbound_payments/{id}/cancel": { - "post": { - "description": "Cancel an OutboundPayment.
", - "operationId": "PostTreasuryOutboundPaymentsIdCancel", - "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/treasury.outbound_payment" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/outbound_transfers": { - "get": { - "description": "Returns a list of OutboundTransfers sent from the specified FinancialAccount.
", - "operationId": "GetTreasuryOutboundTransfers", - "parameters": [ - { - "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": "Returns objects associated with this FinancialAccount.", - "in": "query", - "name": "financial_account", - "required": true, - "schema": { - "type": "string" - }, - "style": "form" - }, - { - "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": "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" - }, - { - "description": "Only return OutboundTransfers that have the given status: `processing`, `canceled`, `failed`, `posted`, or `returned`.", - "in": "query", - "name": "status", - "required": false, - "schema": { - "enum": [ - "canceled", - "failed", - "posted", - "processing", - "returned" - ], - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/treasury.outbound_transfer" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "TreasuryOutboundTransfersResourceOutboundTransferList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Creates an OutboundTransfer.
", - "operationId": "PostTreasuryOutboundTransfers", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "destination_payment_method_options": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "amount": { - "description": "Amount (in cents) to be transferred.", - "type": "integer" - }, - "currency": { - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "type": "string" - }, - "description": { - "description": "An arbitrary string attached to the object. Often useful for displaying to users.", - "maxLength": 5000, - "type": "string" - }, - "destination_payment_method": { - "description": "The PaymentMethod to use as the payment instrument for the OutboundTransfer.", - "maxLength": 5000, - "type": "string" - }, - "destination_payment_method_options": { - "description": "Hash describing payment method configuration details.", - "properties": { - "us_bank_account": { - "anyOf": [ - { - "properties": { - "network": { - "enum": [ - "ach", - "us_domestic_wire" - ], - "type": "string" - } - }, - "title": "payment_method_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "payment_method_options", - "type": "object" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "financial_account": { - "description": "The FinancialAccount to pull funds from.", - "type": "string" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", - "type": "object" - }, - "statement_descriptor": { - "description": "Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `wire` transfers. The default value is `transfer`.", - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "amount", - "currency", - "financial_account" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/treasury.outbound_transfer" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/outbound_transfers/{outbound_transfer}": { - "get": { - "description": "Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list.
", - "operationId": "GetTreasuryOutboundTransfersOutboundTransfer", - "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": "outbound_transfer", - "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/treasury.outbound_transfer" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel": { - "post": { - "description": "An OutboundTransfer can be canceled if the funds have not yet been paid out.
", - "operationId": "PostTreasuryOutboundTransfersOutboundTransferCancel", - "parameters": [ - { - "in": "path", - "name": "outbound_transfer", - "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/treasury.outbound_transfer" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/received_credits": { - "get": { - "description": "Returns a list of ReceivedCredits.
", - "operationId": "GetTreasuryReceivedCredits", - "parameters": [ - { - "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": "The FinancialAccount that received the funds.", - "in": "query", - "name": "financial_account", - "required": true, - "schema": { - "type": "string" - }, - "style": "form" - }, - { - "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": "Only return ReceivedCredits described by the flow.", - "explode": true, - "in": "query", - "name": "linked_flows", - "required": false, - "schema": { - "properties": { - "source_flow_type": { - "enum": [ - "credit_reversal", - "other", - "outbound_payment", - "payout" - ], - "type": "string", - "x-stripeBypassValidation": true - } - }, - "required": [ - "source_flow_type" - ], - "title": "linked_flows_param", - "type": "object" - }, - "style": "deepObject" - }, - { - "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" - }, - { - "description": "Only return ReceivedCredits that have the given status: `succeeded` or `failed`.", - "in": "query", - "name": "status", - "required": false, - "schema": { - "enum": [ - "failed", - "succeeded" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/treasury.received_credit" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "TreasuryReceivedCreditsResourceReceivedCreditList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/received_credits/{id}": { - "get": { - "description": "Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list.
", - "operationId": "GetTreasuryReceivedCreditsId", - "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/treasury.received_credit" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/received_debits": { - "get": { - "description": "Returns a list of ReceivedDebits.
", - "operationId": "GetTreasuryReceivedDebits", - "parameters": [ - { - "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": "The FinancialAccount that funds were pulled from.", - "in": "query", - "name": "financial_account", - "required": true, - "schema": { - "type": "string" - }, - "style": "form" - }, - { - "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": "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" - }, - { - "description": "Only return ReceivedDebits that have the given status: `succeeded` or `failed`.", - "in": "query", - "name": "status", - "required": false, - "schema": { - "enum": [ - "failed", - "succeeded" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/treasury.received_debit" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "TreasuryReceivedDebitsResourceReceivedDebitList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/received_debits/{id}": { - "get": { - "description": "Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list
", - "operationId": "GetTreasuryReceivedDebitsId", - "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/treasury.received_debit" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/transaction_entries": { - "get": { - "description": "Retrieves a list of TransactionEntry objects.
", - "operationId": "GetTreasuryTransactionEntries", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "explode": true, - "in": "query", - "name": "effective_at", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": "Returns objects associated with this FinancialAccount.", - "in": "query", - "name": "financial_account", - "required": true, - "schema": { - "type": "string" - }, - "style": "form" - }, - { - "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": "The results are in reverse chronological order by `created` or `effective_at`. The default is `created`.", - "in": "query", - "name": "order_by", - "required": false, - "schema": { - "enum": [ - "created", - "effective_at" - ], - "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" - }, - { - "description": "Only return TransactionEntries associated with this Transaction.", - "in": "query", - "name": "transaction", - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/treasury.transaction_entry" - }, - "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/treasury/transaction_entries", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "TreasuryTransactionsResourceTransactionEntryList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/transaction_entries/{id}": { - "get": { - "description": "Retrieves a TransactionEntry object.
", - "operationId": "GetTreasuryTransactionEntriesId", - "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/treasury.transaction_entry" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/transactions": { - "get": { - "description": "Retrieves a list of Transaction objects.
", - "operationId": "GetTreasuryTransactions", - "parameters": [ - { - "explode": true, - "in": "query", - "name": "created", - "required": false, - "schema": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - }, - "style": "deepObject" - }, - { - "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": "Returns objects associated with this FinancialAccount.", - "in": "query", - "name": "financial_account", - "required": true, - "schema": { - "type": "string" - }, - "style": "form" - }, - { - "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": "The results are in reverse chronological order by `created` or `posted_at`. The default is `created`.", - "in": "query", - "name": "order_by", - "required": false, - "schema": { - "enum": [ - "created", - "posted_at" - ], - "type": "string", - "x-stripeBypassValidation": true - }, - "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" - }, - { - "description": "Only return Transactions that have the given status: `open`, `posted`, or `void`.", - "in": "query", - "name": "status", - "required": false, - "schema": { - "enum": [ - "open", - "posted", - "void" - ], - "type": "string" - }, - "style": "form" - }, - { - "description": "A filter for the `status_transitions.posted_at` timestamp. When using this filter, `status=posted` and `order_by=posted_at` must also be specified.", - "explode": true, - "in": "query", - "name": "status_transitions", - "required": false, - "schema": { - "properties": { - "posted_at": { - "anyOf": [ - { - "properties": { - "gt": { - "type": "integer" - }, - "gte": { - "type": "integer" - }, - "lt": { - "type": "integer" - }, - "lte": { - "type": "integer" - } - }, - "title": "range_query_specs", - "type": "object" - }, - { - "type": "integer" - } - ] - } - }, - "title": "status_transition_timestamp_specs", - "type": "object" - }, - "style": "deepObject" - } - ], - "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": { - "description": "Details about each object.", - "items": { - "$ref": "#/components/schemas/treasury.transaction" - }, - "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, - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "TreasuryTransactionsResourceTransactionList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/treasury/transactions/{id}": { - "get": { - "description": "Retrieves the details of an existing Transaction.
", - "operationId": "GetTreasuryTransactionsId", - "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/treasury.transaction" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - } - }, - "/v1/webhook_endpoints": { - "get": { - "description": "Returns a list of your webhook endpoints.
", - "operationId": "GetWebhookEndpoints", - "parameters": [ - { - "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": "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/webhook_endpoint" - }, - "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/webhook_endpoints", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "object", - "url" - ], - "title": "NotificationWebhookEndpointList", - "type": "object", - "x-expandableFields": [ - "data" - ] - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "A webhook endpoint must have a url
and a list of enabled_events
. You may optionally specify the Boolean connect
parameter. If set to true, then a Connect webhook endpoint that notifies the specified url
about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url
only about events from your account is created. You can also create webhook endpoints in the webhooks settings section of the Dashboard.
You can also delete webhook endpoints via the webhook endpoint management page of the Stripe dashboard.
", - "operationId": "DeleteWebhookEndpointsWebhookEndpoint", - "parameters": [ - { - "in": "path", - "name": "webhook_endpoint", - "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/deleted_webhook_endpoint" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "get": { - "description": "Retrieves the webhook endpoint with the given ID.
", - "operationId": "GetWebhookEndpointsWebhookEndpoint", - "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": "webhook_endpoint", - "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/webhook_endpoint" - } - } - }, - "description": "Successful response." - }, - "default": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/error" - } - } - }, - "description": "Error response." - } - } - }, - "post": { - "description": "Updates the webhook endpoint. You may edit the url
, the list of enabled_events
, and the status of your endpoint.
Retrieves a Customer object.
", - "operationId": "GetCustomersCustomer", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - }, - { - "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": { - "anyOf": [ - { - "$ref": "#/components/schemas/customer" - } - ] - } - } - }, - "description": "Successful response." - } - } - }, - "post": { - "description": "Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the past_due
state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.
This request accepts mostly the same arguments as the customer creation call.
", - "operationId": "PostCustomersCustomer", - "parameters": [ - { - "in": "path", - "name": "customer", - "required": true, - "schema": { - "maxLength": 5000, - "type": "string" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "encoding": { - "address": { - "explode": true, - "style": "deepObject" - }, - "bank_account": { - "explode": true, - "style": "deepObject" - }, - "card": { - "explode": true, - "style": "deepObject" - }, - "cash_balance": { - "explode": true, - "style": "deepObject" - }, - "expand": { - "explode": true, - "style": "deepObject" - }, - "invoice_settings": { - "explode": true, - "style": "deepObject" - }, - "metadata": { - "explode": true, - "style": "deepObject" - }, - "preferred_locales": { - "explode": true, - "style": "deepObject" - }, - "shipping": { - "explode": true, - "style": "deepObject" - }, - "tax": { - "explode": true, - "style": "deepObject" - } - }, - "schema": { - "additionalProperties": false, - "properties": { - "address": { - "anyOf": [ - { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "optional_fields_address", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The customer's address." - }, - "balance": { - "description": "An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice.", - "type": "integer" - }, - "bank_account": { - "anyOf": [ - { - "properties": { - "account_holder_name": { - "maxLength": 5000, - "type": "string" - }, - "account_holder_type": { - "enum": [ - "company", - "individual" - ], - "maxLength": 5000, - "type": "string" - }, - "account_number": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "currency": { - "type": "string" - }, - "object": { - "enum": [ - "bank_account" - ], - "maxLength": 5000, - "type": "string" - }, - "routing_number": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "account_number", - "country" - ], - "title": "customer_payment_source_bank_account", - "type": "object" - }, - { - "maxLength": 5000, - "type": "string" - } - ], - "description": "Either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details." - }, - "card": { - "anyOf": [ - { - "properties": { - "address_city": { - "maxLength": 5000, - "type": "string" - }, - "address_country": { - "maxLength": 5000, - "type": "string" - }, - "address_line1": { - "maxLength": 5000, - "type": "string" - }, - "address_line2": { - "maxLength": 5000, - "type": "string" - }, - "address_state": { - "maxLength": 5000, - "type": "string" - }, - "address_zip": { - "maxLength": 5000, - "type": "string" - }, - "cvc": { - "maxLength": 5000, - "type": "string" - }, - "exp_month": { - "type": "integer" - }, - "exp_year": { - "type": "integer" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "number": { - "maxLength": 5000, - "type": "string" - }, - "object": { - "enum": [ - "card" - ], - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "exp_month", - "exp_year", - "number" - ], - "title": "customer_payment_source_card", - "type": "object" - }, - { - "maxLength": 5000, - "type": "string" - } - ], - "description": "A token, like the ones returned by [Stripe.js](https://stripe.com/docs/js).", - "x-stripeBypassValidation": true - }, - "cash_balance": { - "description": "Balance information and default balance settings for this customer.", - "properties": { - "settings": { - "properties": { - "reconciliation_mode": { - "enum": [ - "automatic", - "manual", - "merchant_default" - ], - "type": "string" - } - }, - "title": "balance_settings_param", - "type": "object" - } - }, - "title": "cash_balance_param", - "type": "object" - }, - "coupon": { - "maxLength": 5000, - "type": "string" - }, - "default_alipay_account": { - "description": "ID of Alipay account to make the customer's new default for invoice payments.", - "maxLength": 500, - "type": "string" - }, - "default_bank_account": { - "description": "ID of bank account to make the customer's new default for invoice payments.", - "maxLength": 500, - "type": "string" - }, - "default_card": { - "description": "ID of card to make the customer's new default for invoice payments.", - "maxLength": 500, - "type": "string" - }, - "default_source": { - "description": "If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter.\n\nProvide the ID of a payment source already attached to this customer to make it this customer's default payment source.\n\nIf you want to add a new payment source and make it the default, see the [source](https://stripe.com/docs/api/customers/update#update_customer-source) property.", - "maxLength": 500, - "type": "string" - }, - "description": { - "description": "An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard.", - "maxLength": 5000, - "type": "string" - }, - "email": { - "description": "Customer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*.", - "maxLength": 512, - "type": "string" - }, - "expand": { - "description": "Specifies which fields in the response should be expanded.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "invoice_prefix": { - "description": "The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers.", - "maxLength": 5000, - "type": "string" - }, - "invoice_settings": { - "description": "Default invoice settings for this customer.", - "properties": { - "custom_fields": { - "anyOf": [ - { - "items": { - "properties": { - "name": { - "maxLength": 30, - "type": "string" - }, - "value": { - "maxLength": 30, - "type": "string" - } - }, - "required": [ - "name", - "value" - ], - "title": "custom_field_params", - "type": "object" - }, - "type": "array" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - }, - "default_payment_method": { - "maxLength": 5000, - "type": "string" - }, - "footer": { - "maxLength": 5000, - "type": "string" - }, - "rendering_options": { - "anyOf": [ - { - "properties": { - "amount_tax_display": { - "enum": [ - "", - "exclude_tax", - "include_inclusive_tax" - ], - "type": "string" - } - }, - "title": "rendering_options_param", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "customer_param", - "type": "object" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." - }, - "name": { - "description": "The customer's full name or business name.", - "maxLength": 256, - "type": "string" - }, - "next_invoice_sequence": { - "description": "The sequence to be used on the customer's next invoice. Defaults to 1.", - "type": "integer" - }, - "phone": { - "description": "The customer's phone number.", - "maxLength": 20, - "type": "string" - }, - "preferred_locales": { - "description": "Customer's preferred languages, ordered by preference.", - "items": { - "maxLength": 5000, - "type": "string" - }, - "type": "array" - }, - "promotion_code": { - "description": "The API ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount.", - "maxLength": 5000, - "type": "string" - }, - "shipping": { - "anyOf": [ - { - "properties": { - "address": { - "properties": { - "city": { - "maxLength": 5000, - "type": "string" - }, - "country": { - "maxLength": 5000, - "type": "string" - }, - "line1": { - "maxLength": 5000, - "type": "string" - }, - "line2": { - "maxLength": 5000, - "type": "string" - }, - "postal_code": { - "maxLength": 5000, - "type": "string" - }, - "state": { - "maxLength": 5000, - "type": "string" - } - }, - "title": "optional_fields_address", - "type": "object" - }, - "name": { - "maxLength": 5000, - "type": "string" - }, - "phone": { - "maxLength": 5000, - "type": "string" - } - }, - "required": [ - "address", - "name" - ], - "title": "customer_shipping", - "type": "object" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ], - "description": "The customer's shipping information. Appears on invoices emailed to this customer." - }, - "source": { - "maxLength": 5000, - "type": "string", - "x-stripeBypassValidation": true - }, - "tax": { - "description": "Tax details about the customer.", - "properties": { - "ip_address": { - "anyOf": [ - { - "type": "string" - }, - { - "enum": [ - "" - ], - "type": "string" - } - ] - } - }, - "title": "tax_param", - "type": "object" - }, - "tax_exempt": { - "description": "The customer's tax exemption. One of `none`, `exempt`, or `reverse`.", - "enum": [ - "", - "exempt", - "none", - "reverse" - ], - "type": "string" - } - }, - "type": "object" - } - } - }, - "required": false - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/customer" - } - } - }, - "description": "Successful response." - } - } - } - } - } - } diff --git a/packages/concerto-tools/test/codegen/fromOpenApi/cto/openApiVisitor.js b/packages/concerto-tools/test/codegen/fromOpenApi/cto/openApiVisitor.js deleted file mode 100644 index 20f05c7fa1..0000000000 --- a/packages/concerto-tools/test/codegen/fromOpenApi/cto/openApiVisitor.js +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const chai = require('chai'); -chai.should(); -const { assert } = chai; -const fs = require('fs'); -const path = require('path'); -const Printer = require('@accordproject/concerto-cto').Printer; - -const OpenApiVisitor = require( - '../../../../lib/codegen/fromOpenApi/cto/openApiVisitor' -); -const { OpenApiDefinition } = require( - '../../../../lib/codegen/fromOpenApi/cto/openApiClasses' -); - -const openApiVisitor = new OpenApiVisitor(); -const openApiVisitorParameters = { - metaModelNamespace: 'concerto.metamodel@1.0.0', - namespace: 'com.test@1.0.0', -}; - -describe('OpenApiVisitor', function () { - it( - 'should generate a Concerto JSON and CTO from an OpenAPI definition', - async () => { - const openApiDefinition = JSON.parse( - fs.readFileSync( - path.resolve( - __dirname, '../cto/data/openApiDefinition.json' - ), 'utf8' - ) - ); - const desiredConcertoJsonModelString = fs.readFileSync( - path.resolve( - __dirname, '../cto/data/concertoJsonModel.json' - ), 'utf8' - ); - const desiredConcertoModel = fs.readFileSync( - path.resolve( - __dirname, '../cto/data/concertoModel.cto' - ), 'utf8' - ); - - const openApiDefinitionClass = new OpenApiDefinition(openApiDefinition); - - const inferredConcertoJsonModel = openApiDefinitionClass.accept( - openApiVisitor, openApiVisitorParameters - ); - - const inferredConcertoModel = Printer.toCTO( - inferredConcertoJsonModel.models[0] - ); - - assert.equal( - JSON.stringify(inferredConcertoJsonModel, null, 4) + '\n', - desiredConcertoJsonModelString - ); - - assert.equal( - inferredConcertoModel + '\n', - desiredConcertoModel - ); - } - ); - - it( - 'should generate a Concerto JSON and CTO from a Stripe OpenAPI definition (small)', - async () => { - const smallStripeOpenApiDefinition = JSON.parse( - fs.readFileSync( - path.resolve( - __dirname, '../cto/data/smallStripeOpenApiDefinition.json' - ), 'utf8' - ) - ); - const desiredConcertoJsonModelString = fs.readFileSync( - path.resolve( - __dirname, '../cto/data/smallStripeConcertoJsonModel.json' - ), 'utf8' - ); - const desiredConcertoModel = fs.readFileSync( - path.resolve( - __dirname, '../cto/data/smallStripeConcertoModel.cto' - ), 'utf8' - ); - - const inferredConcertoJsonModel = OpenApiVisitor - .parse(smallStripeOpenApiDefinition) - .accept( - openApiVisitor, openApiVisitorParameters - ); - - const inferredConcertoModel = Printer.toCTO( - inferredConcertoJsonModel.models[0] - ); - - assert.equal( - JSON.stringify(inferredConcertoJsonModel, null, 4) + '\n', - desiredConcertoJsonModelString - ); - - assert.equal( - inferredConcertoModel + '\n', - desiredConcertoModel - ); - } - ); - - it( - 'should generate a Concerto JSON and CTO from a Stripe OpenAPI definition (full)', - async () => { - const fullStripeOpenApiDefinition = JSON.parse( - fs.readFileSync( - path.resolve( - __dirname, '../cto/data/fullStripeOpenApiDefinition.json' - ), 'utf8' - ) - ); - const desiredConcertoJsonModelString = fs.readFileSync( - path.resolve( - __dirname, '../cto/data/fullStripeConcertoJsonModel.json' - ), 'utf8' - ); - const desiredConcertoModel = fs.readFileSync( - path.resolve( - __dirname, '../cto/data/fullStripeConcertoModel.cto' - ), 'utf8' - ); - - const inferredConcertoJsonModel = OpenApiVisitor - .parse(fullStripeOpenApiDefinition) - .accept( - openApiVisitor, openApiVisitorParameters - ); - - const inferredConcertoModel = Printer.toCTO( - inferredConcertoJsonModel.models[0] - ); - - assert.equal( - JSON.stringify(inferredConcertoJsonModel, null, 4) + '\n', - desiredConcertoJsonModelString - ); - - assert.equal( - inferredConcertoModel + '\n', - desiredConcertoModel - ); - } - ); -}); diff --git a/packages/concerto-tools/test/codegen/fromcto/avro/avrovisitor.js b/packages/concerto-tools/test/codegen/fromcto/avro/avrovisitor.js deleted file mode 100644 index 44885d9b63..0000000000 --- a/packages/concerto-tools/test/codegen/fromcto/avro/avrovisitor.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const { InMemoryWriter } = require('@accordproject/concerto-util'); -const chai = require('chai'); -chai.should(); - -const ModelManager = require('@accordproject/concerto-core').ModelManager; -const AvroVisitor = require('../../../../lib/codegen/fromcto/avro/avrovisitor.js'); - -const MODEL_SIMPLE = ` -namespace test@1.0.0 - -enum Color { - o RED - o GREEN - o BLUE -} - -scalar Email extends String - -@resource -concept Person identified by email { - o Email email - o Color color -} -`; - -describe('Avro', function () { - - describe('samples', () => { - it('should use custom properties', () => { - const modelManager = new ModelManager(); - modelManager.addCTOModel( MODEL_SIMPLE ); - const visitor = new AvroVisitor(); - const fileWriter = new InMemoryWriter(); - modelManager.accept(visitor, { - avroProtocolName: 'FancyProtocol', - fileWriter - }); - const files = fileWriter.getFilesInMemory(); - const file = files.get('test@1.0.0.avdl'); - file.should.match(/protocol FancyProtocol/); - }); - - it('should throw an error when an unrecognised type is supplied', () => { - let thing = 'Something of unrecognised type'; - const visitor = new AvroVisitor(); - const param = {}; - (() => { - visitor.visit(thing, param); - }).should.throw('Unrecognised type: string, value: \'Something of unrecognised type\''); - }); - }); -}); diff --git a/packages/concerto-tools/test/codegen/fromcto/csharp/csharpvisitor.js b/packages/concerto-tools/test/codegen/fromcto/csharp/csharpvisitor.js deleted file mode 100644 index 18f007c6e3..0000000000 --- a/packages/concerto-tools/test/codegen/fromcto/csharp/csharpvisitor.js +++ /dev/null @@ -1,1366 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const fs = require('fs'); -const path = require('path'); -const { InMemoryWriter } = require('@accordproject/concerto-util'); -const chai = require('chai'); -chai.should(); -const sinon = require('sinon'); - -const CSharpVisitor = require('../../../../lib/codegen/fromcto/csharp/csharpvisitor.js'); - -const ClassDeclaration = require('@accordproject/concerto-core').ClassDeclaration; -const EnumDeclaration = require('@accordproject/concerto-core').EnumDeclaration; -const EnumValueDeclaration = require('@accordproject/concerto-core').EnumValueDeclaration; -const Field = require('@accordproject/concerto-core').Field; -const ModelFile = require('@accordproject/concerto-core').ModelFile; -const ModelManager = require('@accordproject/concerto-core').ModelManager; -const RelationshipDeclaration = require('@accordproject/concerto-core').RelationshipDeclaration; -const FileWriter = require('@accordproject/concerto-util').FileWriter; -const csharpBuiltInTypes = ['bool','byte','char','decimal','double','float','int','long','nint','nuint','sbyte','short', - 'string','uint','ulong','ushort']; - -describe('CSharpVisitor', function () { - let csharpVisitor; - let mockFileWriter; - beforeEach(() => { - csharpVisitor = new CSharpVisitor(); - mockFileWriter = sinon.createStubInstance(FileWriter); - }); - - describe('visit improved', () => { - let fileWriter; - - beforeEach(() => { - fileWriter = new InMemoryWriter(); - }); - - it('should default namespaces using just the name portion of the namespace', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - concept Thing {} - `); - csharpVisitor.visit(modelManager, { fileWriter }); - const files = fileWriter.getFilesInMemory(); - const file = files.get('org.acme@1.2.3.cs'); - file.should.match(/namespace org.acme;/); - }); - - it('should default imported namespaces using just the name portion of the namespace', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme.other@2.3.4 - - concept OtherThing {} - `); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - import org.acme.other@2.3.4.{ OtherThing } - - concept Thing { - o OtherThing otherThing - } - `); - csharpVisitor.visit(modelManager, { fileWriter }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/namespace org.acme;/); - file1.should.match(/using org.acme.other;/); - const file2 = files.get('org.acme.other@2.3.4.cs'); - file2.should.match(/namespace org.acme.other;/); - }); - - csharpBuiltInTypes.forEach(builtInType => { - it('should use the dotnet built in type '+ builtInType +' if @DotNetType if present', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - concept Thing { - @DotNetType("`+ builtInType +`") - o String builtInTypeValue - @DotNetType("`+ builtInType +`") - o String optionalBuiltInTypeValue optional - } - `); - csharpVisitor.visit(modelManager, { fileWriter }); - const files = fileWriter.getFilesInMemory(); - const file = files.get('org.acme@1.2.3.cs'); - let matchText = 'public '+ builtInType + ' builtInTypeValue'; - file.should.match(new RegExp(matchText,'g')); - matchText = 'public '+ builtInType + '\\? optionalBuiltInTypeValue'; - file.should.match(new RegExp(matchText,'g')); - }); - }); - - it('should throw an error when an non built in @DotNetType is supplied', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - concept Thing { - @DotNetType("nonBuiltInType") - o String builtInTypeValue - }`); - (() => { - csharpVisitor.visit(modelManager, { fileWriter }); - }).should.throw('Malformed @DotNetType decorator'); - }); - - it('should use the @DotNetNamespace decorator if present', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - @DotNetNamespace("Org.Acme.Models") - namespace org.acme@1.2.3 - - concept Thing {} - `); - csharpVisitor.visit(modelManager, { fileWriter }); - const files = fileWriter.getFilesInMemory(); - const file = files.get('org.acme@1.2.3.cs'); - file.should.match(/namespace Org.Acme.Models;/); - }); - - it('should use the imported @DotNetNamespace decorator if present', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - @DotNetNamespace("Org.Acme.OtherModels") - namespace org.acme.other@2.3.4 - - concept OtherThing {} - `); - modelManager.addCTOModel(` - @DotNetNamespace("Org.Acme.Models") - namespace org.acme@1.2.3 - - import org.acme.other@2.3.4.{ OtherThing } - - concept Thing { - o OtherThing otherThing - } - `); - csharpVisitor.visit(modelManager, { fileWriter }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/namespace Org.Acme.Models;/); - file1.should.match(/using Org.Acme.OtherModels;/); - const file2 = files.get('org.acme.other@2.3.4.cs'); - file2.should.match(/namespace Org.Acme.OtherModels;/); - }); - - it('should use pascal case for the namespace if specified', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - concept Thing {} - `); - csharpVisitor.visit(modelManager, { fileWriter, pascalCase: true }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/namespace Org.Acme;/); - }); - - it('should use pascal case for a concept if specified', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - concept camelCaseThing {} - `); - csharpVisitor.visit(modelManager, { fileWriter, pascalCase: true }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/AccordProject.Concerto.Type\(Namespace = "org.acme".*?Name = "camelCaseThing"/); - file1.should.match(/class CamelCaseThing/); - }); - - it('should use pascal case for an enum if specified', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - enum camelCaseThing {} - `); - csharpVisitor.visit(modelManager, { fileWriter, pascalCase: true }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/enum CamelCaseThing/); - }); - - it('should use pascal case for a property name if specified', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - concept PascalCaseThing { - o String someProperty - } - `); - csharpVisitor.visit(modelManager, { fileWriter, pascalCase: true }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/public string SomeProperty/); - }); - - it('should use pascal case for a type reference if specified', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - enum camelCaseThing {} - - concept PascalCaseThing { - o camelCaseThing someProperty - } - `); - csharpVisitor.visit(modelManager, { fileWriter, pascalCase: true }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/enum CamelCaseThing/); - file1.should.match(/public CamelCaseThing SomeProperty/); - }); - - it('should avoid clashes between class name and property name', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - concept Model { - o String Model - } - `); - csharpVisitor.visit(modelManager, { fileWriter }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/class Model/); - file1.should.match(/public string _Model/); - }); - - it('should add identifier attributes for concepts with identified', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - concept Thing identified { - o String value - } - `); - csharpVisitor.visit(modelManager, { fileWriter, pascalCase: true }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/class Thing/); - file1.should.match(/AccordProject.Concerto.Identifier\(\)/); - file1.should.match(/public string _Identifier/); - }); - - it('should add ?(nullable) expression for optional fields except for string type', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - concept Thing identified by thingId { - o String thingId - o String value optional - o Integer nullableIntValue optional - o Integer nonNullableIntValue - o Double nullableDoubleValue optional - o Double nonNullableDoubleValue - o Boolean nullableBooleanValue optional - o Boolean nonNullableBooleanValue - o DateTime nullableDateTimeValue optional - o DateTime nonNullableDateTimeValue - o Long nullableLongValue optional - o Long nonNullableLongValue - } - `); - csharpVisitor.visit(modelManager, { fileWriter, pascalCase: true }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/public string ThingId/); - file1.should.match(/public string\? Value/); - file1.should.match(/public int\? NullableIntValue/); - file1.should.match(/public int NonNullableIntValue/); - file1.should.match(/public float\? NullableDoubleValue/); - file1.should.match(/public float NonNullableDoubleValue/); - file1.should.match(/public bool\? NullableBooleanValue/); - file1.should.match(/public bool NonNullableBooleanValue/); - file1.should.match(/public System.DateTime\? NullableDateTimeValue/); - file1.should.match(/public System.DateTime NonNullableDateTimeValue/); - file1.should.match(/public long\? NullableLongValue/); - file1.should.match(/public long NonNullableLongValue/); - }); - - it('should add identifier attributes for concepts with identified by', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - concept Thing identified by thingId { - o String thingId - o String value - } - `); - csharpVisitor.visit(modelManager, { fileWriter, pascalCase: true }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/class Thing/); - file1.should.match(/AccordProject.Concerto.Identifier\(\)/); - file1.should.match(/public string ThingId/); - }); - - it('should use Guid if scalar type with name UUID provided with namespace concerto.scalar', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace concerto.scalar@1.0.0 - - scalar UUID extends String default="00000000-0000-0000-0000-000000000000" regex=/^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$/ - `); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - import concerto.scalar@1.0.0.{ UUID } - - concept Thing { - o UUID ThingId - o UUID SomeOtherId optional - } - `); - csharpVisitor.visit(modelManager, { fileWriter }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/namespace org.acme;/); - file1.should.match(/class Thing/); - file1.should.match(/public System.Guid ThingId/); - file1.should.match(/public System.Guid\? SomeOtherId/); - }); - - it('should use regex annotation when regex pattern provided to a field', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(fs.readFileSync(path.resolve(__dirname, '../data/model/agreement.cto'), 'utf8'), 'agreement.cto'); - csharpVisitor.visit(modelManager, { fileWriter }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.equal(`namespace org.acme; -using AccordProject.Concerto; -[AccordProject.Concerto.Type(Namespace = "org.acme", Version = "1.2.3", Name = "AgreementBase")] -[System.Text.Json.Serialization.JsonConverter(typeof(AccordProject.Concerto.ConcertoConverterFactorySystem))] -public class AgreementBase : Concept { - [System.Text.Json.Serialization.JsonPropertyName("$class")] - public override string _class { get; } = "org.acme@1.2.3.AgreementBase"; - [System.ComponentModel.DataAnnotations.RegularExpression(@"^[^?\\/:<>|]*$", ErrorMessage = "Invalid characters")] - public string name { get; set; } - [System.ComponentModel.DataAnnotations.RegularExpression(@"^([^?\\/:<>|+=@-][^?\\/:<>|]*)?$", ErrorMessage = "Invalid characters")] - public string externalSource { get; set; } - [System.ComponentModel.DataAnnotations.RegularExpression(@"^([^?\\/:<>|+=@-][^?\\/:<>|]*)?$", ErrorMessage = "Invalid characters")] - public string externalId { get; set; } - public string agreementType { get; set; } - public decimal? value { get; set; } - [System.ComponentModel.DataAnnotations.RegularExpression(@"^[^\\<\\>]*$", ErrorMessage = "Invalid characters")] - public string requestor { get; set; } -} -`); - }); - - it('should use string for scalar type UUID but with different namespace than concerto.scalar ', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.specific.scalar@1.0.0 - - scalar UUID extends String default="00000000-0000-0000-0000-000000000000" regex=/^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$/ - `); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - import org.specific.scalar@1.0.0.{ UUID } - - concept Thing { - o UUID ThingId - } - `); - csharpVisitor.visit(modelManager, { fileWriter }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/namespace org.acme;/); - file1.should.match(/class Thing/); - file1.should.match(/public string ThingId/); - }); - - it('should use string for scalar type non UUID', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace concerto.scalar@1.0.0 - - scalar SSN extends String - `); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - import concerto.scalar@1.0.0.{ SSN } - - concept Thing { - o SSN ThingId - o SSN SomeOtherId optional - } - `); - csharpVisitor.visit(modelManager, { fileWriter }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/namespace org.acme;/); - file1.should.match(/class Thing/); - file1.should.match(/public string ThingId/); - file1.should.match(/public string\? SomeOtherId/); - }); - - it('should use the @AcceptedValue decorator if present', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - enum SomeEnum { - @AcceptedValue("Payment terms") - o PaymentTerms - @AcceptedValue("Payment Late Fees") - o PaymentLateFees - @AcceptedValue("NA") - o NotApplicable - } - `); - csharpVisitor.visit(modelManager, { fileWriter }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/namespace org.acme;/); - file1.should.match(/enum SomeEnum/); - file1.should.match(/[System.Runtime.Serialization.EnumMember(Value = "Payment terms")]/); - file1.should.match(/PaymentTerms/); - file1.should.match(/[System.Runtime.Serialization.EnumMember(Value = "Payment Late Fees")]/); - file1.should.match(/PaymentLateFees/); - file1.should.match(/[System.Runtime.Serialization.EnumMember(Value = "NA")]/); - file1.should.match(/NotApplicable/); - }); - - it('should throw an error when an invalid @AcceptedValue provided', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - enum SomeEnum { - @AcceptedValue("Payment terms", 123) - o PaymentTerms - }`); - (() => { - csharpVisitor.visit(modelManager, { fileWriter }); - }).should.throw('Malformed @AcceptedValue decorator'); - }); - - it('should use relationship id if enableReferenceType param is set to true', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme.other@2.3.4 - - concept OtherThing identified by someId { - o String someId - } - - concept SomeOtherThing identified { - o Integer intField - } - `); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - import org.acme.other@2.3.4.{ OtherThing } - import org.acme.other@2.3.4.{ SomeOtherThing } - - concept Thing { - o Integer someIntField - --> OtherThing otherThingId - --> SomeOtherThing someOtherThingId - } - `); - csharpVisitor.visit(modelManager, { fileWriter, enableReferenceType: true }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/namespace org.acme;/); - file1.should.match(/public string otherThingId/); - file1.should.match(/public string someOtherThingId/); - }); - - it('should not use relationship id if enableReferenceType param is not set', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace org.acme.other@2.3.4 - - concept OtherThing identified by someId { - o String someId - } - - concept SomeOtherThing identified { - o Integer intField - } - `); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - import org.acme.other@2.3.4.{ OtherThing } - import org.acme.other@2.3.4.{ SomeOtherThing } - - concept Thing { - o Integer someIntField - --> OtherThing otherThingId - --> SomeOtherThing someOtherThingId - } - `); - csharpVisitor.visit(modelManager, { fileWriter }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/namespace org.acme;/); - file1.should.match(/public OtherThing otherThingId/); - file1.should.match(/public SomeOtherThing someOtherThingId/); - }); - - it('should use relationship id (System.Guid) if enableReferenceType param is set to true', () => { - const modelManager = new ModelManager({ strict: true }); - modelManager.addCTOModel(` - namespace concerto.scalar@1.0.0 - - scalar UUID extends String default="00000000-0000-0000-0000-000000000000" regex=/^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$/ - `); - modelManager.addCTOModel(` - namespace org.acme.other@2.3.4 - - import concerto.scalar@1.0.0.{ UUID } - - concept OtherThing identified by id { - o UUID id - o String someId - } - - concept SomeOtherThing identified { - o Integer intField - } - `); - modelManager.addCTOModel(` - namespace org.acme@1.2.3 - - import org.acme.other@2.3.4.{ OtherThing } - import org.acme.other@2.3.4.{ SomeOtherThing } - - concept Thing { - o Integer someIntField - --> OtherThing otherThingId - --> SomeOtherThing someOtherThingId - } - `); - csharpVisitor.visit(modelManager, { fileWriter, enableReferenceType: true }); - const files = fileWriter.getFilesInMemory(); - const file1 = files.get('org.acme@1.2.3.cs'); - file1.should.match(/namespace org.acme;/); - file1.should.match(/public System.Guid otherThingId/); - file1.should.match(/public string someOtherThingId/); - }); - }); - - describe('visit', () => { - let param; - beforeEach(() => { - param = { - property1: 'value1' - }; - }); - - it('should return visitModelManager for a ModelManager', () => { - let thing = sinon.createStubInstance(ModelManager); - thing.isModelManager.returns(true); - let mockSpecialVisit = sinon.stub(csharpVisitor, 'visitModelManager'); - mockSpecialVisit.returns('Duck'); - - csharpVisitor.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitModelFile for a ModelFile', () => { - let thing = sinon.createStubInstance(ModelFile); - thing.isModelFile.returns(true); - let mockSpecialVisit = sinon.stub(csharpVisitor, 'visitModelFile'); - mockSpecialVisit.returns('Duck'); - - csharpVisitor.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitEnumDeclaration for a EnumDeclaration', () => { - let thing = sinon.createStubInstance(EnumDeclaration); - thing.isEnum.returns(true); - let mockSpecialVisit = sinon.stub(csharpVisitor, 'visitEnumDeclaration'); - mockSpecialVisit.returns('Duck'); - - csharpVisitor.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitClassDeclaration for a ClassDeclaration', () => { - let thing = sinon.createStubInstance(ClassDeclaration); - thing.isClassDeclaration.returns(true); - let mockSpecialVisit = sinon.stub(csharpVisitor, 'visitClassDeclaration'); - mockSpecialVisit.returns('Duck'); - - csharpVisitor.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitField for a Field', () => { - let thing = sinon.createStubInstance(Field); - thing.isField.returns(true); - let mockSpecialVisit = sinon.stub(csharpVisitor, 'visitField'); - mockSpecialVisit.returns('Duck'); - - csharpVisitor.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitRelationship for a RelationshipDeclaration', () => { - let thing = sinon.createStubInstance(RelationshipDeclaration); - thing.isRelationship.returns(true); - let mockSpecialVisit = sinon.stub(csharpVisitor, 'visitRelationship'); - mockSpecialVisit.returns('Duck'); - - csharpVisitor.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitEnumValueDeclaration for a EnumValueDeclaration', () => { - let thing = sinon.createStubInstance(EnumValueDeclaration); - thing.isEnumValue.returns(true); - let mockSpecialVisit = sinon.stub(csharpVisitor, 'visitEnumValueDeclaration'); - mockSpecialVisit.returns('Goose'); - - csharpVisitor.visit(thing, param).should.deep.equal('Goose'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should throw an error when an unrecognised type is supplied', () => { - let thing = 'Something of unrecognised type'; - - (() => { - csharpVisitor.visit(thing, param); - }).should.throw('Unrecognised type: string, value: \'Something of unrecognised type\''); - }); - }); - - describe('visitModelManager', () => { - it('should call accept for each model file', () => { - let acceptSpy = sinon.spy(); - - let param = {}; - - let mockModelManager = sinon.createStubInstance(ModelManager); - mockModelManager.isModelManager.returns(true); - mockModelManager.getModelFiles.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - } - ]); - - csharpVisitor.visitModelManager(mockModelManager, param); - - acceptSpy.withArgs(csharpVisitor, param).calledTwice.should.be.ok; - }); - }); - - describe('visitModelFile', () => { - let param; - beforeEach(() => { - param = { - fileWriter: mockFileWriter - }; - }); - it('should write lines for the imports that are not in own namespace (including super types) ignoring primitives', () => { - let acceptSpy = sinon.spy(); - let mockEnum = sinon.createStubInstance(EnumDeclaration); - mockEnum.isEnum.returns(true); - mockEnum.accept = acceptSpy; - - let property1 = { - isPrimitive: () => { - return false; - }, - getFullyQualifiedTypeName: () => { - return 'org.org1.Property1'; - } - }; - - let property2 = { - isPrimitive: () => { - return false; - }, - getFullyQualifiedTypeName: () => { - return 'org.acme.Property2'; - } - }; - - let property3 = { - isPrimitive: () => { - return true; - }, - getFullyQualifiedTypeName: () => { - return 'super.Property3'; - } - }; - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isEnum.returns(false); - mockClassDeclaration.getSuperType.returns('super.Parent'); - mockClassDeclaration.getProperties.returns([property1, property2, property3]); - mockClassDeclaration.accept = acceptSpy; - - let mockClassDeclaration2 = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isEnum.returns(false); - mockClassDeclaration2.getSuperType.returns('super.Parent'); - mockClassDeclaration2.getProperties.returns([]); - mockClassDeclaration2.accept = acceptSpy; - - let mockModelFile = sinon.createStubInstance(ModelFile); - mockModelFile.getNamespace.returns('org.acme'); - mockModelFile.getAllDeclarations.returns([ - mockEnum, - mockClassDeclaration, - mockClassDeclaration2 - ]); - mockModelFile.getImports.returns([ - 'org.org1.Import1', - 'org.org1.Import2', - 'org.org2.Import1', - 'super.Property3', - 'super.Parent' - ]); - - const myParams = { - ...param, - namespacePrefix: 'Concerto.Models.' - }; - csharpVisitor.visitModelFile(mockModelFile, myParams); - - param.fileWriter.openFile.withArgs('org.acme.cs').calledOnce.should.be.ok; - param.fileWriter.writeLine.callCount.should.equal(4); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, 'namespace Concerto.Models.org.acme;']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, 'using Concerto.Models.org.org1;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, 'using Concerto.Models.org.org2;']); - param.fileWriter.writeLine.getCall(3).args.should.deep.equal([0, 'using Concerto.Models.super;']); - param.fileWriter.closeFile.calledOnce.should.be.ok; - acceptSpy.withArgs(csharpVisitor, myParams).calledThrice.should.be.ok; - }); - - it('should write lines for the imports that are not in own namespace (including super types) ignoring primitives using Newtonsoft.Json', () => { - let acceptSpy = sinon.spy(); - let mockEnum = sinon.createStubInstance(EnumDeclaration); - mockEnum.isEnum.returns(true); - mockEnum.accept = acceptSpy; - - let property1 = { - isPrimitive: () => { - return false; - }, - getFullyQualifiedTypeName: () => { - return 'org.org1.Property1'; - } - }; - - let property2 = { - isPrimitive: () => { - return false; - }, - getFullyQualifiedTypeName: () => { - return 'org.acme.Property2'; - } - }; - - let property3 = { - isPrimitive: () => { - return true; - }, - getFullyQualifiedTypeName: () => { - return 'super.Property3'; - } - }; - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isEnum.returns(false); - mockClassDeclaration.getSuperType.returns('super.Parent'); - mockClassDeclaration.getProperties.returns([property1, property2, property3]); - mockClassDeclaration.accept = acceptSpy; - - let mockClassDeclaration2 = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isEnum.returns(false); - mockClassDeclaration2.getSuperType.returns('super.Parent'); - mockClassDeclaration2.getProperties.returns([]); - mockClassDeclaration2.accept = acceptSpy; - - let mockModelFile = sinon.createStubInstance(ModelFile); - mockModelFile.getNamespace.returns('org.acme'); - mockModelFile.getAllDeclarations.returns([ - mockEnum, - mockClassDeclaration, - mockClassDeclaration2 - ]); - mockModelFile.getImports.returns([ - 'org.org1.Import1', - 'org.org1.Import2', - 'org.org2.Import1', - 'super.Property3', - 'super.Parent' - ]); - - const newtonsoftParams = { - ...param, - useNewtonsoftJson: true, - namespacePrefix: 'Concerto.Models' - }; - csharpVisitor.visitModelFile(mockModelFile, newtonsoftParams); - - param.fileWriter.openFile.withArgs('org.acme.cs').calledOnce.should.be.ok; - param.fileWriter.writeLine.callCount.should.equal(4); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, 'namespace Concerto.Models.org.acme;']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, 'using Concerto.Models.org.org1;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, 'using Concerto.Models.org.org2;']); - param.fileWriter.writeLine.getCall(3).args.should.deep.equal([0, 'using Concerto.Models.super;']); - param.fileWriter.closeFile.calledOnce.should.be.ok; - acceptSpy.withArgs(csharpVisitor, newtonsoftParams).calledThrice.should.be.ok; - }); - - - it('should write lines for the imports that are not in own namespace ignoring primitives and write lines for importing system type', () => { - let acceptSpy = sinon.spy(); - let mockEnum = sinon.createStubInstance(EnumDeclaration); - mockEnum.isEnum.returns(true); - mockEnum.accept = acceptSpy; - - let property1 = { - isPrimitive: () => { - return false; - }, - getFullyQualifiedTypeName: () => { - return 'org.org1.Property1'; - } - }; - - let property2 = { - isPrimitive: () => { - return false; - }, - getFullyQualifiedTypeName: () => { - return 'org.acme.Property2'; - } - }; - - let property3 = { - isPrimitive: () => { - return false; - }, - getFullyQualifiedTypeName: () => { - return 'org.org1.Property3'; - } - }; - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getProperties.returns([property1, property2, property3]); - mockClassDeclaration.accept = acceptSpy; - - let mockModelManager = sinon.createStubInstance(ModelManager); - mockModelManager.isModelManager.returns(true); - - let mockModelFile = sinon.createStubInstance(ModelFile); - mockModelFile.isModelFile.returns(true); - mockModelFile.getNamespace.returns('org.acme'); - mockModelFile.getAllDeclarations.returns([ - mockEnum, - mockClassDeclaration - ]); - mockModelFile.getImports.returns([ - 'org.org1.Import1', - 'org.org1.Import2', - 'org.org2.Import1' - ]); - mockModelFile.getModelManager.returns(mockModelManager); - - const myParams = { - ...param, - namespacePrefix: 'Concerto.Models.' - }; - csharpVisitor.visitModelFile(mockModelFile, myParams); - - param.fileWriter.openFile.withArgs('org.acme.cs').calledOnce.should.be.ok; - param.fileWriter.writeLine.callCount.should.equal(3); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, 'namespace Concerto.Models.org.acme;']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, 'using Concerto.Models.org.org1;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, 'using Concerto.Models.org.org2;']); - param.fileWriter.closeFile.calledOnce.should.be.ok; - acceptSpy.withArgs(csharpVisitor, myParams).calledTwice.should.be.ok; - }); - }); - - describe('visitEnumDeclaration', () => { - it('should write the export enum and call accept on each property', () => { - let acceptSpy = sinon.spy(); - - let param = { - fileWriter: mockFileWriter - }; - - let mockEnumDeclaration = sinon.createStubInstance(EnumDeclaration); - mockEnumDeclaration.isEnum.returns(true); - mockEnumDeclaration.getName.returns('Bob'); - mockEnumDeclaration.getOwnProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - - csharpVisitor.visitEnumDeclaration(mockEnumDeclaration, param); - - param.fileWriter.writeLine.callCount.should.deep.equal(3); - param.fileWriter.writeLine.withArgs(0, '[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))]').calledOnce.should.be.ok; - param.fileWriter.writeLine.withArgs(0, 'public enum Bob {').calledOnce.should.be.ok; - param.fileWriter.writeLine.withArgs(0, '}').calledOnce.should.be.ok; - - acceptSpy.withArgs(csharpVisitor, param).calledTwice.should.be.ok; - }); - }); - - describe('visitClassDeclaration', () => { - let param; - beforeEach(() => { - param = { - fileWriter: mockFileWriter - }; - }); - it('should write the class opening and close', () => { - let acceptSpy = sinon.spy(); - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getOwnProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - mockClassDeclaration.getName.returns('Bob'); - mockClassDeclaration.getNamespace.returns('org.acme'); - - csharpVisitor.visitClassDeclaration(mockClassDeclaration, param); - - param.fileWriter.writeLine.callCount.should.deep.equal(6); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, '[AccordProject.Concerto.Type(Namespace = "org.acme", Version = null, Name = "Bob")]']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, '[System.Text.Json.Serialization.JsonConverter(typeof(AccordProject.Concerto.ConcertoConverterFactorySystem))]']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, 'public class Bob {']); - param.fileWriter.writeLine.getCall(3).args.should.deep.equal([1, '[System.Text.Json.Serialization.JsonPropertyName("$class")]']); - param.fileWriter.writeLine.getCall(4).args.should.deep.equal([1, 'public override string _class { get; } = "undefined";']); - param.fileWriter.writeLine.getCall(5).args.should.deep.equal([0, '}']); - }); - it('should write the class opening and close with Newtonsoft.Json', () => { - let acceptSpy = sinon.spy(); - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - let mockClassDeclaration2 = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getOwnProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - mockClassDeclaration.getName.returns('Bob'); - mockClassDeclaration.getNamespace.returns('org.acme'); - mockClassDeclaration.getAssignableClassDeclarations.returns([mockClassDeclaration, mockClassDeclaration2]); - csharpVisitor.visitClassDeclaration(mockClassDeclaration, { ...param, useNewtonsoftJson: true}); - - param.fileWriter.writeLine.callCount.should.deep.equal(6); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, '[AccordProject.Concerto.Type(Namespace = "org.acme", Version = null, Name = "Bob")]']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, '[Newtonsoft.Json.JsonConverter(typeof(AccordProject.Concerto.ConcertoConverterNewtonsoft))]']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, 'public class Bob {']); - param.fileWriter.writeLine.getCall(3).args.should.deep.equal([1, '[Newtonsoft.Json.JsonProperty("$class")]']); - param.fileWriter.writeLine.getCall(4).args.should.deep.equal([1, 'public override string _class { get; } = "undefined";']); - param.fileWriter.writeLine.getCall(5).args.should.deep.equal([0, '}']); - }); - it('should write the class opening and close with abstract and super type', () => { - let acceptSpy = sinon.spy(); - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getOwnProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - mockClassDeclaration.getName.returns('Bob'); - mockClassDeclaration.getNamespace.returns('org.acme'); - mockClassDeclaration.isAbstract.returns(true); - mockClassDeclaration.getSuperType.returns('org.acme.Person'); - - csharpVisitor.visitClassDeclaration(mockClassDeclaration, param); - - param.fileWriter.writeLine.callCount.should.deep.equal(6); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, '[AccordProject.Concerto.Type(Namespace = "org.acme", Version = null, Name = "Bob")]']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, '[System.Text.Json.Serialization.JsonConverter(typeof(AccordProject.Concerto.ConcertoConverterFactorySystem))]']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, 'public abstract class Bob : Person {']); - param.fileWriter.writeLine.getCall(3).args.should.deep.equal([1, '[System.Text.Json.Serialization.JsonPropertyName("$class")]']); - param.fileWriter.writeLine.getCall(4).args.should.deep.equal([1, 'public override string _class { get; } = "undefined";']); - param.fileWriter.writeLine.getCall(5).args.should.deep.equal([0, '}']); - }); - it('should write the class opening and close with abstract and super type, with explicit System.Text.Json flag', () => { - let acceptSpy = sinon.spy(); - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getOwnProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - mockClassDeclaration.getName.returns('Bob'); - mockClassDeclaration.getNamespace.returns('org.acme'); - mockClassDeclaration.isAbstract.returns(true); - mockClassDeclaration.getSuperType.returns('org.acme.Person'); - - csharpVisitor.visitClassDeclaration(mockClassDeclaration, { ...param, useSystemTextJson: true }); - - param.fileWriter.writeLine.callCount.should.deep.equal(6); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, '[AccordProject.Concerto.Type(Namespace = "org.acme", Version = null, Name = "Bob")]']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, '[System.Text.Json.Serialization.JsonConverter(typeof(AccordProject.Concerto.ConcertoConverterFactorySystem))]']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, 'public abstract class Bob : Person {']); - param.fileWriter.writeLine.getCall(3).args.should.deep.equal([1, '[System.Text.Json.Serialization.JsonPropertyName("$class")]']); - param.fileWriter.writeLine.getCall(4).args.should.deep.equal([1, 'public override string _class { get; } = "undefined";']); - param.fileWriter.writeLine.getCall(5).args.should.deep.equal([0, '}']); - }); - it('should write the class opening and close with abstract and super type, with both serializer flags', () => { - let acceptSpy = sinon.spy(); - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getOwnProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - mockClassDeclaration.getName.returns('Bob'); - mockClassDeclaration.getNamespace.returns('org.acme'); - mockClassDeclaration.isAbstract.returns(true); - mockClassDeclaration.getSuperType.returns('org.acme.Person'); - - csharpVisitor.visitClassDeclaration(mockClassDeclaration, { ...param, useSystemTextJson: true, useNewtonsoftJson: true }); - - param.fileWriter.writeLine.callCount.should.deep.equal(8); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, '[AccordProject.Concerto.Type(Namespace = "org.acme", Version = null, Name = "Bob")]']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, '[System.Text.Json.Serialization.JsonConverter(typeof(AccordProject.Concerto.ConcertoConverterFactorySystem))]']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, '[Newtonsoft.Json.JsonConverter(typeof(AccordProject.Concerto.ConcertoConverterNewtonsoft))]']); - param.fileWriter.writeLine.getCall(3).args.should.deep.equal([0, 'public abstract class Bob : Person {']); - param.fileWriter.writeLine.getCall(4).args.should.deep.equal([1, '[System.Text.Json.Serialization.JsonPropertyName("$class")]']); - param.fileWriter.writeLine.getCall(5).args.should.deep.equal([1, '[Newtonsoft.Json.JsonProperty("$class")]']); - param.fileWriter.writeLine.getCall(6).args.should.deep.equal([1, 'public override string _class { get; } = "undefined";']); - param.fileWriter.writeLine.getCall(7).args.should.deep.equal([0, '}']); - }); - it('should write the class opening and close with virtual modifier for base class', () => { - let acceptSpy = sinon.spy(); - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getOwnProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - mockClassDeclaration.getName.returns('Concept'); - mockClassDeclaration.getNamespace.returns('concerto'); - mockClassDeclaration.getFullyQualifiedName.returns('concerto.Concept'); - mockClassDeclaration.isAbstract.returns(true); - - csharpVisitor.visitClassDeclaration(mockClassDeclaration, param); - - param.fileWriter.writeLine.callCount.should.deep.equal(6); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, '[AccordProject.Concerto.Type(Namespace = "concerto", Version = null, Name = "Concept")]']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, '[System.Text.Json.Serialization.JsonConverter(typeof(AccordProject.Concerto.ConcertoConverterFactorySystem))]']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, 'public abstract class Concept {']); - param.fileWriter.writeLine.getCall(3).args.should.deep.equal([1, '[System.Text.Json.Serialization.JsonPropertyName("$class")]']); - param.fileWriter.writeLine.getCall(4).args.should.deep.equal([1, 'public virtual string _class { get; } = "concerto.Concept";']); - param.fileWriter.writeLine.getCall(5).args.should.deep.equal([0, '}']); - }); - it('should write the class opening and close with virtual modifier for base versioned class', () => { - let acceptSpy = sinon.spy(); - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getOwnProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - mockClassDeclaration.getName.returns('Concept'); - mockClassDeclaration.getNamespace.returns('concerto@1.0.0'); - mockClassDeclaration.getFullyQualifiedName.returns('concerto@1.0.0.Concept'); - mockClassDeclaration.isAbstract.returns(true); - - csharpVisitor.visitClassDeclaration(mockClassDeclaration, param); - - param.fileWriter.writeLine.callCount.should.deep.equal(6); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, '[AccordProject.Concerto.Type(Namespace = "concerto", Version = "1.0.0", Name = "Concept")]']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, '[System.Text.Json.Serialization.JsonConverter(typeof(AccordProject.Concerto.ConcertoConverterFactorySystem))]']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, 'public abstract class Concept {']); - param.fileWriter.writeLine.getCall(3).args.should.deep.equal([1, '[System.Text.Json.Serialization.JsonPropertyName("$class")]']); - param.fileWriter.writeLine.getCall(4).args.should.deep.equal([1, 'public virtual string _class { get; } = "concerto@1.0.0.Concept";']); - param.fileWriter.writeLine.getCall(5).args.should.deep.equal([0, '}']); - }); - }); - - describe('visitScalarField', () => { - let param; - beforeEach(() => { - param = { - fileWriter: mockFileWriter - }; - }); - - it('should write a line for scalar field of type UUID with dotnet type Guid', () => { - const mockField = sinon.createStubInstance(Field); - mockField.isPrimitive.returns(false); - mockField.getName.returns('someId'); - mockField.getType.returns('UUID'); - mockField.isArray.returns(false); - mockField.isTypeScalar.returns(true); - mockField.getFullyQualifiedTypeName.returns('concerto.scalar@1.0.0.UUID'); - - const mockScalarField = sinon.createStubInstance(Field); - mockScalarField.getType.returns('String'); - mockScalarField.getName.returns('someId'); - mockField.getScalarField.returns(mockScalarField); - - csharpVisitor.visitScalarField(mockField, param); - param.fileWriter.writeLine.withArgs(1, 'public System.Guid someId { get; set; }').calledOnce.should.be.ok; - }); - - it('should write a line for scalar optional field of type UUID with dotnet type nullable Guid', () => { - const mockField = sinon.createStubInstance(Field); - mockField.isPrimitive.returns(false); - mockField.getName.returns('someId'); - mockField.getType.returns('UUID'); - mockField.isArray.returns(false); - mockField.isTypeScalar.returns(true); - - mockField.getFullyQualifiedTypeName.returns('concerto.scalar@1.0.0.UUID'); - - const mockScalarField = sinon.createStubInstance(Field); - mockScalarField.getType.returns('String'); - mockScalarField.getName.returns('someId'); - mockScalarField.isOptional.returns(true); - mockField.getScalarField.returns(mockScalarField); - - csharpVisitor.visitScalarField(mockField, param); - param.fileWriter.writeLine.withArgs(1, 'public System.Guid? someId { get; set; }').calledOnce.should.be.ok; - }); - - it('should write a line for scalar field of type UUID from org specific namespce with dotnet type string', () => { - const mockField = sinon.createStubInstance(Field); - mockField.isPrimitive.returns(false); - mockField.getName.returns('someId'); - mockField.getType.returns('UUID'); - mockField.isArray.returns(false); - mockField.isTypeScalar.returns(true); - mockField.getFullyQualifiedTypeName.returns('org.acme.scalar@1.0.0.UUID'); - - const mockScalarField = sinon.createStubInstance(Field); - mockScalarField.getType.returns('String'); - mockScalarField.getName.returns('someId'); - mockField.getScalarField.returns(mockScalarField); - - csharpVisitor.visitScalarField(mockField, param); - param.fileWriter.writeLine.withArgs(1, 'public string someId { get; set; }').calledOnce.should.be.ok; - }); - - it('should write a line for scalar field of non UUID type', () => { - const mockField = sinon.createStubInstance(Field); - mockField.isPrimitive.returns(false); - mockField.getName.returns('someId'); - mockField.getType.returns('SSN'); - mockField.isArray.returns(false); - mockField.isTypeScalar.returns(true); - mockField.getFullyQualifiedTypeName.returns('org.arg@1.2.3.SSN'); - - const mockScalarField = sinon.createStubInstance(Field); - mockScalarField.getType.returns('String'); - mockScalarField.getName.returns('someId'); - mockField.getScalarField.returns(mockScalarField); - - csharpVisitor.visitScalarField(mockField, param); - param.fileWriter.writeLine.withArgs(1, 'public string someId { get; set; }').calledOnce.should.be.ok; - }); - }); - - describe('visitField', () => { - let param; - beforeEach(() => { - param = { - fileWriter: mockFileWriter - }; - }); - it('should write a line for primitive field name and type', () => { - const mockField = sinon.createStubInstance(Field); - mockField.isPrimitive.returns(false); - mockField.getName.returns('name'); - mockField.getType.returns('String'); - mockField.isPrimitive.returns(true); - csharpVisitor.visitField(mockField, param); - param.fileWriter.writeLine.withArgs(1, 'public string name { get; set; }').calledOnce.should.be.ok; - }); - - it('should write a line for primitive field name and type, where the field name is reserved in C#', () => { - const mockField = sinon.createStubInstance(Field); - mockField.isPrimitive.returns(false); - mockField.getName.returns('bool'); - mockField.getType.returns('String'); - mockField.isPrimitive.returns(true); - csharpVisitor.visitField(mockField, param); - param.fileWriter.writeLine.withArgs(1, '[System.Text.Json.Serialization.JsonPropertyName("bool")]').calledOnce.should.be.ok; - param.fileWriter.writeLine.withArgs(1, 'public string _bool { get; set; }').calledOnce.should.be.ok; - }); - - it('should write a line for an optional enum field name and type', () => { - const mockField = sinon.createStubInstance(Field); - mockField.isPrimitive.returns(false); - mockField.getName.returns('myEnum'); - mockField.getType.returns('Enum'); - mockField.isOptional.returns(true); - mockField.isTypeEnum.returns(true); - csharpVisitor.visitField(mockField, param); - param.fileWriter.writeLine.withArgs(1, 'public Enum? myEnum { get; set; }').calledOnce.should.be.ok; - }); - - it('should write a line for field name and type thats an array', () => { - const mockField = sinon.createStubInstance(Field); - mockField.isPrimitive.returns(false); - mockField.getName.returns('Bob'); - mockField.getType.returns('Person'); - mockField.isArray.returns(true); - - const mockModelManager = sinon.createStubInstance(ModelManager); - const mockModelFile = sinon.createStubInstance(ModelFile); - const mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - - mockModelManager.getType.returns(mockClassDeclaration); - mockClassDeclaration.isEnum.returns(false); - mockModelFile.getModelManager.returns(mockModelManager); - mockClassDeclaration.getModelFile.returns(mockModelFile); - mockField.getParent.returns(mockClassDeclaration); - csharpVisitor.visitField(mockField, param); - param.fileWriter.writeLine.withArgs(1, 'public Person[] Bob { get; set; }').calledOnce.should.be.ok; - }); - }); - - describe('visitEnumValueDeclaration', () => { - it('should write a line with the name of the enum value', () => { - let param = { - fileWriter: mockFileWriter - }; - - let mockEnumValueDeclaration = sinon.createStubInstance(EnumValueDeclaration); - mockEnumValueDeclaration.isEnumValue.returns(true); - mockEnumValueDeclaration.getName.returns('Bob'); - - csharpVisitor.visitEnumValueDeclaration(mockEnumValueDeclaration, param); - param.fileWriter.writeLine.withArgs(2, 'Bob,').calledOnce.should.be.ok; - }); - }); - - describe('visitRelationship', () => { - let param; - beforeEach(() => { - param = { - fileWriter: mockFileWriter - }; - }); - it('should write a line for field name and type', () => { - let mockRelationship = sinon.createStubInstance(RelationshipDeclaration); - mockRelationship.isRelationship.returns(true); - mockRelationship.getName.returns('Bob'); - mockRelationship.getType.returns('Person'); - csharpVisitor.visitRelationship(mockRelationship, param); - - param.fileWriter.writeLine.withArgs(1, 'public Person Bob { get; set; }').calledOnce.should.be.ok; - }); - - it('should write a line for field name and type thats an array', () => { - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.getName.returns('Bob'); - mockField.getType.returns('Person'); - mockField.isArray.returns(true); - csharpVisitor.visitRelationship(mockField, param); - - param.fileWriter.writeLine.withArgs(1, 'public Person[] Bob { get; set; }').calledOnce.should.be.ok; - }); - }); - - describe('toCSharpType', () => { - it('should return System.DateTime for DateTime', () => { - csharpVisitor.toCSharpType('DateTime').should.deep.equal('System.DateTime'); - }); - it('should return boolean for Boolean', () => { - csharpVisitor.toCSharpType('Boolean').should.deep.equal('bool'); - }); - it('should return string for String', () => { - csharpVisitor.toCSharpType('String').should.deep.equal('string'); - }); - it('should return number for Double', () => { - csharpVisitor.toCSharpType('Double').should.deep.equal('float'); - }); - it('should return number for Long', () => { - csharpVisitor.toCSharpType('Long').should.deep.equal('long'); - }); - it('should return number for Integer', () => { - csharpVisitor.toCSharpType('Integer').should.deep.equal('int'); - }); - it('should return Guid for Scalar type UUID', () => { - csharpVisitor.toCSharpType('concerto.scalar.UUID').should.deep.equal('System.Guid'); - }); - csharpBuiltInTypes.forEach(builtInType => { - it('should return ' + builtInType + ' for ' + builtInType, () => { - csharpVisitor.toCSharpType(builtInType).should.deep.equal(builtInType); - }); - }); - it('should return passed in type by default', () => { - csharpVisitor.toCSharpType('Penguin').should.deep.equal('Penguin'); - }); - }); -}); - diff --git a/packages/concerto-tools/test/codegen/fromcto/data/model/agreement.cto b/packages/concerto-tools/test/codegen/fromcto/data/model/agreement.cto deleted file mode 100644 index d4c4acb96d..0000000000 --- a/packages/concerto-tools/test/codegen/fromcto/data/model/agreement.cto +++ /dev/null @@ -1,11 +0,0 @@ -namespace org.acme@1.2.3 - -concept AgreementBase { - o String name regex=/^[^?\/:<>|]*$/ - o String externalSource regex=/^([^?\/:<>|+=@-][^?\/:<>|]*)?$/ - o String externalId regex=/^([^?\/:<>|+=@-][^?\/:<>|]*)?$/ - o String agreementType - @DotNetType("decimal") - o Double value optional - o String requestor regex=/^[^\<\>]*$/ -} \ No newline at end of file diff --git a/packages/concerto-tools/test/codegen/fromcto/data/model/circular.cto b/packages/concerto-tools/test/codegen/fromcto/data/model/circular.cto deleted file mode 100755 index 7557a4c4b4..0000000000 --- a/packages/concerto-tools/test/codegen/fromcto/data/model/circular.cto +++ /dev/null @@ -1,202 +0,0 @@ -/** - * Sample business network definition. - */ -namespace xx.yy.zz - -asset SomeTransmission identified by orderNumber { - o String orderNumber //Some order number - --> Par2 aa - --> Par1 bb - o SomeTransmission[] messages -} - -participant Par1 identified by code { - o String mmm - o String name - o String prefix - o String code - o Boolean bool1 - o Boolean bool2 - o Boolean bool3 -} - -participant SomeSss identified by sss { - o String sss - o String mmm - --> Par1 bb - --> Par1 rep2 -} - -participant Par2 identified by id { - o String id - o String name - o String address -} - -transaction BaseTransaction { -} - -transaction UpdateOrderTransaction extends BaseTransaction { - o String orderId - --> Par2 aa - --> Par1 bb - o SomeTransmission transmission -} - -event UpdateOrderEvent { - --> SomeTransmission transmission -} - -asset Some identified by uuid { - o String uuid //Unique identifier -} - -asset AgencyOrder extends Some { - o AXZHDR agyhdr - o AXZDS1 agyds1 - o AXZDS2 agyds2 - o AXZDS3 agyds3 - o AXZDS4 agyds4 - o AXZSTD[] agystds - o AXZCOM[] agycoms - o AXZHIA[] agyhias - o BxblineTransmission[] bxblines - o AXZTLR agytlr -} - -asset SomeRecord identified by uuid { - o String uuid - o String id - o Long orderNumber //Some order number -} - -asset SomeModifier extends SomeRecord { - o Par2 tpar2 - o Par1 tpar1 - o String dt - o String sss - o String cn - o String rts -} - -asset SomePreviousSssModifier extends SomeModifier { - o String previousSssCallLetters -} - -asset SomeMultiple extends SomeRecord { - o String continuation -} - -asset SomeComment extends SomeMultiple { - o String comment -} - - -asset AXZHDR extends SomePreviousSssModifier { - o String version //Some version number - o String routingCode - o String mdaCode - o String clientCode - o String prxOneCode - o String prxTwoCode - o String estimateNumber - o String startDate - o String endDate - o String cashOrTrade - o String scheduleType - o String scheduleStartDate - o Long billWeekStartDay - o String originalOrderNumber - o Long revisionNumber -} - -asset AXZDS1 extends SomeRecord { - o String axyName - o String axyAddress -} - -asset AXZDS2 extends SomeRecord { - o String clientName - o String estimateDescription - o String targetDmxx - o String[] extraDmxxs -} - -asset AXZDS3 extends SomeRecord { - o String prxOneName - o String prxTwoName -} - -asset AXZDS4 extends SomeRecord { - o String bxberCode - o String bxberName - o Long bxberTelephone - o String bxberExtension -} - -asset AXZSTD extends SomeComment { -} - -asset AXZCOM extends SomeComment { -} - -asset AXZHIA extends SomeMultiple { - o String[] dates -} - -asset AXZTLR extends SomeRecord { - o Long numberOfRecords - o Long totalOrderedSpx - o Long totalOrderedDollars -} - -//Bxb record details -asset BxblineTransmission identified by uuid{ - o String uuid - o BXBHDR bxbhdr - o BXBDEM bxbdem - o BXBORB[] bxborbs - o BXBCOM[] bxbcoms - o BXBDTL[] bxbdtls -} - -asset SomeBxbRecord extends SomeRecord { - o Long sequenceNumber - o String sbx - o Long sbxStartDay - o Long startTime - o Long endTime - o Long totalspxyLength - o String lengthInUnits - o Long cost - o String costQualifier - o Long prxOneTimeShare - o String pppName - o String scheduleType -} - -asset BXBHDR extends SomeBxbRecord { - o Long makegoodForBxbline -} - -asset BXBDEM extends SomeRecord { - o Long[] demos -} - -asset BXBORB extends SomeMultiple { - o String sbx - o Long sbxStartDay - o Long startTime - o Long endTime - o String pppName -} - -asset BXBCOM extends SomeComment { -} - -asset BXBDTL extends SomeMultiple { - o Long cost - o String startDate - o Long numberOfWeeks - o Long spxPerWeek -} diff --git a/packages/concerto-tools/test/codegen/fromcto/data/model/hr.cto b/packages/concerto-tools/test/codegen/fromcto/data/model/hr.cto deleted file mode 100644 index 5e8851a9f3..0000000000 --- a/packages/concerto-tools/test/codegen/fromcto/data/model/hr.cto +++ /dev/null @@ -1,92 +0,0 @@ -namespace org.acme.hr@1.0.0 - -enum State { - o MA - o NY - o CO - o WA - o IL - o CA -} - -concept Address { - o String street - o String city - o State state optional - o String zipCode - o String country -} - -concept Company { - o String name - o Address headquarters -} - -enum Department { - o Sales - o Marketing - o Finance - o HR - o Engineering - o Design -} - -@resource -abstract asset Equipment identified by serialNumber { - o String serialNumber -} - -enum LaptopMake { - o Apple - o Microsoft -} - -asset Laptop extends Equipment { - o LaptopMake make -} - -scalar SSN extends String default="000-00-0000" regex=/\d{3}-\d{2}-\{4}+/ - -@resource -abstract participant Person identified by email { - o String email - o String firstName - o String lastName - o String middleNames optional - o Address homeAddress - o SSN ssn - o Double height - o DateTime dob -} - -participant Employee extends Person { - o String employeeId - o Long salary - o Integer numDependents - o Boolean retired - o Department department - o Address officeAddress - o Equipment[] companyAssets - --> Manager manager optional -} - -participant Contractor extends Person { - o Company company - --> Manager manager optional -} - -participant Manager extends Employee { - --> Person[] reports optional -} - -event CompanyEvent { -} - -event Onboarded extends CompanyEvent { - --> Employee employee -} - -transaction ChangeOfAddress { - --> Person Person - o Address newAddress -} diff --git a/packages/concerto-tools/test/codegen/fromcto/data/model/model-base.cto b/packages/concerto-tools/test/codegen/fromcto/data/model/model-base.cto deleted file mode 100755 index 0176c3dba8..0000000000 --- a/packages/concerto-tools/test/codegen/fromcto/data/model/model-base.cto +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Test data types - */ - -// define the namespace for this model -namespace org.acme.base - -enum State { - o GOLD - o SILVER - o BRONZE -} - -@important -@role("name", "manager") -participant Person identified by stringProperty { - o String stringProperty - o UnitedStatesAddress address -} - -@custom("string", "foo", "boolean", false, "intParam", 2, "floatParam", 3.14, "type", SimpleAsset[] ) -participant Bloke identified by stringProperty { - @stuff("two", 3, "bool", true) - o String stringProperty -} - -asset SimpleAsset identified by stringProperty { - o String stringProperty -} - -abstract asset AbstractAsset identified by stringProperty { - o String stringProperty default="defaultString" -} - -abstract concept Address { - o String street - o String city default ="Winchester" - o String country default = "UK" - o Integer[] counts optional -} - -concept UnitedStatesAddress extends Address { - o String zipcode -} - -/** - * Define an asset base class - */ -asset BaseAsset identified by stringProperty { - o String stringProperty default="defaultString" - o Integer integerProperty default=10 optional - o Double doubleProperty default=999.0 optional - o Boolean booleanProperty default=true optional - o DateTime dateTimeProperty default="2008-09-15T15:53:00" optional - o Long longProperty default=1000 optional - o State stateProperty default="GOLD" optional - o String[] stringArrayProperty optional - o Integer[] integerArrayProperty optional - o Double[] doubleArrayProperty optional - o Boolean[] booleanArrayProperty optional - o DateTime[] dateTimeArrayProperty optional - o Long[] longArrayProperty optional - o State[] stateArrayProperty optional - --> Person singlePerson - --> Person[] personArray - - o Person myPerson optional - o Person[] myPeople optional -} - -asset DerivedAsset extends BaseAsset { - o String anotherStringProperty default="defaultString" -} - -transaction MyBasicTransaction { - -} - -asset DerivedDerivedAsset extends DerivedAsset { - o MyBasicTransaction includedTransaction -} - -transaction MyTransaction { - o BaseAsset myAsset - -} - -transaction MyTransactionEx extends MyTransaction { - o BaseAsset anotherBaseAsset - o BaseAsset[] arrayOfBaseAssets -} diff --git a/packages/concerto-tools/test/codegen/fromcto/golang/golangvisitor.js b/packages/concerto-tools/test/codegen/fromcto/golang/golangvisitor.js deleted file mode 100644 index 00d8a1a490..0000000000 --- a/packages/concerto-tools/test/codegen/fromcto/golang/golangvisitor.js +++ /dev/null @@ -1,461 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const chai = require('chai'); -// eslint-disable-next-line no-unused-vars -const should = chai.should(); -const sinon = require('sinon'); - -const GoLangVisitor = require('../../../../lib/codegen/fromcto/golang/golangvisitor.js'); - -const AssetDeclaration = require('@accordproject/concerto-core').AssetDeclaration; -const ClassDeclaration = require('@accordproject/concerto-core').ClassDeclaration; -const EnumDeclaration = require('@accordproject/concerto-core').EnumDeclaration; -const EnumValueDeclaration = require('@accordproject/concerto-core').EnumValueDeclaration; -const Field = require('@accordproject/concerto-core').Field; -const ModelFile = require('@accordproject/concerto-core').ModelFile; -const ModelManager = require('@accordproject/concerto-core').ModelManager; -const FileWriter = require('@accordproject/concerto-util').FileWriter; - -describe('GoLangVisitor', function () { - let goVisit; - let mockFileWriter; - beforeEach(() => { - goVisit = new GoLangVisitor(); - mockFileWriter = sinon.createStubInstance(FileWriter); - }); - - describe('visit', () => { - let param; - beforeEach(() => { - param = { - property1: 'value1' - }; - }); - it('should call visitModelManager for a ModelManager', () => { - let thing = sinon.createStubInstance(ModelManager); - thing.isModelManager.returns(true); - let mockSpecialVisit = sinon.stub(goVisit, 'visitModelManager'); - mockSpecialVisit.returns('Duck'); - - goVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitModelFile for a ModelFile', () => { - let thing = sinon.createStubInstance(ModelFile); - thing.isModelFile.returns(true); - let mockSpecialVisit = sinon.stub(goVisit, 'visitModelFile'); - mockSpecialVisit.returns('Duck'); - - goVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitClassDeclaration for a AssetDeclaration', () => { - let thing = sinon.createStubInstance(AssetDeclaration); - thing.isClassDeclaration.returns(true); - let mockSpecialVisit = sinon.stub(goVisit, 'visitClassDeclaration'); - mockSpecialVisit.returns('Duck'); - - goVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitEnumDeclaration for a EnumDeclaration', () => { - let thing = sinon.createStubInstance(EnumDeclaration); - thing.isEnum.returns(true); - let mockSpecialVisit = sinon.stub(goVisit, 'visitEnumDeclaration'); - mockSpecialVisit.returns('Duck'); - - goVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitClassDeclaration for a ClassDeclaration', () => { - let thing = sinon.createStubInstance(ClassDeclaration); - thing.isClassDeclaration.returns(true); - let mockSpecialVisit = sinon.stub(goVisit, 'visitClassDeclaration'); - mockSpecialVisit.returns('Duck'); - - goVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitField for a Field', () => { - let thing = sinon.createStubInstance(Field); - thing.isField.returns(true); - let mockSpecialVisit = sinon.stub(goVisit, 'visitField'); - mockSpecialVisit.returns('Duck'); - - goVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitEnumValueDeclaration for a EnumValueDeclaration', () => { - let thing = sinon.createStubInstance(EnumValueDeclaration); - thing.isEnumValue.returns(true); - let mockSpecialVisit = sinon.stub(goVisit, 'visitEnumValueDeclaration'); - mockSpecialVisit.returns('Duck'); - - goVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should throw an error when an unrecognised type is supplied', () => { - let thing = 'Something of unrecognised type'; - - (() => { - goVisit.visit(thing, param); - }).should.throw('Unrecognised type: string, value: \'Something of unrecognised type\''); - }); - }); - - describe('visitModelManager', () => { - - it('should call accept for each model file', () => { - let param = { - fileWriter: mockFileWriter - }; - - let acceptSpy = sinon.spy(); - let mockModelManagerDefinition = sinon.createStubInstance(ModelManager); - mockModelManagerDefinition.isModelManager.returns(true); - mockModelManagerDefinition.getModelFiles.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - - goVisit.visitModelManager(mockModelManagerDefinition, param); - acceptSpy.withArgs(goVisit, param).calledTwice.should.be.ok; - }); - }); - - describe('visitModelFile', () => { - let param; - - beforeEach(() => { - param = { - fileWriter: mockFileWriter - }; - }); - - it('should open the modelFile\'s namespace\'s .go file and write to it', () => { - let acceptSpy = sinon.spy(); - - let mockContainsDateTimeField = sinon.stub(goVisit, 'containsDateTimeField'); - mockContainsDateTimeField.returns(false); - - let mockModelFileDefinition = sinon.createStubInstance(ModelFile); - mockModelFileDefinition.isModelFile.returns(true); - mockModelFileDefinition.getNamespace.returns('org.acme'); - mockModelFileDefinition.getImports.returns([]); - mockModelFileDefinition.getAllDeclarations.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - - goVisit.visitModelFile(mockModelFileDefinition, param); - param.fileWriter.openFile.withArgs('org.acme.go').calledOnce.should.be.ok; - param.fileWriter.closeFile.calledOnce.should.be.ok; - acceptSpy.withArgs(goVisit, param).calledTwice.should.be.ok; - }); - - it('should open the modelFile\'s namespace\'s .go file and write to it importing time when needed', () => { - let acceptSpy = sinon.spy(); - - let mockContainsDateTimeField = sinon.stub(goVisit, 'containsDateTimeField'); - mockContainsDateTimeField.returns(true); - - let mockModelFileDefinition = sinon.createStubInstance(ModelFile); - mockModelFileDefinition.isModelFile.returns(true); - mockModelFileDefinition.getNamespace.returns('org.acme'); - mockModelFileDefinition.getImports.returns([]); - mockModelFileDefinition.getAllDeclarations.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - - goVisit.visitModelFile(mockModelFileDefinition, param); - param.fileWriter.openFile.withArgs('org.acme.go').calledOnce.should.be.ok; - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, '// Package org_acme contains domain objects and was generated from Concerto namespace org.acme.']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, 'package org_acme']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, 'import "time"']); - param.fileWriter.closeFile.calledOnce.should.be.ok; - acceptSpy.withArgs(goVisit, param).calledTwice.should.be.ok; - }); - }); - - describe('visitEnumDeclaration', () => { - let param; - - beforeEach(() => { - param = { - fileWriter: mockFileWriter - }; - }); - - it('should write lines defining type and const and call accept for each property', () => { - let acceptSpy = sinon.spy(); - let mockEnumDeclaration = sinon.createStubInstance(EnumDeclaration); - mockEnumDeclaration.isEnum.returns(true); - mockEnumDeclaration.getName.returns('Bob'); - mockEnumDeclaration.getOwnProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - - goVisit.visitEnumDeclaration(mockEnumDeclaration, param); - - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, 'type Bob int']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, 'const (']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, ')']); - acceptSpy.withArgs(goVisit, param).calledTwice.should.be.ok; - }); - }); - - describe('visitClassDeclaration', () => { - let param; - - beforeEach(() => { - param = { - fileWriter: mockFileWriter - }; - }); - - it('should write lines defining type call accept for each property', () => { - let acceptSpy = sinon.spy(); - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getName.returns('Bob'); - mockClassDeclaration.getFullyQualifiedName.returns('org.acme.Bob'); - mockClassDeclaration.getOwnProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - - goVisit.visitClassDeclaration(mockClassDeclaration, param); - - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, 'type Bob struct {']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, '}']); - - acceptSpy.withArgs(goVisit, param).calledTwice.should.be.ok; - }); - - it('should write lines defining type and call accept for each property embedding the super type as necessary', () => { - let acceptSpy = sinon.spy(); - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getName.returns('Bob'); - mockClassDeclaration.getFullyQualifiedName.returns('com.example.Bob'); - mockClassDeclaration.getOwnProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - mockClassDeclaration.getSuperType.returns('org.acme.Person'); - - goVisit.visitClassDeclaration(mockClassDeclaration, param); - - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, 'type Bob struct {']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([1, 'org_acme.Person']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, '}']); - acceptSpy.withArgs(goVisit, param).calledTwice.should.be.ok; - }); - }); - - describe('visitField', () => { - let param; - - beforeEach(() => { - param = { - fileWriter: mockFileWriter - }; - }); - - it('should write a line defining a field', () => { - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.isArray.returns(false); - mockField.getName.returns('bob'); - let mockGoType = sinon.stub(goVisit, 'toGoType'); - mockGoType.returns('string'); - - goVisit.visitField(mockField, param); - - param.fileWriter.writeLine.withArgs(1, 'Bob string `json:"bob"`').calledOnce.should.be.ok; - }); - - it('should write a line defining a field and add [] if an array', () => { - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.isArray.returns(true); - mockField.getName.returns('bob'); - let mockGoType = sinon.stub(goVisit, 'toGoType'); - mockGoType.returns('string'); - - goVisit.visitField(mockField, param); - - param.fileWriter.writeLine.withArgs(1, 'Bob []string `json:"bob"`').calledOnce.should.be.ok; - }); - }); - - describe('visitEnumValueDeclaration', () => { - let param; - - beforeEach(() => { - param = { - fileWriter: mockFileWriter - }; - }); - - it('should write a line using the enum value declaration', () => { - let mockEnumValueDeclaration = sinon.createStubInstance(EnumValueDeclaration); - mockEnumValueDeclaration.isEnumValue.returns(true); - mockEnumValueDeclaration.getParent.returns({ - getOwnProperties: () => { - return [{ - getName: () => { - return 'Bob'; - } - }]; - }, - getName: () => { - return 'Bob'; - } - }); - mockEnumValueDeclaration.getName.returns('Trevor'); - - goVisit.visitEnumValueDeclaration(mockEnumValueDeclaration, param); - - param.fileWriter.writeLine.withArgs(1, 'Trevor').calledOnce.should.be.ok; - }); - - it('should write a line using the enum value decleration adding iota when the first', () => { - let mockEnumValueDeclaration = sinon.createStubInstance(EnumValueDeclaration); - mockEnumValueDeclaration.isEnumValue.returns(true); - mockEnumValueDeclaration.getParent.returns({ - getOwnProperties: () => { - return [{ - getName: () => { - return 'Bob'; - } - }]; - }, - getName: () => { - return 'Bob'; - } - }); - mockEnumValueDeclaration.getName.returns('Bob'); - - goVisit.visitEnumValueDeclaration(mockEnumValueDeclaration, param); - - param.fileWriter.writeLine.withArgs(1, 'Bob Bob = 1 + iota').calledOnce.should.be.ok; - }); - }); - - describe('containsDateTimeField', () => { - it('should return true if the model file contains a data and time field', () => { - let mockModelFileDefinition = sinon.createStubInstance(ModelFile); - mockModelFileDefinition.isModelFile.returns(true); - mockModelFileDefinition.getAllDeclarations.returns([ - { - getProperties: () => { - return [{ - getType: () => { - return 'DateTime'; - } - }]; - } - } - ]); - - goVisit.containsDateTimeField(mockModelFileDefinition).should.deep.equal(true); - }); - - it('should return true if the model file contains a data and time field', () => { - let mockModelFileDefinition = sinon.createStubInstance(ModelFile); - mockModelFileDefinition.isModelFile.returns(true); - mockModelFileDefinition.getAllDeclarations.returns([ - { - getProperties: () => { - return [{ - getType: () => { - return 'String'; - } - }]; - } - } - ]); - - goVisit.containsDateTimeField(mockModelFileDefinition).should.deep.equal(false); - }); - }); - - describe('toGoType', () => { - it('should return time.Time for DateTime', () => { - goVisit.toGoType('DateTime').should.deep.equal('time.Time'); - }); - - it('should return bool for Boolean', () => { - goVisit.toGoType('Boolean').should.deep.equal('bool'); - }); - - it('should return string for String', () => { - goVisit.toGoType('String').should.deep.equal('string'); - }); - - it('should return float64 for Double', () => { - goVisit.toGoType('Double').should.deep.equal('float64'); - }); - - it('should return int for Long', () => { - goVisit.toGoType('Long').should.deep.equal('int64'); - }); - - it('should return int32 for Integer', () => { - goVisit.toGoType('Integer').should.deep.equal('int32'); - }); - - it('should return the param as default', () => { - goVisit.toGoType('Penguin').should.deep.equal('Penguin'); - }); - }); - - describe('toGoPackageName', () => { - it('should replace dots in the passed param with underscore', () => { - goVisit.toGoPackageName('some.dotted.sequence').should.deep.equal('some_dotted_sequence'); - }); - }); -}); \ No newline at end of file diff --git a/packages/concerto-tools/test/codegen/fromcto/graphql/graphqlvisitor.js b/packages/concerto-tools/test/codegen/fromcto/graphql/graphqlvisitor.js deleted file mode 100644 index 1bf7db3a26..0000000000 --- a/packages/concerto-tools/test/codegen/fromcto/graphql/graphqlvisitor.js +++ /dev/null @@ -1,392 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const chai = require('chai'); -chai.should(); -const sinon = require('sinon'); - -const GraphQLVisitor = require('../../../../lib/codegen/fromcto/graphql/graphqlvisitor.js'); - -const ModelFile = require('@accordproject/concerto-core').ModelFile; -const ModelManager = require('@accordproject/concerto-core').ModelManager; -const ClassDeclaration = require('@accordproject/concerto-core').ClassDeclaration; -const EnumValueDeclaration = require('@accordproject/concerto-core').EnumValueDeclaration; -const Field = require('@accordproject/concerto-core').Field; -const RelationshipDeclaration = require('@accordproject/concerto-core').RelationshipDeclaration; -const FileWriter = require('@accordproject/concerto-util').FileWriter; - -const MODEL_WITH_DECORATORS = ` -namespace test - -concept Address { -} - -participant Owner { -} - -@single -asset Vehicle { - @single - o String model - @role( "boolean", true, "string", "value", "int", 1, "float", 3.14, "ref", Address, 'arrayRef', Address[] ) - o String make - o Integer age - o Double price - o Boolean secondHand - o String color optional - --> Owner owner - --> Owner previousOwner optional -} -`; - -describe('GraphQLVisitor', function () { - let graphQLVisitor; - let mockFileWriter; - beforeEach(() => { - graphQLVisitor = new GraphQLVisitor(); - mockFileWriter = sinon.createStubInstance(FileWriter); - }); - - describe('visit', () => { - let param; - beforeEach(() => { - param = { - property1: 'value1' - }; - }); - - it('should call visitModelManager for a ModelManager', () => { - let thing = sinon.createStubInstance(ModelManager); - thing.isModelManager.returns(true); - let mockSpecialVisit = sinon.stub(graphQLVisitor, 'visitModelManager'); - mockSpecialVisit.returns('Duck'); - - graphQLVisitor.visit(thing, param).should.deep.equal('Duck'); - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitModelFile for a ModelFile', () => { - let thing = sinon.createStubInstance(ModelFile); - thing.isModelFile.returns(true); - let mockSpecialVisit = sinon.stub(graphQLVisitor, 'visitModelFile'); - mockSpecialVisit.returns('Duck'); - - graphQLVisitor.visit(thing, param).should.deep.equal('Duck'); - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitClassDeclaration for a ClassDeclaration', () => { - let thing = sinon.createStubInstance(ClassDeclaration); - thing.isClassDeclaration.returns(true); - let mockSpecialVisit = sinon.stub(graphQLVisitor, 'visitClassDeclaration'); - mockSpecialVisit.returns('Duck'); - - graphQLVisitor.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitField for a Field', () => { - let thing = sinon.createStubInstance(Field); - thing.isField.returns(true); - let mockSpecialVisit = sinon.stub(graphQLVisitor, 'visitField'); - mockSpecialVisit.returns('Duck'); - - graphQLVisitor.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitRelationship for a RelationshipDeclaration', () => { - let thing = sinon.createStubInstance(RelationshipDeclaration); - thing.isRelationship.returns(true); - let mockSpecialVisit = sinon.stub(graphQLVisitor, 'visitRelationship'); - mockSpecialVisit.returns('Duck'); - - graphQLVisitor.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitEnumValueDeclaration for a EnumValueDeclaration', () => { - let thing = sinon.createStubInstance(EnumValueDeclaration); - thing.isEnumValue.returns(true); - let mockSpecialVisit = sinon.stub(graphQLVisitor, 'visitEnumValueDeclaration'); - mockSpecialVisit.returns('Duck'); - - graphQLVisitor.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should throw an error when an unrecognised type is supplied', () => { - let thing = 'Something of unrecognised type'; - - (() => { - graphQLVisitor.visit(thing, param); - }).should.throw('Unrecognised \'Something of unrecognised type\''); - }); - }); - - describe('visitModelManager', () => { - - it('should write to the model.gql file and call accept for each model file', () => { - let param = { - fileWriter: mockFileWriter - }; - - let acceptSpy = sinon.spy(); - let mockModelManagerDefinition = sinon.createStubInstance(ModelManager); - mockModelManagerDefinition.isModelManager.returns(true); - mockModelManagerDefinition.getModelFiles.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - - graphQLVisitor.visitModelManager(mockModelManagerDefinition, param); - param.fileWriter.openFile.withArgs('model.gql').calledOnce.should.be.ok; - param.fileWriter.writeLine.callCount.should.deep.equal(1); - param.fileWriter.closeFile.calledOnce.should.be.ok; - acceptSpy.withArgs(graphQLVisitor, param).calledTwice.should.be.ok; - }); - }); - - describe('visitModelFile', () => { - let param; - - beforeEach(() => { - param = { - fileWriter: mockFileWriter - }; - }); - - it('should visit all declaration in a model file', () => { - let acceptSpy = sinon.spy(); - let mockModelFileDefinition = sinon.createStubInstance(ModelFile); - mockModelFileDefinition.isModelFile.returns(true); - mockModelFileDefinition.getNamespace.returns; - mockModelFileDefinition.getAllDeclarations.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - - graphQLVisitor.visitModelFile(mockModelFileDefinition, param); - acceptSpy.withArgs(graphQLVisitor, param).calledTwice.should.be.ok; - }); - }); - - describe('visitClassDeclaration', () => { - it('should write the class declaration for a class', () => { - let acceptSpy = sinon.spy(); - - let param = { - fileWriter: mockFileWriter - }; - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getName.returns('Person'); - mockClassDeclaration.getFullyQualifiedName.returns('org.acme.Person'); - mockClassDeclaration.getProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - - graphQLVisitor.visitClassDeclaration(mockClassDeclaration, param); - - param.fileWriter.writeLine.callCount.should.deep.equal(2); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, 'type Person {']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, '}']); - - acceptSpy.withArgs(graphQLVisitor, param).calledTwice.should.be.ok; - }); - - it('should write the class declaration for an enum', () => { - let acceptSpy = sinon.spy(); - - let param = { - fileWriter: mockFileWriter - }; - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getName.returns('Size'); - mockClassDeclaration.isEnum.returns(true); - mockClassDeclaration.getFullyQualifiedName.returns('org.acme.Size'); - mockClassDeclaration.getProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - - graphQLVisitor.visitClassDeclaration(mockClassDeclaration, param); - - param.fileWriter.writeLine.callCount.should.deep.equal(2); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, 'enum Size {']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, '}']); - - acceptSpy.withArgs(graphQLVisitor, param).calledTwice.should.be.ok; - }); - - it('should write the class declaration for a class (namespaces)', () => { - let acceptSpy = sinon.spy(); - - let param = { - fileWriter: mockFileWriter - }; - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getName.returns('Person'); - mockClassDeclaration.getFullyQualifiedName.returns('org.acme.Person'); - mockClassDeclaration.getProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - - graphQLVisitor = new GraphQLVisitor(true); - graphQLVisitor.visitClassDeclaration(mockClassDeclaration, param); - - param.fileWriter.writeLine.callCount.should.deep.equal(2); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, 'type org_acme_Person {']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, '}']); - - acceptSpy.withArgs(graphQLVisitor, param).calledTwice.should.be.ok; - }); - }); - - describe('visitField', () => { - it('should write a line for a field', () => { - let param = { - fileWriter: mockFileWriter - }; - - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.getType.returns('string'); - mockField.getName.returns('Bob'); - - graphQLVisitor.visitField(mockField, param); - param.fileWriter.writeLine.withArgs(1, 'Bob: string!').calledOnce.should.be.ok; - }); - - it('should write a line for a field (namespaces)', () => { - let param = { - fileWriter: mockFileWriter - }; - - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.getType.returns('org.acme.Person'); - mockField.getName.returns('Bob'); - mockField.getFullyQualifiedTypeName.returns('org.acme.Person'); - - graphQLVisitor = new GraphQLVisitor(true); - graphQLVisitor.visitField(mockField, param); - param.fileWriter.writeLine.withArgs(1, 'Bob: org_acme_Person!').calledOnce.should.be.ok; - }); - - it('should write a line for a field thats an array', () => { - let param = { - fileWriter: mockFileWriter - }; - - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.getType.returns('string'); - mockField.getName.returns('Bob'); - mockField.isArray.returns(true); - - graphQLVisitor.visitField(mockField, param); - param.fileWriter.writeLine.withArgs(1, 'Bob: [string]!').calledOnce.should.be.ok; - }); - }); - - describe('visitEnumValueDeclaration', () => { - it('should write a line for a enum value', () => { - let param = { - fileWriter: mockFileWriter - }; - - let mockEnumValueDecl = sinon.createStubInstance(EnumValueDeclaration); - mockEnumValueDecl.isEnumValue.returns(true); - mockEnumValueDecl.getName.returns('Bob'); - - graphQLVisitor.visitEnumValueDeclaration(mockEnumValueDecl, param); - param.fileWriter.writeLine.withArgs(1, 'Bob').calledOnce.should.be.ok; - }); - }); - - describe('visitRelationship', () => { - it('should write a line for a relationship', () => { - let param = { - fileWriter: mockFileWriter - }; - - let mockRelationship = sinon.createStubInstance(RelationshipDeclaration); - mockRelationship.isRelationship.returns(true); - mockRelationship.getType.returns('string'); - mockRelationship.getName.returns('Bob'); - - graphQLVisitor.visitRelationship(mockRelationship, param); - - param.fileWriter.writeLine.withArgs(1, '+ string Bob'); - }); - - it('should write a line for a relationship thats an array', () => { - let param = { - fileWriter: mockFileWriter - }; - - let mockRelationship = sinon.createStubInstance(RelationshipDeclaration); - mockRelationship.isRelationship.returns(true); - mockRelationship.getType.returns('string'); - mockRelationship.getName.returns('Bob'); - mockRelationship.isArray.returns(true); - - graphQLVisitor.visitRelationship(mockRelationship, param); - - param.fileWriter.writeLine.withArgs(1, '+ string Bob'); - }); - }); - - describe('decorators', () => { - it('should create directives for decorators', () => { - let param = { - fileWriter: mockFileWriter - }; - const modelManager = new ModelManager(); - modelManager.addCTOModel(MODEL_WITH_DECORATORS); - graphQLVisitor.visit(modelManager, param); - param.fileWriter.writeBeforeLine.getCall(0).args.should.deep.equal([0, 'directive @single on OBJECT | FIELD_DEFINITION']); - param.fileWriter.writeBeforeLine.getCall(1).args.should.deep.equal([0, `directive @role(boolean: Boolean -string: String -int: Int -float: Float -ref: String -arrayRef: String) on OBJECT | FIELD_DEFINITION`]); - }); - }); -}); \ No newline at end of file diff --git a/packages/concerto-tools/test/codegen/fromcto/java/javamissingplugin.js b/packages/concerto-tools/test/codegen/fromcto/java/javamissingplugin.js deleted file mode 100644 index 7fed131cc3..0000000000 --- a/packages/concerto-tools/test/codegen/fromcto/java/javamissingplugin.js +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const chai = require('chai'); -chai.should(); -const sinon = require('sinon'); - -const JavaVisitor = require('../../../../lib/codegen/fromcto/java/javavisitor.js'); -const AbstractPlugin = require('../../../../lib/codegen/abstractplugin.js'); - -const ClassDeclaration = require('@accordproject/concerto-core').ClassDeclaration; -const EnumDeclaration = require('@accordproject/concerto-core').EnumDeclaration; -const FileWriter = require('@accordproject/concerto-util').FileWriter; - -describe('JavaMissingPlugin', function () { - let javaVisit; - let mockFileWriter; - beforeEach(() => { - javaVisit = new JavaVisitor(); - javaVisit.plugin = new AbstractPlugin(); - mockFileWriter = sinon.createStubInstance(FileWriter); - }); - - describe('startClassFile', () => { - it('should fail to write a java class file header', () => { - let param = { - fileWriter: mockFileWriter - }; - - let mockClass = sinon.createStubInstance(ClassDeclaration); - mockClass.isClassDeclaration.returns(true); - mockClass.getNamespace.returns('org.acme.people'); - mockClass.getModelFile.returns({ - getNamespace: () => { - return 'org.acme.people'; - }, - getName: () => { - return 'Bob'; - } - }); - - (function () { javaVisit.startClassFile(mockClass, param); }).should.throw('addClassImport not implemented in default plugin'); - - }); - }); - - describe('visitEnumDeclaration', () => { - it('should fail to write an enum declaration and call accept on each property', () => { - let acceptSpy = sinon.spy(); - - let param = { - fileWriter: mockFileWriter - }; - - let mockEnumDeclaration = sinon.createStubInstance(EnumDeclaration); - mockEnumDeclaration.isEnum.returns(true); - mockEnumDeclaration.getName.returns('Bob'); - mockEnumDeclaration.getOwnProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - - sinon.stub(javaVisit, 'startClassFile'); - sinon.stub(javaVisit, 'endClassFile'); - - (function () { javaVisit.visitEnumDeclaration(mockEnumDeclaration, param); }).should.throw('addEnumAnnotations not implemented in default plugin'); - }); - }); - - describe('visitClassDeclaration', () => { - let acceptSpy; - let param; - let mockClassDeclaration; - beforeEach(() => { - acceptSpy = sinon.spy(); - - param = { - fileWriter: mockFileWriter - }; - - mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getName.returns('Bob'); - mockClassDeclaration.getNamespace.returns('acme@1.0.0'); - mockClassDeclaration.getModelFile.returns({ - getImports: () => { - return ['fruit.oranges', 'fruit.apples']; - } - }); - mockClassDeclaration.getOwnProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - mockClassDeclaration.isConcept.returns(false); - mockClassDeclaration.isAbstract.returns(false); - mockClassDeclaration.getSuperType.returns(false); - mockClassDeclaration.getIdentifierFieldName.returns(false); - - sinon.stub(javaVisit, 'startClassFile'); - sinon.stub(javaVisit, 'endClassFile'); - }); - - it('should fail to write a class declaration and call accept on each property', () => { - (function () { javaVisit.visitClassDeclaration(mockClassDeclaration, param); }).should.throw('addClassAnnotations not implemented in default plugin'); - }); - - it('should fail to write additional class declaration methods', () => { - (function () { javaVisit.plugin.addClassMethods(mockClassDeclaration, param); }).should.throw('addClassMethods not implemented in default plugin'); - }); - }); - -}); \ No newline at end of file diff --git a/packages/concerto-tools/test/codegen/fromcto/java/javavisitor.js b/packages/concerto-tools/test/codegen/fromcto/java/javavisitor.js deleted file mode 100644 index a7bca99d1b..0000000000 --- a/packages/concerto-tools/test/codegen/fromcto/java/javavisitor.js +++ /dev/null @@ -1,676 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const chai = require('chai'); -chai.should(); -const sinon = require('sinon'); - -const JavaVisitor = require('../../../../lib/codegen/fromcto/java/javavisitor.js'); - -const ClassDeclaration = require('@accordproject/concerto-core').ClassDeclaration; -const EnumDeclaration = require('@accordproject/concerto-core').EnumDeclaration; -const EnumValueDeclaration = require('@accordproject/concerto-core').EnumValueDeclaration; -const Field = require('@accordproject/concerto-core').Field; -const ModelFile = require('@accordproject/concerto-core').ModelFile; -const ModelManager = require('@accordproject/concerto-core').ModelManager; -const RelationshipDeclaration = require('@accordproject/concerto-core').RelationshipDeclaration; -const FileWriter = require('@accordproject/concerto-util').FileWriter; - -describe('JavaVisitor', function () { - let javaVisit; - let mockFileWriter; - beforeEach(() => { - javaVisit = new JavaVisitor(); - mockFileWriter = sinon.createStubInstance(FileWriter); - }); - - describe('visit', () => { - let param; - beforeEach(() => { - param = { - property1: 'value1' - }; - }); - - it('should call visitModelManager for a ModelManager', () => { - let thing = sinon.createStubInstance(ModelManager); - thing.isModelManager.returns(true); - let mockSpecialVisit = sinon.stub(javaVisit, 'visitModelManager'); - mockSpecialVisit.returns('Duck'); - - javaVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should default to callint visitModelManager with no options', () => { - let thing = sinon.createStubInstance(ModelManager); - thing.isModelManager.returns(true); - let mockSpecialVisit = sinon.stub(javaVisit, 'visitModelManager'); - mockSpecialVisit.returns('Duck'); - - javaVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitModelFile for a ModelFile', () => { - let thing = sinon.createStubInstance(ModelFile); - thing.isModelFile.returns(true); - thing.getNamespace.returns('animal'); - let mockSpecialVisit = sinon.stub(javaVisit, 'visitModelFile'); - mockSpecialVisit.returns('Duck'); - - javaVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitEnumDeclaration for a EnumDeclaration', () => { - let thing = sinon.createStubInstance(EnumDeclaration); - thing.isEnum.returns(true); - let mockSpecialVisit = sinon.stub(javaVisit, 'visitEnumDeclaration'); - mockSpecialVisit.returns('Duck'); - - javaVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitClassDeclaration for a ClassDeclaration', () => { - let thing = sinon.createStubInstance(ClassDeclaration); - thing.isClassDeclaration.returns(true); - let mockSpecialVisit = sinon.stub(javaVisit, 'visitClassDeclaration'); - mockSpecialVisit.returns('Duck'); - - javaVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitField for a Field', () => { - let thing = sinon.createStubInstance(Field); - thing.isField.returns(true); - let mockSpecialVisit = sinon.stub(javaVisit, 'visitField'); - mockSpecialVisit.returns('Duck'); - - javaVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitRelationship for a RelationshipDeclaration', () => { - let thing = sinon.createStubInstance(RelationshipDeclaration); - thing.isRelationship.returns(true); - let mockSpecialVisit = sinon.stub(javaVisit, 'visitRelationship'); - mockSpecialVisit.returns('Duck'); - - javaVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitEnumValueDeclaration for a EnumValueDeclaration', () => { - let thing = sinon.createStubInstance(EnumValueDeclaration); - thing.isEnumValue.returns(true); - let mockSpecialVisit = sinon.stub(javaVisit, 'visitEnumValueDeclaration'); - mockSpecialVisit.returns('Duck'); - - javaVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should throw an error when an unrecognised type is supplied', () => { - let thing = 'Something of unrecognised type'; - - (() => { - javaVisit.visit(thing, param); - }).should.throw('Unrecognised type: string, value: \'Something of unrecognised type\''); - }); - }); - - describe('visitModelFile', () => { - it('should call accept for each declaration', () => { - let param = { - property1: 'value1' - }; - - let acceptSpy = sinon.spy(); - let mockModelFile = sinon.createStubInstance(ModelFile); - mockModelFile.isModelFile.returns(true); - mockModelFile.getAllDeclarations.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - - javaVisit.visitModelFile(mockModelFile, param); - - acceptSpy.withArgs(javaVisit, param).calledTwice.should.be.ok; - }); - }); - - describe('startClassFile', () => { - it('should write a java class file header', () => { - let param = { - fileWriter: mockFileWriter - }; - - let mockClass = sinon.createStubInstance(ClassDeclaration); - mockClass.isClassDeclaration.returns(true); - mockClass.getNamespace.returns('org.acme.people'); - mockClass.getModelFile.returns({ - getNamespace: () => { - return 'org.acme.people'; - }, - getName: () => { - return 'Bob'; - } - }); - - javaVisit.startClassFile(mockClass, param); - - param.fileWriter.openFile.withArgs('org/acme/people/bob.java'); - param.fileWriter.writeLine.callCount.should.deep.equal(3); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, '// this code is generated and should not be modified']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, 'package org.acme.people;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, '']); - }); - }); - - describe('endClassFile', () => { - it('should close a java class file', () => { - let param = { - fileWriter: mockFileWriter - }; - - let mockClass = sinon.createStubInstance(ClassDeclaration); - mockClass.isClassDeclaration.returns(true); - - javaVisit.endClassFile(mockClass, param); - - param.fileWriter.closeFile.calledOnce.should.be.ok; - }); - }); - - describe('visitEnumDeclaration', () => { - it('should write an enum declaration and call accept on each property', () => { - let acceptSpy = sinon.spy(); - - let param = { - fileWriter: mockFileWriter - }; - - let mockEnumDeclaration = sinon.createStubInstance(EnumDeclaration); - mockEnumDeclaration.isEnum.returns(true); - mockEnumDeclaration.getName.returns('Bob'); - mockEnumDeclaration.getOwnProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - - let mockStartClassFile = sinon.stub(javaVisit, 'startClassFile'); - let mockEndClassFile = sinon.stub(javaVisit, 'endClassFile'); - - javaVisit.visitEnumDeclaration(mockEnumDeclaration, param); - - mockStartClassFile.withArgs(mockEnumDeclaration, param).calledOnce.should.be.ok; - param.fileWriter.writeLine.callCount.should.deep.equal(4); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, 'import com.fasterxml.jackson.annotation.*;']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, '@JsonIgnoreProperties({"$class"})']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, 'public enum Bob {']); - param.fileWriter.writeLine.getCall(3).args.should.deep.equal([0, '}']); - mockEndClassFile.withArgs(mockEnumDeclaration, param).calledOnce.should.be.ok; - }); - }); - - describe('visitClassDeclaration', () => { - let acceptSpy; - let param; - let mockClassDeclaration; - let mockStartClassFile; - let mockEndClassFile; - beforeEach(() => { - acceptSpy = sinon.spy(); - - param = { - fileWriter: mockFileWriter - }; - - mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getName.returns('Bob'); - mockClassDeclaration.getNamespace.returns('people'); - mockClassDeclaration.getModelFile.returns({ - getImports: () => { - return ['fruit.oranges', 'fruit.apples']; - } - }); - mockClassDeclaration.getOwnProperties.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - }]); - mockClassDeclaration.isConcept.returns(false); - mockClassDeclaration.isAbstract.returns(false); - mockClassDeclaration.getSuperType.returns(false); - mockClassDeclaration.getIdentifierFieldName.returns(false); - - mockStartClassFile = sinon.stub(javaVisit, 'startClassFile'); - mockEndClassFile = sinon.stub(javaVisit, 'endClassFile'); - }); - - it('should write a class declaration and call accept on each property', () => { - javaVisit.visitClassDeclaration(mockClassDeclaration, param); - - mockStartClassFile.withArgs(mockClassDeclaration, param).calledOnce.should.be.ok; - param.fileWriter.writeLine.callCount.should.deep.equal(6); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, 'import fruit.oranges;']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, 'import fruit.apples;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, 'import com.fasterxml.jackson.annotation.*;']); - param.fileWriter.writeLine.getCall(3).args.should.deep.equal([0, '']); - param.fileWriter.writeLine.getCall(4).args.should.deep.equal([0, 'public class Bob {']); - param.fileWriter.writeLine.getCall(5).args.should.deep.equal([0, '}']); - acceptSpy.withArgs(javaVisit, Object.assign({},param,{mode:'field'})).calledTwice.should.be.ok; - acceptSpy.withArgs(javaVisit, Object.assign({},param,{mode:'getter'})).calledTwice.should.be.ok; - acceptSpy.withArgs(javaVisit, Object.assign({},param,{mode:'setter'})).calledTwice.should.be.ok; - mockEndClassFile.withArgs(mockClassDeclaration, param).calledOnce.should.be.ok; - }); - - it('should write a concept class declaration and call accept on each property', () => { - mockClassDeclaration.isConcept.returns(true); - - javaVisit.visitClassDeclaration(mockClassDeclaration, param); - - mockStartClassFile.withArgs(mockClassDeclaration, param).calledOnce.should.be.ok; - param.fileWriter.writeLine.callCount.should.deep.equal(7); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, 'import fruit.oranges;']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, 'import fruit.apples;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, 'import com.fasterxml.jackson.annotation.*;']); - param.fileWriter.writeLine.getCall(3).args.should.deep.equal([0, '']); - param.fileWriter.writeLine.getCall(4).args.should.deep.equal([0, '@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, property = "$class")']); - param.fileWriter.writeLine.getCall(5).args.should.deep.equal([0, 'public class Bob {']); - param.fileWriter.writeLine.getCall(6).args.should.deep.equal([0, '}']); - acceptSpy.withArgs(javaVisit, Object.assign({},param,{mode:'field'})).calledTwice.should.be.ok; - acceptSpy.withArgs(javaVisit, Object.assign({},param,{mode:'getter'})).calledTwice.should.be.ok; - acceptSpy.withArgs(javaVisit, Object.assign({},param,{mode:'setter'})).calledTwice.should.be.ok; - mockEndClassFile.withArgs(mockClassDeclaration, param).calledOnce.should.be.ok; - }); - - it('should write an abstract class declaration and call accept on each property', () => { - mockClassDeclaration.isAbstract.returns(true); - - javaVisit.visitClassDeclaration(mockClassDeclaration, param); - - mockStartClassFile.withArgs(mockClassDeclaration, param).calledOnce.should.be.ok; - param.fileWriter.writeLine.callCount.should.deep.equal(6); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, 'import fruit.oranges;']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, 'import fruit.apples;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, 'import com.fasterxml.jackson.annotation.*;']); - param.fileWriter.writeLine.getCall(3).args.should.deep.equal([0, '']); - param.fileWriter.writeLine.getCall(4).args.should.deep.equal([0, 'public abstract class Bob {']); - param.fileWriter.writeLine.getCall(5).args.should.deep.equal([0, '}']); - acceptSpy.withArgs(javaVisit, Object.assign({},param,{mode:'field'})).calledTwice.should.be.ok; - acceptSpy.withArgs(javaVisit, Object.assign({},param,{mode:'getter'})).calledTwice.should.be.ok; - acceptSpy.withArgs(javaVisit, Object.assign({},param,{mode:'setter'})).calledTwice.should.be.ok; - mockEndClassFile.withArgs(mockClassDeclaration, param).calledOnce.should.be.ok; - }); - - it('should write a super type class declaration and call accept on each property', () => { - mockClassDeclaration.getSuperType.returns('org.acme.Person'); - - javaVisit.visitClassDeclaration(mockClassDeclaration, param); - - mockStartClassFile.withArgs(mockClassDeclaration, param).calledOnce.should.be.ok; - param.fileWriter.writeLine.callCount.should.deep.equal(6); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, 'import fruit.oranges;']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, 'import fruit.apples;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, 'import com.fasterxml.jackson.annotation.*;']); - param.fileWriter.writeLine.getCall(3).args.should.deep.equal([0, '']); - param.fileWriter.writeLine.getCall(4).args.should.deep.equal([0, 'public class Bob extends Person {']); - param.fileWriter.writeLine.getCall(5).args.should.deep.equal([0, '}']); - acceptSpy.withArgs(javaVisit, Object.assign({},param,{mode:'field'})).calledTwice.should.be.ok; - acceptSpy.withArgs(javaVisit, Object.assign({},param,{mode:'getter'})).calledTwice.should.be.ok; - acceptSpy.withArgs(javaVisit, Object.assign({},param,{mode:'setter'})).calledTwice.should.be.ok; - mockEndClassFile.withArgs(mockClassDeclaration, param).calledOnce.should.be.ok; - }); - - it('should write a class declaration, including a function to access the id field and call accept on each property', () => { - mockClassDeclaration.getIdentifierFieldName.returns('employeeID'); - javaVisit.visitClassDeclaration(mockClassDeclaration, param); - - mockStartClassFile.withArgs(mockClassDeclaration, param).calledOnce.should.be.ok; - param.fileWriter.writeLine.callCount.should.deep.equal(7); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, 'import fruit.oranges;']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, 'import fruit.apples;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([0, 'import com.fasterxml.jackson.annotation.*;']); - param.fileWriter.writeLine.getCall(3).args.should.deep.equal([0, '']); - param.fileWriter.writeLine.getCall(4).args.should.deep.equal([0, 'public class Bob {']); - param.fileWriter.writeLine.getCall(5).args.should.deep.equal([1, ` - // the accessor for the identifying field - public String getID() { - return this.getEmployeeID(); - } -`]); - param.fileWriter.writeLine.getCall(6).args.should.deep.equal([0, '}']); - acceptSpy.withArgs(javaVisit, Object.assign({},param,{mode:'field'})).calledTwice.should.be.ok; - acceptSpy.withArgs(javaVisit, Object.assign({},param,{mode:'getter'})).calledTwice.should.be.ok; - acceptSpy.withArgs(javaVisit, Object.assign({},param,{mode:'setter'})).calledTwice.should.be.ok; - mockEndClassFile.withArgs(mockClassDeclaration, param).calledOnce.should.be.ok; - }); - }); - - describe('visitField', () => { - let param; - - beforeEach(() => { - param = { - fileWriter: mockFileWriter - }; - }); - - it('should default to write a line defining a field', () => { - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.isArray.returns(false); - mockField.getName.returns('Bob'); - mockField.getType.returns('SpecialType'); - let mockJavaType = sinon.stub(javaVisit, 'toJavaType'); - mockJavaType.returns('JavaType'); - - javaVisit.visitField(mockField, param); - param.fileWriter.writeLine.withArgs(1, 'private JavaType Bob;').calledOnce.should.be.ok; - }); - - it('should default to write a line defining a field and add [] if an array', () => { - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.isArray.returns(true); - mockField.getName.returns('Bob'); - mockField.getType.returns('SpecialType'); - let mockJavaType = sinon.stub(javaVisit, 'toJavaType'); - mockJavaType.returns('JavaType'); - - javaVisit.visitField(mockField, param); - param.fileWriter.writeLine.withArgs(1, 'private JavaType[] Bob;').calledOnce.should.be.ok; - }); - - it('should write a line defining a field', () => { - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.isArray.returns(false); - mockField.getName.returns('Bob'); - mockField.getType.returns('SpecialType'); - let mockJavaType = sinon.stub(javaVisit, 'toJavaType'); - mockJavaType.returns('JavaType'); - - javaVisit.visitField(mockField, Object.assign({},param,{mode:'field'})); - param.fileWriter.writeLine.withArgs(1, 'private JavaType Bob;').calledOnce.should.be.ok; - }); - - it('should write a line defining a field and add [] if an array', () => { - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.isArray.returns(true); - mockField.getName.returns('Bob'); - mockField.getType.returns('SpecialType'); - let mockJavaType = sinon.stub(javaVisit, 'toJavaType'); - mockJavaType.returns('JavaType'); - - javaVisit.visitField(mockField, Object.assign({},param,{mode:'field'})); - param.fileWriter.writeLine.withArgs(1, 'private JavaType[] Bob;').calledOnce.should.be.ok; - }); - - it('should write a line setting a field', () => { - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.isArray.returns(false); - mockField.getName.returns('Bob'); - mockField.getType.returns('SpecialType'); - let mockJavaType = sinon.stub(javaVisit, 'toJavaType'); - mockJavaType.returns('JavaType'); - - javaVisit.visitField(mockField, Object.assign({},param,{mode:'setter'})); - param.fileWriter.writeLine.callCount.should.deep.equal(3); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([1, 'public void setBob(JavaType Bob) {']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([2, 'this.Bob = Bob;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([1, '}']); - }); - - it('should write a line setting a field and add [] if an array', () => { - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.isArray.returns(true); - mockField.getName.returns('Bob'); - mockField.getType.returns('SpecialType'); - let mockJavaType = sinon.stub(javaVisit, 'toJavaType'); - mockJavaType.returns('JavaType'); - - javaVisit.visitField(mockField, Object.assign({},param,{mode:'setter'})); - param.fileWriter.writeLine.callCount.should.deep.equal(3); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([1, 'public void setBob(JavaType[] Bob) {']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([2, 'this.Bob = Bob;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([1, '}']); - }); - - it('should write a line getting a field', () => { - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.isArray.returns(false); - mockField.getName.returns('Bob'); - mockField.getType.returns('SpecialType'); - let mockJavaType = sinon.stub(javaVisit, 'toJavaType'); - mockJavaType.returns('JavaType'); - - javaVisit.visitField(mockField, Object.assign({},param,{mode:'getter'})); - param.fileWriter.writeLine.callCount.should.deep.equal(3); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([1, 'public JavaType getBob() {']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([2, 'return this.Bob;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([1, '}']); - }); - - it('should write a line getting a field and add [] if an array', () => { - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.isArray.returns(true); - mockField.getName.returns('Bob'); - mockField.getType.returns('SpecialType'); - let mockJavaType = sinon.stub(javaVisit, 'toJavaType'); - mockJavaType.returns('JavaType'); - - javaVisit.visitField(mockField, Object.assign({},param,{mode:'getter'})); - param.fileWriter.writeLine.callCount.should.deep.equal(3); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([1, 'public JavaType[] getBob() {']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([2, 'return this.Bob;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([1, '}']); - }); - }); - - describe('visitEnumValueDeclaration', () => { - it('should write a line with the enum value', () => { - let param = { - fileWriter: mockFileWriter - }; - - let mockEnumValueDeclaration = sinon.createStubInstance(EnumValueDeclaration); - mockEnumValueDeclaration.isEnumValue.returns(true); - mockEnumValueDeclaration.getName.returns('Bob'); - - javaVisit.visitEnumValueDeclaration(mockEnumValueDeclaration, param); - param.fileWriter.writeLine.withArgs(1, 'Bob,').calledOnce.should.be.ok; - }); - }); - - describe('visitRelationship', () => { - let param; - - beforeEach(() => { - param = { - fileWriter: mockFileWriter - }; - }); - - it('should default to write a line defining a field', () => { - let mockRelationship = sinon.createStubInstance(RelationshipDeclaration); - mockRelationship.isRelationship.returns(true); - mockRelationship.isArray.returns(false); - mockRelationship.getName.returns('Bob'); - mockRelationship.getType.returns('SpecialType'); - let mockJavaType = sinon.stub(javaVisit, 'toJavaType'); - mockJavaType.returns('JavaType'); - - javaVisit.visitRelationship(mockRelationship, param); - param.fileWriter.writeLine.withArgs(1, 'private JavaType Bob;').calledOnce.should.be.ok; - }); - - it('should default to write a line defining a field and add [] if an array', () => { - let mockRelationship = sinon.createStubInstance(RelationshipDeclaration); - mockRelationship.isRelationship.returns(true); - mockRelationship.isArray.returns(true); - mockRelationship.getName.returns('Bob'); - mockRelationship.getType.returns('SpecialType'); - let mockJavaType = sinon.stub(javaVisit, 'toJavaType'); - mockJavaType.returns('JavaType'); - - javaVisit.visitRelationship(mockRelationship, param); - param.fileWriter.writeLine.withArgs(1, 'private JavaType[] Bob;').calledOnce.should.be.ok; - }); - it('should write a line defining a field', () => { - let mockRelationship = sinon.createStubInstance(RelationshipDeclaration); - mockRelationship.isRelationship.returns(true); - mockRelationship.isArray.returns(false); - mockRelationship.getName.returns('Bob'); - mockRelationship.getType.returns('SpecialType'); - let mockJavaType = sinon.stub(javaVisit, 'toJavaType'); - mockJavaType.returns('JavaType'); - - javaVisit.visitRelationship(mockRelationship, Object.assign({},param,{mode:'field'})); - param.fileWriter.writeLine.withArgs(1, 'private JavaType Bob;').calledOnce.should.be.ok; - }); - - it('should write a line defining a field and add [] if an array', () => { - let mockRelationship = sinon.createStubInstance(RelationshipDeclaration); - mockRelationship.isRelationship.returns(true); - mockRelationship.isArray.returns(true); - mockRelationship.getName.returns('Bob'); - mockRelationship.getType.returns('SpecialType'); - let mockJavaType = sinon.stub(javaVisit, 'toJavaType'); - mockJavaType.returns('JavaType'); - - javaVisit.visitRelationship(mockRelationship, Object.assign({},param,{mode:'field'})); - param.fileWriter.writeLine.withArgs(1, 'private JavaType[] Bob;').calledOnce.should.be.ok; - }); - - it('should write a line setting a field', () => { - let mockRelationship = sinon.createStubInstance(RelationshipDeclaration); - mockRelationship.isRelationship.returns(true); - mockRelationship.isArray.returns(false); - mockRelationship.getName.returns('Bob'); - mockRelationship.getType.returns('SpecialType'); - let mockJavaType = sinon.stub(javaVisit, 'toJavaType'); - mockJavaType.returns('JavaType'); - - javaVisit.visitRelationship(mockRelationship, Object.assign({},param,{mode:'setter'})); - param.fileWriter.writeLine.callCount.should.deep.equal(3); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([1, 'public void setBob(JavaType Bob) {']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([2, 'this.Bob = Bob;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([1, '}']); - }); - - it('should write a line setting a field and add [] if an array', () => { - let mockRelationship = sinon.createStubInstance(RelationshipDeclaration); - mockRelationship.isRelationship.returns(true); - mockRelationship.isArray.returns(true); - mockRelationship.getName.returns('Bob'); - mockRelationship.getType.returns('SpecialType'); - let mockJavaType = sinon.stub(javaVisit, 'toJavaType'); - mockJavaType.returns('JavaType'); - - javaVisit.visitRelationship(mockRelationship, Object.assign({},param,{mode:'setter'})); - param.fileWriter.writeLine.callCount.should.deep.equal(3); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([1, 'public void setBob(JavaType[] Bob) {']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([2, 'this.Bob = Bob;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([1, '}']); - }); - - it('should write a line getting a field', () => { - let mockRelationship = sinon.createStubInstance(RelationshipDeclaration); - mockRelationship.isRelationship.returns(true); - mockRelationship.isArray.returns(false); - mockRelationship.getName.returns('Bob'); - mockRelationship.getType.returns('SpecialType'); - let mockJavaType = sinon.stub(javaVisit, 'toJavaType'); - mockJavaType.returns('JavaType'); - - javaVisit.visitRelationship(mockRelationship, Object.assign({},param,{mode:'getter'})); - param.fileWriter.writeLine.callCount.should.deep.equal(3); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([1, 'public JavaType getBob() {']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([2, 'return this.Bob;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([1, '}']); - }); - - it('should write a line getting a field and add [] if an array', () => { - let mockRelationship = sinon.createStubInstance(RelationshipDeclaration); - mockRelationship.isRelationship.returns(true); - mockRelationship.isArray.returns(true); - mockRelationship.getName.returns('Bob'); - mockRelationship.getType.returns('SpecialType'); - let mockJavaType = sinon.stub(javaVisit, 'toJavaType'); - mockJavaType.returns('JavaType'); - - javaVisit.visitRelationship(mockRelationship, Object.assign({},param,{mode:'getter'})); - param.fileWriter.writeLine.callCount.should.deep.equal(3); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([1, 'public JavaType[] getBob() {']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([2, 'return this.Bob;']); - param.fileWriter.writeLine.getCall(2).args.should.deep.equal([1, '}']); - }); - }); - - describe('toJavaType', () => { - it('should return java.util.Date for DateTime', () => { - javaVisit.toJavaType('DateTime').should.deep.equal('java.util.Date'); - }); - - it('should return boolean for Boolean', () => { - javaVisit.toJavaType('Boolean').should.deep.equal('boolean'); - }); - - it('should return String for String', () => { - javaVisit.toJavaType('String').should.deep.equal('String'); - }); - - it('should return double for Double', () => { - javaVisit.toJavaType('Double').should.deep.equal('double'); - }); - - it('should return long for Long', () => { - javaVisit.toJavaType('Long').should.deep.equal('long'); - }); - - it('should return int for Integer', () => { - javaVisit.toJavaType('Integer').should.deep.equal('int'); - }); - - it('should return the param as default', () => { - javaVisit.toJavaType('Penguin').should.deep.equal('Penguin'); - }); - }); -}); \ No newline at end of file diff --git a/packages/concerto-tools/test/codegen/fromcto/jsonschema/jsonschemavisitor.js b/packages/concerto-tools/test/codegen/fromcto/jsonschema/jsonschemavisitor.js deleted file mode 100644 index ba9cf87432..0000000000 --- a/packages/concerto-tools/test/codegen/fromcto/jsonschema/jsonschemavisitor.js +++ /dev/null @@ -1,386 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const Ajv = require('ajv'); -const fs = require('fs'); -const path = require('path'); -const { expect } = require('chai'); -const chai = require('chai'); -chai.should(); - -const FileWriter = require('@accordproject/concerto-util').FileWriter; -const ModelManager = require('@accordproject/concerto-core').ModelManager; -const JSONSchemaVisitor = require('../../../../lib/codegen/fromcto/jsonschema/jsonschemavisitor.js'); -const RecursionDetectionVisitor = require('../../../../lib/codegen/fromcto/jsonschema/recursionvisitor.js'); - -const MODEL_BOUNDS = ` -namespace test - -concept Test { - o String myString regex=/abc.*/ - o Integer intLowerUpper range=[-1,1] - o Integer intLower range=[-1,] - o Integer intUpper range=[,1] - o Long longLowerUpper range=[-1,1] - o Long longLower range=[-1,] - o Long longUpper range=[,1] - o Double doubleLowerUpper range=[-1.2,1.2] - o Double doubleLower range=[-1.2,] - o Double doubleUpper range=[,1.2] -} -`; - -const MODEL_SIMPLE = ` -namespace test - -enum Color { - o RED - o GREEN - o BLUE -} - -scalar Email extends String - -abstract transaction Base identified by id { - o String id -} - -concept Money { - o Double value - o String currencyCode -} - -transaction MyRequest extends Base { - o String name - o DateTime date - o Integer age - o Money money - o Color color - o Email email -} -`; - -const MODEL_SIMPLE_2 = ` -namespace test2 - -concept Vehicle { - o String model - o String make -} -`; - -const MODEL_RECURSIVE_COMPLEX = ` -namespace org.accordproject.ergo.monitor - -@Important -enum Color { - o RED - o GREEN - o BLUE -} - -participant Person identified by ssn { - o String ssn -} - -asset Car identified by vin { - o String vin -} - -transaction SellCar identified by id { - o String id - --> Car car - --> Person seller - --> Person buyer -} - -/** - * CPU time for a compilation phase (single phase, cummulative for that phase, total since process started) - */ -@Test("one", true, "two", 2, "three", 3.14) -concept Phase { - @Name - o String name regex=/abc.*/ - o Double single default=5.0 range=[0.0,10.5] - o Double cummulative range=[0.0,100.0] - o Double total range=[50.0,] - o Integer test range=[-10,10] optional - o Phase[] subphases - o Boolean myBoolean - o DateTime myDateTime - o Color myColor - @Friend - --> Person[] friends - o Car myCar -} - -/** - * Monitor - */ -concept Monitor { - @MonitorDecorator("test") - o Phase[] phases -}`; - -const MODEL_RECURSIVE_SIMPLE = ` -namespace recursive - -enum Role { - o HR - o MARKETING - o ENGINEERING -} - -asset Factory identified by id { - o String id - o Address address -} - -concept Address { - o String street - o Person[] inhabitants -} - -concept Person { - o String name - o Role role - --> Factory factory - o Address address -} -`; - -const UUID_SCALAR = ` -namespace concerto.scalar@1.0.0 - -scalar UUID extends String default="00000000-0000-0000-0000-000000000000" regex=/^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$/ -`; - -const MODEL_SIMPLE3 = ` -namespace test - -import concerto.scalar@1.0.0.{ UUID } - -concept OtherThing identified by id { - o UUID id - o String someId -} -`; -const MODEL_RELATIONSHIP_SIMPLE = ` -namespace test - -import concerto.scalar@1.0.0.{ UUID } - -concept OtherThing identified by id { - o UUID id - o String someId -} - -concept SomeOtherThing identified { - o Integer intField - --> OtherThing otherThingId -} -`; - -describe('JSONSchema (samples)', function () { - - describe('samples', () => { - - it('should detect simple recursive model', () => { - const modelManager = new ModelManager(); - modelManager.addCTOModel( MODEL_RECURSIVE_SIMPLE ); - const visitor = new RecursionDetectionVisitor(); - const type = modelManager.getType('recursive.Person'); - const result = type.accept(visitor, {stack: []}); - expect(result).equal(true); - }); - - it('should detect simple recursive model 2', () => { - const modelManager = new ModelManager(); - modelManager.addCTOModel( MODEL_RECURSIVE_SIMPLE ); - const visitor = new RecursionDetectionVisitor(); - const type = modelManager.getType('recursive.Factory'); - const result = type.accept(visitor, {stack: []}); - expect(result).equal(true); - }); - - it('should detect simple recursive model 3', () => { - const modelManager = new ModelManager(); - modelManager.addCTOModel( MODEL_RECURSIVE_SIMPLE ); - const visitor = new RecursionDetectionVisitor(); - const type = modelManager.getType('recursive.Address'); - const result = type.accept(visitor, {stack: []}); - expect(result).equal(true); - }); - - it('should reference types for simple model', () => { - const modelManager = new ModelManager(); - modelManager.addCTOModel( MODEL_SIMPLE ); - const visitor = new JSONSchemaVisitor(); - const schema = modelManager.accept(visitor, { rootType: 'test.MyRequest'}); - expect(schema.properties.money.$ref).equal('#/definitions/test.Money'); - }); - - it('should handle multiple model files', () => { - const modelManager = new ModelManager(); - modelManager.addCTOModel( MODEL_SIMPLE ); - modelManager.addCTOModel( MODEL_SIMPLE_2 ); - const visitor = new JSONSchemaVisitor(); - const schema = modelManager.accept(visitor, {rootType: 'test.MyRequest' }); - // console.log(JSON.stringify(schema, null, 2)); - expect(schema.definitions['test.Money']).to.not.be.undefined; - expect(schema.definitions['test2.Vehicle']).to.not.be.undefined; - expect(schema.title).equal('MyRequest'); - }); - - it('should generate regex and bounds', () => { - const modelManager = new ModelManager(); - modelManager.addCTOModel( MODEL_BOUNDS ); - const visitor = new JSONSchemaVisitor(); - const schema = modelManager.accept(visitor, { rootType: 'test.Test'}); - expect(schema.properties.myString.pattern).equal('abc.*'); - }); - - it('should inline types for simple model', () => { - const modelManager = new ModelManager(); - modelManager.addCTOModel( MODEL_SIMPLE ); - const visitor = new JSONSchemaVisitor(); - const schema = modelManager.accept(visitor, { rootType: 'test.MyRequest', inlineTypes: true}); - expect(schema.properties.money.$ref).to.be.undefined; - expect(schema.properties.money.title).equal('Money'); - }); - - it('should use format uuid if relationship identifier is UUID type', () => { - const modelManager = new ModelManager(); - modelManager.addCTOModel( UUID_SCALAR ); - modelManager.addCTOModel( MODEL_RELATIONSHIP_SIMPLE ); - const visitor = new JSONSchemaVisitor(); - const schema = modelManager.accept(visitor, { rootType: 'test.SomeOtherThing', inlineTypes: true}); - expect(schema.properties.intField.$ref).to.be.undefined; - expect(schema.properties.otherThingId.$ref).to.be.undefined; - expect(schema.properties.otherThingId.type).equal('string'); - expect(schema.properties.otherThingId.format).equal('uuid'); - }); - - it('should use format uuid for scalar uuid data type', () => { - const modelManager = new ModelManager(); - modelManager.addCTOModel( UUID_SCALAR ); - modelManager.addCTOModel( MODEL_SIMPLE3 ); - const visitor = new JSONSchemaVisitor(); - const schema = modelManager.accept(visitor, { rootType: 'test.OtherThing'}); - expect(schema.properties.id.$ref).to.be.undefined; - expect(schema.properties.id.type).equal('string'); - expect(schema.properties.id.format).equal('uuid'); - expect(schema.properties.someId.type).equal('string'); - expect(schema.properties.someId.format).to.be.undefined; - }); - - it('should write to disk', () => { - const modelManager = new ModelManager(); - modelManager.addCTOModel( MODEL_SIMPLE ); - const visitor = new JSONSchemaVisitor(); - const fileWriter = new FileWriter('./output'); - modelManager.accept(visitor, { fileWriter, rootType: 'test.MyRequest', inlineTypes: true}); - const contents = JSON.parse(fs.readFileSync( path.join('./output', 'test.MyRequest.json'), 'utf-8' )); - expect(contents.title).equal('MyRequest'); - }); - - it('should only return definitions', () => { - const modelManager = new ModelManager(); - modelManager.addCTOModel( MODEL_SIMPLE ); - const visitor = new JSONSchemaVisitor(); - const schema = modelManager.accept(visitor, {}); - expect(schema.title).to.be.undefined; - }); - - it('should detect complex recursive model', () => { - const modelManager = new ModelManager(); - modelManager.addCTOModel( MODEL_RECURSIVE_COMPLEX ); - const visitor = new RecursionDetectionVisitor(); - const type = modelManager.getType('org.accordproject.ergo.monitor.Monitor'); - const result = type.accept(visitor, {stack: []}); - expect(result).equal(true); - }); - - it('should generate JSON schema for recursive schema with decorators and validators', () => { - const modelManager = new ModelManager(); - modelManager.addCTOModel( MODEL_RECURSIVE_COMPLEX ); - - const visitor = new JSONSchemaVisitor(); - const monitorSchema = modelManager.accept(visitor, { rootType: 'org.accordproject.ergo.monitor.Monitor'}); - expect(monitorSchema.title).equal('Monitor'); - - const phaseSchema = modelManager.accept(visitor, { rootType: 'org.accordproject.ergo.monitor.Phase'}); - expect(phaseSchema.title).equal('Phase'); - - // check that the generated schema validates a valid instance - const instance = - { - '$class' : 'org.accordproject.ergo.monitor.Monitor', - 'phases' : [ - { - '$class' : 'org.accordproject.ergo.monitor.Phase', - 'name' : 'abcde', - 'single' : 10.5, - 'total' : 51, - 'test' : 10, - 'cummulative' : 100, - 'subphases' : [], - 'myBoolean' : true, - 'myDateTime' : '2011-10-05T14:48:00.000Z', - 'myColor' : 'RED', - 'myCar' : { - '$class' : 'org.accordproject.ergo.monitor.Car', - 'vin' : '123' - }, - 'friends' : ['ann', 'isaac'] - } - ] - }; - - const ajv = new Ajv({ strict: false }); - expect( ajv.validate(monitorSchema, instance)).equals(true); - }); - - it('should generate JSON schema for simple schema', () => { - const modelManager = new ModelManager(); - modelManager.addCTOModel( MODEL_SIMPLE ); - - const visitor = new JSONSchemaVisitor(); - const schema = modelManager.accept(visitor, { rootType: 'test.MyRequest'}); - expect(schema.title).equal('MyRequest'); - - // check that the generated schema validates a valid instance - const instance = - { - $class : 'test.MyRequest', - id: '001', - age : 10, - name: 'Dan', - color: 'RED', - money : { - $class : 'test.Money', - value: 100.5, - currencyCode: 'GBP' - }, - email: 'hello@example.com', - date: new Date().toISOString(), - }; - - const ajv = new Ajv({ strict: false }); - expect( ajv.validate(schema, instance)).equals(true); - }); - }); -}); diff --git a/packages/concerto-tools/test/codegen/fromcto/loopback/loopbackvisitor.js b/packages/concerto-tools/test/codegen/fromcto/loopback/loopbackvisitor.js deleted file mode 100644 index 1905efdf44..0000000000 --- a/packages/concerto-tools/test/codegen/fromcto/loopback/loopbackvisitor.js +++ /dev/null @@ -1,1367 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const chai = require('chai'); -const should = chai.should(); -const sinon = require('sinon'); - -let LoopbackVisitor= require('../../../../lib/codegen/fromcto/loopback/loopbackvisitor.js'); - -const AssetDeclaration = require('@accordproject/concerto-core').AssetDeclaration; -const ParticipantDeclaration = require('@accordproject/concerto-core').ParticipantDeclaration; -const EventDeclaration = require('@accordproject/concerto-core').EventDeclaration; -const ClassDeclaration = require('@accordproject/concerto-core').ClassDeclaration; -const EnumDeclaration = require('@accordproject/concerto-core').EnumDeclaration; -const ConceptDeclaration = require('@accordproject/concerto-core').ConceptDeclaration; -const EnumValueDeclaration = require('@accordproject/concerto-core').EnumValueDeclaration; -const Field = require('@accordproject/concerto-core').Field; -const ModelFile = require('@accordproject/concerto-core').ModelFile; -const ModelManager = require('@accordproject/concerto-core').ModelManager; -const RelationshipDeclaration = require('@accordproject/concerto-core').RelationshipDeclaration; -const TransactionDeclaration = require('@accordproject/concerto-core').TransactionDeclaration; -const FileWriter = require('@accordproject/concerto-util').FileWriter; - -describe('LoopbackVisitor', () => { - let loopbackVisit; - let mockFileWriter; - beforeEach(() => { - loopbackVisit = new LoopbackVisitor(); - mockFileWriter = sinon.createStubInstance(FileWriter); - }); - - describe('visit', () => { - let param; - beforeEach(() => { - param = { - property1: 'value1' - }; - }); - - it('should call visitModelManager for a ModelManager', () => { - let thing = sinon.createStubInstance(ModelManager); - thing.isModelManager.returns(true); - let mockSpecialVisit = sinon.stub(loopbackVisit, 'visitModelManager'); - mockSpecialVisit.returns('Duck'); - - loopbackVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitModelFile for a ModelFile', () => { - let thing = sinon.createStubInstance(ModelFile); - thing.isModelFile.returns(true); - let mockSpecialVisit = sinon.stub(loopbackVisit, 'visitModelFile'); - mockSpecialVisit.returns('Duck'); - - loopbackVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitAssetDeclaration for a AssetDeclaration', () => { - let thing = sinon.createStubInstance(AssetDeclaration); - thing.isAsset.returns(true); - let mockSpecialVisit = sinon.stub(loopbackVisit, 'visitAssetDeclaration'); - mockSpecialVisit.returns('Duck'); - - loopbackVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitParticipantDeclaration for a ParticipantDeclaration', () => { - let thing = sinon.createStubInstance(ParticipantDeclaration); - thing.isParticipant.returns(true); - let mockSpecialVisit = sinon.stub(loopbackVisit, 'visitParticipantDeclaration'); - mockSpecialVisit.returns('Duck'); - - loopbackVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitConceptDeclaration for a ConceptDeclaration', () => { - let thing = sinon.createStubInstance(ConceptDeclaration); - thing.isConcept.returns(true); - let mockSpecialVisit = sinon.stub(loopbackVisit, 'visitConceptDeclaration'); - mockSpecialVisit.returns('Duck'); - - loopbackVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitTransactionDeclaration for a TransactionDeclaration', () => { - let thing = sinon.createStubInstance(TransactionDeclaration); - thing.isTransaction.returns(true); - let mockSpecialVisit = sinon.stub(loopbackVisit, 'visitTransactionDeclaration'); - mockSpecialVisit.returns('Duck'); - - loopbackVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitEventDeclaration for a EventDeclaration', () => { - let thing = sinon.createStubInstance(EventDeclaration); - thing.isEvent.returns(true); - let mockSpecialVisit = sinon.stub(loopbackVisit, 'visitEventDeclaration'); - mockSpecialVisit.returns('Duck'); - - loopbackVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitEnumDeclaration for a EnumDeclaration', () => { - let thing = sinon.createStubInstance(EnumDeclaration); - thing.isEnum.returns(true); - let mockSpecialVisit = sinon.stub(loopbackVisit, 'visitEnumDeclaration'); - mockSpecialVisit.returns('Duck'); - - loopbackVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitField for a Field', () => { - let thing = sinon.createStubInstance(Field); - thing.isField.returns(true); - let mockSpecialVisit = sinon.stub(loopbackVisit, 'visitField'); - mockSpecialVisit.returns('Duck'); - - loopbackVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitRelationshipDeclaration for a RelationshipDeclaration', () => { - let thing = sinon.createStubInstance(RelationshipDeclaration); - thing.isRelationship.returns(true); - let mockSpecialVisit = sinon.stub(loopbackVisit, 'visitRelationshipDeclaration'); - mockSpecialVisit.returns('Duck'); - - loopbackVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should call visitEnumValueDeclaration for a EnumValueDeclaration', () => { - let thing = sinon.createStubInstance(EnumValueDeclaration); - thing.isEnumValue.returns(true); - let mockSpecialVisit = sinon.stub(loopbackVisit, 'visitEnumValueDeclaration'); - mockSpecialVisit.returns('Duck'); - - loopbackVisit.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should throw an error when an unrecognised type is supplied', () => { - let thing = 'Something of unrecognised type'; - - (() => { - loopbackVisit.visit(thing, param); - }).should.throw('Unrecognised type: string, value: \'Something of unrecognised type\''); - }); - }); - - describe('visitModelManager', () => { - it('should return a value of the concatenated output of each modelFiles accept', () => { - let param = {}; - - let mockModelFile = sinon.createStubInstance(ModelFile); - mockModelFile.isModelFile.returns(true); - mockModelFile.accept.returns(['Duck', 'Duck']); - let mockModelFile2 = sinon.createStubInstance(ModelFile); - mockModelFile2.isModelFile.returns(true); - mockModelFile2.accept.returns(['Duck', 'Goose']); - - let mockModelManager = sinon.createStubInstance(ModelManager); - mockModelManager.isModelManager.returns(true); - mockModelManager.getModelFiles.returns([mockModelFile, mockModelFile2]); - - loopbackVisit.visitModelManager(mockModelManager, param).should.deep.equal(['Duck', 'Duck', 'Duck', 'Goose']); - mockModelFile.accept.withArgs(loopbackVisit, param).calledOnce.should.be.ok; - mockModelFile2.accept.withArgs(loopbackVisit, param).calledOnce.should.be.ok; - param.should.deep.equal({ - modelManager: mockModelManager - }); - }); - }); - - describe('visitModelFile', () => { - it('should return an array of each declaration\'s accept', () => { - let param = {}; - - let mockAssetDeclaration = sinon.createStubInstance(AssetDeclaration); - mockAssetDeclaration.isAsset.returns(true); - mockAssetDeclaration.accept.returns('Duck'); - - let mockConceptDeclaration = sinon.createStubInstance(ConceptDeclaration); - mockConceptDeclaration.isConcept.returns(true); - mockConceptDeclaration.accept.returns('Duck'); - - let mockParticipantDeclaration = sinon.createStubInstance(ParticipantDeclaration); - mockParticipantDeclaration.isParticipant.returns(true); - mockParticipantDeclaration.accept.returns('Duck'); - - let mockTransactionDeclaration = sinon.createStubInstance(TransactionDeclaration); - mockTransactionDeclaration.isTransaction.returns(true); - mockTransactionDeclaration.accept.returns('Goose'); - - let mockModelFile = sinon.createStubInstance(ModelFile); - mockModelFile.isModelFile.returns(true); - mockModelFile.getNamespace.returns; - mockModelFile.getAssetDeclarations.returns([mockAssetDeclaration]); - mockModelFile.getTransactionDeclarations.returns([mockTransactionDeclaration]); - mockModelFile.getConceptDeclarations.returns([mockConceptDeclaration]); - mockModelFile.getParticipantDeclarations.returns([mockParticipantDeclaration]); - - loopbackVisit.visitModelFile(mockModelFile, param).should.deep.equal(['Duck', 'Duck', 'Duck', 'Goose']); - - param.should.deep.equal({ - first: true, - modelFile: mockModelFile - }); - }); - }); - - describe('visitAssetDeclaration', () => { - it('should return the value of visitClassDeclarationCommon using a schema with just type', () => { - let param = {}; - - let mockAssetDeclaration = sinon.createStubInstance(AssetDeclaration); - mockAssetDeclaration.isAsset.returns(true); - mockAssetDeclaration.getFullyQualifiedName.returns('org.acme.Person.Bob'); - mockAssetDeclaration.getName.returns('Bob'); - - let mockVisitClassDeclarationCommon = sinon.stub(loopbackVisit, 'visitClassDeclarationCommon'); - mockVisitClassDeclarationCommon.withArgs(mockAssetDeclaration, param, { - type: 'Object' - }).returns('Class Declaration'); - - loopbackVisit.visitAssetDeclaration(mockAssetDeclaration, param).should.deep.equal('Class Declaration'); - }); - - it('should return the value of visitClassDeclarationCommon buiulding the schema', () => { - let param = { - first: true - }; - - let mockAssetDeclaration = sinon.createStubInstance(AssetDeclaration); - mockAssetDeclaration.isAsset.returns(true); - mockAssetDeclaration.getFullyQualifiedName.returns('org.acme.Person.Bob'); - mockAssetDeclaration.getName.returns('Bob'); - - let expectedSchema = { - $first: true, - name: 'Bob', - description: 'An asset named Bob', - plural: 'Bob', - base: 'PersistedModel', - idInjection: false, - options: { - validateUpsert: true, - composer: { - type: 'asset' - } - }, - properties: {}, - validations: [], - relations: {}, - acls: [], - methods: [] - }; - - let mockVisitClassDeclarationCommon = sinon.stub(loopbackVisit, 'visitClassDeclarationCommon'); - mockVisitClassDeclarationCommon.withArgs(mockAssetDeclaration, param, expectedSchema).returns('Class Declaration'); - - loopbackVisit.visitAssetDeclaration(mockAssetDeclaration, param).should.deep.equal('Class Declaration'); - param.should.have.property('first', false); - }); - - it('should return the value of visitClassDeclarationCommon buiulding the schema using the fullyQualifiedName', () => { - let param = { - first: true - }; - - let mockAssetDeclaration = sinon.createStubInstance(AssetDeclaration); - mockAssetDeclaration.isAsset.returns(true); - mockAssetDeclaration.getFullyQualifiedName.returns('org.acme.Person.Bob'); - mockAssetDeclaration.getName.returns('Bob'); - - let expectedSchema = { - $first: true, - name: 'org_acme_Person_Bob', - description: 'An asset named Bob', - plural: 'org.acme.Person.Bob', - base: 'PersistedModel', - idInjection: false, - options: { - validateUpsert: true, - composer: { - type: 'asset' - } - }, - properties: {}, - validations: [], - relations: {}, - acls: [], - methods: [] - }; - - let mockVisitClassDeclarationCommon = sinon.stub(loopbackVisit, 'visitClassDeclarationCommon'); - mockVisitClassDeclarationCommon.withArgs(mockAssetDeclaration, param, expectedSchema).returns('Class Declaration'); - - loopbackVisit.namespaces = true; - - loopbackVisit.visitAssetDeclaration(mockAssetDeclaration, param).should.deep.equal('Class Declaration'); - param.should.have.property('first', false); - }); - }); - - describe('visitParticipantDeclaration', () => { - it('should return the value of visitClassDeclarationCommon using a schema with just type', () => { - let param = {}; - - let mockParticipantDeclaration = sinon.createStubInstance(ParticipantDeclaration); - mockParticipantDeclaration.isParticipant.returns(true); - mockParticipantDeclaration.getFullyQualifiedName.returns('org.acme.Person.Bob'); - mockParticipantDeclaration.getName.returns('Bob'); - - let mockVisitClassDeclarationCommon = sinon.stub(loopbackVisit, 'visitClassDeclarationCommon'); - mockVisitClassDeclarationCommon.withArgs(mockParticipantDeclaration, param, { - type: 'Object' - }).returns('Class Declaration'); - - loopbackVisit.visitParticipantDeclaration(mockParticipantDeclaration, param).should.deep.equal('Class Declaration'); - }); - - it('should return the value of visitClassDeclarationCommon buiulding the schema', () => { - let param = { - first: true - }; - - let mockParticipantDeclaration = sinon.createStubInstance(ParticipantDeclaration); - mockParticipantDeclaration.isParticipant.returns(true); - mockParticipantDeclaration.getFullyQualifiedName.returns('org.acme.Person.Bob'); - mockParticipantDeclaration.getName.returns('Bob'); - - let expectedSchema = { - $first: true, - name: 'Bob', - description: 'A participant named Bob', - plural: 'Bob', - base: 'PersistedModel', - idInjection: false, - options: { - validateUpsert: true, - composer: { - type: 'participant' - } - }, - properties: {}, - validations: [], - relations: {}, - acls: [], - methods: [] - }; - - let mockVisitClassDeclarationCommon = sinon.stub(loopbackVisit, 'visitClassDeclarationCommon'); - mockVisitClassDeclarationCommon.withArgs(mockParticipantDeclaration, param, expectedSchema).returns('Class Declaration'); - - loopbackVisit.visitParticipantDeclaration(mockParticipantDeclaration, param).should.deep.equal('Class Declaration'); - param.should.have.property('first', false); - }); - - it('should return the value of visitClassDeclarationCommon buiulding the schema using the fullyQualifiedName', () => { - let param = { - first: true - }; - - let mockParticipantDeclaration = sinon.createStubInstance(ParticipantDeclaration); - mockParticipantDeclaration.isParticipant.returns(true); - mockParticipantDeclaration.getFullyQualifiedName.returns('org.acme.Person.Bob'); - mockParticipantDeclaration.getName.returns('Bob'); - - let expectedSchema = { - $first: true, - name: 'org_acme_Person_Bob', - description: 'A participant named Bob', - plural: 'org.acme.Person.Bob', - base: 'PersistedModel', - idInjection: false, - options: { - validateUpsert: true, - composer: { - type: 'participant' - } - }, - properties: {}, - validations: [], - relations: {}, - acls: [], - methods: [] - }; - - let mockVisitClassDeclarationCommon = sinon.stub(loopbackVisit, 'visitClassDeclarationCommon'); - mockVisitClassDeclarationCommon.withArgs(mockParticipantDeclaration, param, expectedSchema).returns('Class Declaration'); - - loopbackVisit.namespaces = true; - - loopbackVisit.visitParticipantDeclaration(mockParticipantDeclaration, param).should.deep.equal('Class Declaration'); - param.should.have.property('first', false); - }); - }); - - describe('visitConceptDeclaration', () => { - it('should return the value of visitClassDeclarationCommon using a schema with just type', () => { - let param = {}; - - let mockConceptDeclaration = sinon.createStubInstance(ConceptDeclaration); - mockConceptDeclaration.isConcept.returns(true); - mockConceptDeclaration.getFullyQualifiedName.returns('org.acme.Person.Bob'); - mockConceptDeclaration.getName.returns('Bob'); - - let mockVisitClassDeclarationCommon = sinon.stub(loopbackVisit, 'visitClassDeclarationCommon'); - mockVisitClassDeclarationCommon.withArgs(mockConceptDeclaration, param, { - type: 'Object' - }).returns('Class Declaration'); - - loopbackVisit.visitConceptDeclaration(mockConceptDeclaration, param).should.deep.equal('Class Declaration'); - }); - - it('should return the value of visitClassDeclarationCommon buiulding the schema', () => { - let param = { - first: true - }; - - let mockConceptDeclaration = sinon.createStubInstance(ConceptDeclaration); - mockConceptDeclaration.isConcept.returns(true); - mockConceptDeclaration.getFullyQualifiedName.returns('org.acme.Person.Bob'); - mockConceptDeclaration.getName.returns('Bob'); - - let expectedSchema = { - $first: true, - name: 'Bob', - description: 'A concept named Bob', - plural: 'Bob', - idInjection: false, - options: { - validateUpsert: true, - composer: { - type: 'concept' - } - }, - properties: {}, - validations: [], - relations: {}, - acls: [], - methods: [] - }; - - let mockVisitClassDeclarationCommon = sinon.stub(loopbackVisit, 'visitClassDeclarationCommon'); - mockVisitClassDeclarationCommon.withArgs(mockConceptDeclaration, param, expectedSchema).returns('Class Declaration'); - - loopbackVisit.visitConceptDeclaration(mockConceptDeclaration, param).should.deep.equal('Class Declaration'); - param.should.have.property('first', false); - }); - - it('should return the value of visitClassDeclarationCommon buiulding the schema using the fullyQualifiedName', () => { - let param = { - first: true - }; - - let mockConceptDeclaration = sinon.createStubInstance(ConceptDeclaration); - mockConceptDeclaration.isConcept.returns(true); - mockConceptDeclaration.getFullyQualifiedName.returns('org.acme.Person.Bob'); - mockConceptDeclaration.getName.returns('Bob'); - - let expectedSchema = { - $first: true, - name: 'org_acme_Person_Bob', - description: 'A concept named Bob', - plural: 'org.acme.Person.Bob', - idInjection: false, - options: { - validateUpsert: true, - composer: { - type: 'concept' - } - }, - properties: {}, - validations: [], - relations: {}, - acls: [], - methods: [] - }; - - let mockVisitClassDeclarationCommon = sinon.stub(loopbackVisit, 'visitClassDeclarationCommon'); - mockVisitClassDeclarationCommon.withArgs(mockConceptDeclaration, param, expectedSchema).returns('Class Declaration'); - - loopbackVisit.namespaces = true; - - loopbackVisit.visitConceptDeclaration(mockConceptDeclaration, param).should.deep.equal('Class Declaration'); - param.should.have.property('first', false); - }); - }); - - describe('visitTransactionDeclaration', () => { - it('should return the value of visitClassDeclarationCommon using a schema with just type', () => { - let param = {}; - - let mockTransactionDeclaration = sinon.createStubInstance(TransactionDeclaration); - mockTransactionDeclaration.isTransaction.returns(true); - mockTransactionDeclaration.getFullyQualifiedName.returns('org.acme.Person.Bob'); - mockTransactionDeclaration.getName.returns('Bob'); - - let mockVisitClassDeclarationCommon = sinon.stub(loopbackVisit, 'visitClassDeclarationCommon'); - mockVisitClassDeclarationCommon.withArgs(mockTransactionDeclaration, param, { - type: 'Object' - }).returns('Class Declaration'); - - loopbackVisit.visitTransactionDeclaration(mockTransactionDeclaration, param).should.deep.equal('Class Declaration'); - }); - - it('should return the value of visitClassDeclarationCommon buiulding the schema', () => { - let param = { - first: true - }; - - let mockTransactionDeclaration = sinon.createStubInstance(TransactionDeclaration); - mockTransactionDeclaration.isTransaction.returns(true); - mockTransactionDeclaration.getFullyQualifiedName.returns('org.acme.Person.Bob'); - mockTransactionDeclaration.getName.returns('Bob'); - - let expectedSchema = { - $first: true, - name: 'Bob', - description: 'A transaction named Bob', - plural: 'Bob', - base: 'PersistedModel', - idInjection: false, - options: { - validateUpsert: true, - composer: { - type: 'transaction' - } - }, - properties: {}, - validations: [], - relations: {}, - acls: [], - methods: [] - }; - - let mockVisitClassDeclarationCommon = sinon.stub(loopbackVisit, 'visitClassDeclarationCommon'); - mockVisitClassDeclarationCommon.withArgs(mockTransactionDeclaration, param, expectedSchema).returns('Class Declaration'); - - loopbackVisit.visitTransactionDeclaration(mockTransactionDeclaration, param).should.deep.equal('Class Declaration'); - param.should.have.property('first', false); - }); - - it('should return the value of visitClassDeclarationCommon buiulding the schema using the fullyQualifiedName', () => { - let param = { - first: true - }; - - let mockTransactionDeclaration = sinon.createStubInstance(TransactionDeclaration); - mockTransactionDeclaration.isTransaction.returns(true); - mockTransactionDeclaration.getFullyQualifiedName.returns('org.acme.Person.Bob'); - mockTransactionDeclaration.getName.returns('Bob'); - - let expectedSchema = { - $first: true, - name: 'org_acme_Person_Bob', - description: 'A transaction named Bob', - plural: 'org.acme.Person.Bob', - base: 'PersistedModel', - idInjection: false, - options: { - validateUpsert: true, - composer: { - type: 'transaction' - } - }, - properties: {}, - validations: [], - relations: {}, - acls: [], - methods: [] - }; - - let mockVisitClassDeclarationCommon = sinon.stub(loopbackVisit, 'visitClassDeclarationCommon'); - mockVisitClassDeclarationCommon.withArgs(mockTransactionDeclaration, param, expectedSchema).returns('Class Declaration'); - - loopbackVisit.namespaces = true; - - loopbackVisit.visitTransactionDeclaration(mockTransactionDeclaration, param).should.deep.equal('Class Declaration'); - param.should.have.property('first', false); - }); - }); - - describe('visitEventDeclaration', () => { - it('should return null', () => { - let mockEventDeclaration = sinon.createStubInstance(EventDeclaration); - mockEventDeclaration.isEvent.returns(true); - mockEventDeclaration.getName.returns('Bob'); - - should.equal(loopbackVisit.visitEventDeclaration(mockEventDeclaration, {}), null); - }); - }); - - describe('visitClassDeclarationCommon', () => { - it('should return a created JSONSchema', () => { - let param = {}; - let jsonSchema = { - title: 'A schema', - description: ' A particularly good schema' - }; - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getName.returns('Person'); - mockClassDeclaration.getFullyQualifiedName.returns('org.acme.Person'); - mockClassDeclaration.getProperties.returns([ - { - getName: () => { - return 'Bob'; - }, - isOptional: () => { - return true; - }, - accept: () => { - return 'Guineapig'; - } - }, - { - getName: () => { - return 'Trevor'; - }, - isOptional: () => { - return false; - }, - accept: () => { - return 'Goldfish'; - } - } - ]); - - loopbackVisit.visitClassDeclarationCommon(mockClassDeclaration, param, jsonSchema).should.deep.equal({ - title: 'A schema', - description: ' A particularly good schema', - properties: { - $class: { - type: 'string', - default: 'org.acme.Person', - description: 'The class identifier for this type', - required: false - }, - Bob: 'Guineapig', - Trevor: 'Goldfish' - } - }); - }); - - it('should return a created JSONSchema autogenerating the description', () => { - let param = {}; - let jsonSchema = { - title: 'A schema' - }; - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getName.returns('Person'); - mockClassDeclaration.getFullyQualifiedName.returns('org.acme.Person'); - mockClassDeclaration.getProperties.returns([ - { - getName: () => { - return 'Bob'; - }, - isOptional: () => { - return true; - }, - accept: () => { - return 'Guineapig'; - } - }, - { - getName: () => { - return 'Trevor'; - }, - isOptional: () => { - return false; - }, - accept: () => { - return 'Goldfish'; - } - } - ]); - - loopbackVisit.visitClassDeclarationCommon(mockClassDeclaration, param, jsonSchema).should.deep.equal({ - title: 'A schema', - description: 'An instance of Person', - properties: { - $class: { - type: 'string', - default: 'org.acme.Person', - description: 'The class identifier for this type', - required: false - }, - Bob: 'Guineapig', - Trevor: 'Goldfish' - } - }); - }); - - it('should return a created JSONSchema adding to the composer options', () => { - let param = {}; - let jsonSchema = { - title: 'A schema', - description: 'A particularly good schema', - options: { - composer: {} - } - }; - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getName.returns('Person'); - mockClassDeclaration.getFullyQualifiedName.returns('org.acme.Person'); - mockClassDeclaration.getNamespace.returns('org.acme'); - mockClassDeclaration.isAbstract.returns(true); - mockClassDeclaration.getProperties.returns([ - { - getName: () => { - return 'Bob'; - }, - isOptional: () => { - return true; - }, - accept: () => { - return 'Guineapig'; - } - }, - { - getName: () => { - return 'Trevor'; - }, - isOptional: () => { - return false; - }, - accept: () => { - return 'Goldfish'; - } - } - ]); - - loopbackVisit.visitClassDeclarationCommon(mockClassDeclaration, param, jsonSchema).should.deep.equal({ - title: 'A schema', - description: 'A particularly good schema', - options: { - composer: { - namespace: 'org.acme', - name: 'Person', - fqn: 'org.acme.Person', - abstract: true - } - }, - properties: { - $class: { - type: 'string', - default: 'org.acme.Person', - description: 'The class identifier for this type', - required: false - }, - Bob: 'Guineapig', - Trevor: 'Goldfish' - } - }); - }); - - it('should return a created top level JSON Schema and write it to a file with the name of the FQN', () => { - let param = { - fileWriter: mockFileWriter - }; - let jsonSchema = { - $first: true, - $schema: true, - title: 'A schema', - description: ' A particularly good schema' - }; - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getName.returns('Person'); - mockClassDeclaration.getFullyQualifiedName.returns('org.acme.Person'); - mockClassDeclaration.getProperties.returns([ - { - getName: () => { - return 'Bob'; - }, - isOptional: () => { - return true; - }, - accept: () => { - return 'Guineapig'; - } - }, - { - getName: () => { - return 'Trevor'; - }, - isOptional: () => { - return false; - }, - accept: () => { - return 'Goldfish'; - } - } - ]); - let expectedResult = { - $schema: true, - title: 'A schema', - description: ' A particularly good schema', - properties: { - $class: { - type: 'string', - default: 'org.acme.Person', - required: false, - description: 'The class identifier for this type' - }, - Bob: 'Guineapig', - Trevor: 'Goldfish' - } - }; - - loopbackVisit.namespaces = true; - - loopbackVisit.visitClassDeclarationCommon(mockClassDeclaration, param, jsonSchema).should.deep.equal(expectedResult); - - param.fileWriter.openFile.withArgs('org.acme.Person.json').calledOnce.should.be.ok; - param.fileWriter.write.withArgs(JSON.stringify(expectedResult, null, 4)).calledOnce.should.be.ok; - param.fileWriter.closeFile.calledOnce.should.be.ok; - }); - - it('should return a created top level JSON Schema and write it to a file with the name of the FQN', () => { - let param = { - fileWriter: null - }; - let jsonSchema = { - $first: true, - $schema: true, - title: 'A schema', - description: ' A particularly good schema' - }; - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getName.returns('Person'); - mockClassDeclaration.getFullyQualifiedName.returns('org.acme.Person'); - mockClassDeclaration.getProperties.returns([ - { - getName: () => { - return 'Bob'; - }, - isOptional: () => { - return true; - }, - accept: () => { - return 'Guineapig'; - } - }, - { - getName: () => { - return 'Trevor'; - }, - isOptional: () => { - return false; - }, - accept: () => { - return 'Goldfish'; - } - } - ]); - let expectedResult = { - $schema: true, - title: 'A schema', - description: ' A particularly good schema', - properties: { - $class: { - type: 'string', - default: 'org.acme.Person', - required: false, - description: 'The class identifier for this type' - }, - Bob: 'Guineapig', - Trevor: 'Goldfish' - } - }; - - loopbackVisit.namespaces = true; - loopbackVisit.visitClassDeclarationCommon(mockClassDeclaration, param, jsonSchema).should.deep.equal(expectedResult); - }); - - it('should return a created top level JSONSchema and write it to a file with the name of the class name', () => { - let param = { - fileWriter: mockFileWriter - }; - let jsonSchema = { - $first: true, - $schema: true, - title: 'A schema', - description: ' A particularly good schema' - }; - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isClassDeclaration.returns(true); - mockClassDeclaration.getName.returns('Person'); - mockClassDeclaration.getFullyQualifiedName.returns('org.acme.Person'); - mockClassDeclaration.getProperties.returns([ - { - getName: () => { - return 'Bob'; - }, - isOptional: () => { - return true; - }, - accept: () => { - return 'Guineapig'; - } - }, - { - getName: () => { - return 'Trevor'; - }, - isOptional: () => { - return false; - }, - accept: () => { - return 'Goldfish'; - } - } - ]); - let expectedResult = { - $schema: true, - title: 'A schema', - description: ' A particularly good schema', - properties: { - $class: { - type: 'string', - default: 'org.acme.Person', - required: false, - description: 'The class identifier for this type' - }, - Bob: 'Guineapig', - Trevor: 'Goldfish' - } - }; - loopbackVisit.visitClassDeclarationCommon(mockClassDeclaration, param, jsonSchema).should.deep.equal(expectedResult); - - param.fileWriter.openFile.withArgs('Person.json').calledOnce.should.be.ok; - param.fileWriter.write.withArgs(JSON.stringify(expectedResult, null, 4)).calledOnce.should.be.ok; - param.fileWriter.closeFile.calledOnce.should.be.ok; - }); - - it('should return a created top level JSONSchema with extra data if a TransactionDeclaration', () => { - let param = {}; - let jsonSchema = { - $schema: true, - title: 'A schema', - description: ' A particularly good schema', - properties: { - noseLength: {} - } - }; - - let mockTransactionDeclaration = sinon.createStubInstance(TransactionDeclaration); - mockTransactionDeclaration.isTransaction.returns(true); - mockTransactionDeclaration.getName.returns('Person'); - mockTransactionDeclaration.getFullyQualifiedName.returns('org.acme.Person'); - mockTransactionDeclaration.getIdentifierFieldName.returns('Bob'); - mockTransactionDeclaration.getProperties.returns([ - { - getName: () => { - return 'Bob'; - }, - isOptional: () => { - return true; - }, - accept: () => { - return { - prop: 'Guineapig' - }; - } - }, - { - getName: () => { - return 'Trevor'; - }, - isOptional: () => { - return false; - }, - accept: () => { - return { - prop: 'Goldfish' - }; - } - }, - ]); - let expectedResult = { - $schema: true, - title: 'A schema', - description: ' A particularly good schema', - properties: { - $class: { - type: 'string', - default: 'org.acme.Person', - required: false, - description: 'The class identifier for this type' - }, - Bob: { - prop: 'Guineapig', - generated: true, - required: false - }, - Trevor: { - prop: 'Goldfish' - }, - }, - forceId: true, - - }; - loopbackVisit.visitClassDeclarationCommon(mockTransactionDeclaration, param, jsonSchema).should.deep.equal(expectedResult); - }); - }); - - describe('toLoopbackType', () => { - it('should return date for DateTime', () => { - LoopbackVisitor.toLoopbackType('DateTime').should.deep.equal('date'); - }); - - it('should return boolean for Boolean', () => { - LoopbackVisitor.toLoopbackType('Boolean').should.deep.equal('boolean'); - }); - - it('should return String for String', () => { - LoopbackVisitor.toLoopbackType('String').should.deep.equal('string'); - }); - - it('should return number for Double', () => { - LoopbackVisitor.toLoopbackType('Double').should.deep.equal('number'); - }); - - it('should return number for Long', () => { - LoopbackVisitor.toLoopbackType('Long').should.deep.equal('number'); - }); - - it('should return number for Integer', () => { - LoopbackVisitor.toLoopbackType('Integer').should.deep.equal('number'); - }); - - it('should return the string as default', () => { - LoopbackVisitor.toLoopbackType('Penguin').should.deep.equal('string'); - }); - }); - - describe('visitField', () => { - it('should return a JSON schema for a primitive', () => { - let param = {}; - - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.getName.returns('Horse'); - mockField.isPrimitive.returns(true); - mockField.getType.returns('String'); - mockField.getParent.returns({ - getIdentifierFieldName: () => { - return 'Farmer'; - } - }); - mockField.isOptional.returns(false); - - loopbackVisit.visitField(mockField, param).should.deep.equal({ - type: 'string', - required: true - }); - }); - - it('should return a JSON schema for a primitive with a default value and when it is an identifying field', () => { - let param = {}; - - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.getName.returns('Farmer'); - mockField.isPrimitive.returns(true); - mockField.getType.returns('String'); - mockField.getParent.returns({ - getIdentifierFieldName: () => { - return 'Farmer'; - } - }); - mockField.getDefaultValue.returns('Ploughed'); - mockField.isOptional.returns(false); - - loopbackVisit.visitField(mockField, param).should.deep.equal({ - type: 'string', - default: 'Ploughed', - id: true, - description: 'The instance identifier for this type', - required: true - }); - }); - - it('should return a JSON schema for an enumeration', () => { - let param = {}; - - let mockModelFile = sinon.createStubInstance(ModelFile); - mockModelFile.accept.withArgs(loopbackVisit, param).returns({ - type: 'Square' - }); - mockModelFile.isModelFile.returns(true); - mockModelFile.getType.withArgs('Acreage').returns({ - accept: mockModelFile.accept - }); - - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.getName.returns('Horse'); - mockField.isTypeEnum.returns(true); - mockField.getType.returns('Acreage'); - mockField.getParent.returns({ - getModelFile: () => { - return mockModelFile; - } - }); - mockField.isOptional.returns(false); - - loopbackVisit.visitField(mockField, param).should.deep.equal({ - type: 'Square', - required: true - }); - }); - - it('should return a JSON schema for an enumeration with a default value', () => { - let param = {}; - - let mockModelFile = sinon.createStubInstance(ModelFile); - mockModelFile.accept.withArgs(loopbackVisit, param).returns({ - type: 'Square' - }); - mockModelFile.isModelFile.returns(true); - mockModelFile.getType.withArgs('Acreage').returns({ - accept: mockModelFile.accept - }); - - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.getName.returns('Horse'); - mockField.isTypeEnum.returns(true); - mockField.getType.returns('Acreage'); - mockField.getParent.returns({ - getModelFile: () => { - return mockModelFile; - } - }); - mockField.isOptional.returns(false); - mockField.getDefaultValue.returns('Trampled'); - - loopbackVisit.visitField(mockField, param).should.deep.equal({ - type: 'Square', - default: 'Trampled', - required: true - }); - }); - - it('should return a JSON schema for a class using type', () => { - let param = {}; - - let mockModelFile = sinon.createStubInstance(ModelFile); - mockModelFile.isModelFile.returns(true); - mockModelFile.getType.withArgs('Acreage').returns({ - accept: mockModelFile.accept - }); - - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.getName.returns('Horse'); - mockField.getType.returns('Acreage'); - mockField.getFullyQualifiedTypeName.returns('org.acme.Horse.Acreage'); - mockField.getParent.returns({ - getModelFile: () => { - return mockModelFile; - } - }); - mockField.isOptional.returns(false); - - loopbackVisit.visitField(mockField, param).should.deep.equal({ - type: 'Acreage', - required: true - }); - - mockModelFile.accept.withArgs(loopbackVisit, param).calledOnce.should.be.ok; - }); - - it('should return a JSON schema for a class using FQN', () => { - let param = {}; - - let mockModelFile = sinon.createStubInstance(ModelFile); - mockModelFile.isModelFile.returns(true); - mockModelFile.getType.withArgs('Acreage').returns({ - accept: mockModelFile.accept - }); - - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.getName.returns('Horse'); - mockField.getType.returns('Acreage'); - mockField.getFullyQualifiedTypeName.returns('org.acme.Horse.Acreage'); - mockField.getParent.returns({ - getModelFile: () => { - return mockModelFile; - } - }); - mockField.isOptional.returns(false); - - loopbackVisit.namespaces = true; - - loopbackVisit.visitField(mockField, param).should.deep.equal({ - type: 'org_acme_Horse_Acreage', - required: true - }); - - mockModelFile.accept.withArgs(loopbackVisit, param).calledOnce.should.be.ok; - }); - - it('should return a JSON schema for a class without calling accept', () => { - let param = { - 'org.acme.Horse.Acreage': 'Something' - }; - - let mockModelFile = sinon.createStubInstance(ModelFile); - mockModelFile.isModelFile.returns(true); - mockModelFile.getType.withArgs('Acreage').returns({ - accept: mockModelFile.accept - }); - - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.getName.returns('Horse'); - mockField.getType.returns('Acreage'); - mockField.getFullyQualifiedTypeName.returns('org.acme.Horse.Acreage'); - mockField.getParent.returns({ - getModelFile: () => { - return mockModelFile; - } - }); - mockField.isOptional.returns(false); - - loopbackVisit.visitField(mockField, param).should.deep.equal({ - type: 'Acreage', - required: true - }); - - mockModelFile.accept.callCount.should.deep.equal(0); - }); - - it('should return a JSON schema for a primitive that is an array', () => { - let param = {}; - - let mockField = sinon.createStubInstance(Field); - mockField.isField.returns(true); - mockField.getName.returns('Horse'); - mockField.isPrimitive.returns(true); - mockField.getType.returns('String'); - mockField.getParent.returns({ - getIdentifierFieldName: () => { - return 'Farmer'; - } - }); - mockField.isOptional.returns(false); - mockField.isArray.returns(true); - - loopbackVisit.visitField(mockField, param).should.deep.equal({ - type: ['string'], - required: false, - default: [] - }); - }); - }); - - describe('visitEnumDeclaration', () => { - it('should create a JSON schema for an enum declaration', () => { - let param = {}; - - let mockEnumDecl = sinon.createStubInstance(EnumDeclaration); - mockEnumDecl.accept.withArgs(loopbackVisit, param).returns('Duck'); - mockEnumDecl.isEnum.returns(true); - mockEnumDecl.getProperties.returns([ - { - accept: mockEnumDecl.accept - }, - { - accept: mockEnumDecl.accept - } - ]); - - loopbackVisit.visitEnumDeclaration(mockEnumDecl, param).should.deep.equal({ - type: 'string', - enum: ['Duck', 'Duck'] - }); - }); - }); - - describe('visitEnumValueDeclaration', () => { - it('should return the enumValueDeclaration\'s name', () => { - let mockEnumValDecl = sinon.createStubInstance(EnumValueDeclaration); - mockEnumValDecl.isEnumValue.returns(true); - mockEnumValDecl.getName.returns('Bob'); - - loopbackVisit.visitEnumValueDeclaration(mockEnumValDecl, {}).should.deep.equal('Bob'); - }); - }); - - describe('visitRelationshipDeclaration', () => { - it('should return a JSONSchema for a relationship', () => { - let mockRelationshipDeclaration = sinon.createStubInstance(RelationshipDeclaration); - mockRelationshipDeclaration.isRelationship.returns(true); - mockRelationshipDeclaration.getName.returns('Bob'); - mockRelationshipDeclaration.isOptional.returns(false); - - loopbackVisit.visitRelationshipDeclaration(mockRelationshipDeclaration, {}).should.deep.equal({ - type: 'any', - description: 'The identifier of an instance of Bob', - required: true - }); - }); - - it('should return a JSONSchema for a relationship that is an array', () => { - let mockRelationshipDeclaration = sinon.createStubInstance(RelationshipDeclaration); - mockRelationshipDeclaration.isRelationship.returns(true); - mockRelationshipDeclaration.getName.returns('Bob'); - mockRelationshipDeclaration.isOptional.returns(false); - mockRelationshipDeclaration.isArray.returns(true); - - loopbackVisit.visitRelationshipDeclaration(mockRelationshipDeclaration, {}).should.deep.equal({ - type: ['any'], - description: 'The identifier of an instance of Bob', - required: true - }); - }); - }); -}); \ No newline at end of file diff --git a/packages/concerto-tools/test/codegen/fromcto/loopback/loopbackvisitorcircular.js b/packages/concerto-tools/test/codegen/fromcto/loopback/loopbackvisitorcircular.js deleted file mode 100644 index ec31d3d068..0000000000 --- a/packages/concerto-tools/test/codegen/fromcto/loopback/loopbackvisitorcircular.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const fs = require('fs'); -const FileWriter = require('@accordproject/concerto-util').FileWriter; -const ModelManager = require('@accordproject/concerto-core').ModelManager; -const LoopbackVisitor = require('../../../../lib/codegen/fromcto/loopback/loopbackvisitor'); -const path = require('path'); - -require('chai').should(); -const sinon = require('sinon'); - -describe('LoopbackVisitor with Circular Model', () => { - - let mockFileWriter; - let modelManager; - let visitor; - - let sandbox; - - [undefined, true, false].forEach((namespaces) => { - - describe(`namespaces = ${namespaces}`, () => { - - beforeEach(() => { - mockFileWriter = sinon.createStubInstance(FileWriter); - modelManager = new ModelManager(); - modelManager.addCTOModel(fs.readFileSync(path.resolve(__dirname, '../data/model/circular.cto'), 'utf8'), 'circular.cto'); - visitor = new LoopbackVisitor(namespaces); - sandbox = sinon.createSandbox(); - }); - - afterEach(() => { - sandbox.restore(); - }); - - describe('#visit', () => { - - it('should generate Loopback model files for each type when given a model manager', () => { - - // Visit all of the loaded model files and check that they were all generated - const schemas = modelManager.accept(visitor, { fileWriter: mockFileWriter }); - schemas.length.should.equal(29); - }); - - }); - - }); - }); - -}); diff --git a/packages/concerto-tools/test/codegen/fromcto/odata/odatavisitor.js b/packages/concerto-tools/test/codegen/fromcto/odata/odatavisitor.js deleted file mode 100644 index a329c2a641..0000000000 --- a/packages/concerto-tools/test/codegen/fromcto/odata/odatavisitor.js +++ /dev/null @@ -1,613 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const chai = require('chai'); -chai.should(); -const sinon = require('sinon'); - -const ODataVisitor = require('../../../../lib/codegen/fromcto/odata/odatavisitor.js'); - -const ClassDeclaration = require('@accordproject/concerto-core').ClassDeclaration; -const EnumDeclaration = require('@accordproject/concerto-core').EnumDeclaration; -const EnumValueDeclaration = require('@accordproject/concerto-core').EnumValueDeclaration; -const Field = require('@accordproject/concerto-core').Field; -const ModelFile = require('@accordproject/concerto-core').ModelFile; -const ModelManager = require('@accordproject/concerto-core').ModelManager; -const RelationshipDeclaration = require('@accordproject/concerto-core').RelationshipDeclaration; -const Decorator = require('@accordproject/concerto-core').Decorator; -const FileWriter = require('@accordproject/concerto-util').FileWriter; - -describe('ODataVisitor', function () { - let oDataVisitor; - let mockFileWriter; - beforeEach(() => { - oDataVisitor = new ODataVisitor(); - mockFileWriter = sinon.createStubInstance(FileWriter); - }); - - describe('visit', () => { - let param; - beforeEach(() => { - param = { - property1: 'value1' - }; - }); - - it('should return visitModelManager for a ModelManager', () => { - let thing = sinon.createStubInstance(ModelManager); - thing.isModelManager.returns(true); - let mockSpecialVisit = sinon.stub(oDataVisitor, 'visitModelManager'); - mockSpecialVisit.returns('Duck'); - - oDataVisitor.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitModelFile for a ModelFile', () => { - let thing = sinon.createStubInstance(ModelFile); - thing.isModelFile.returns(true); - let mockSpecialVisit = sinon.stub(oDataVisitor, 'visitModelFile'); - mockSpecialVisit.returns('Duck'); - - oDataVisitor.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitEnumDeclaration for a EnumDeclaration', () => { - let thing = sinon.createStubInstance(EnumDeclaration); - thing.isEnum.returns(true); - let mockSpecialVisit = sinon.stub(oDataVisitor, 'visitEnumDeclaration'); - mockSpecialVisit.returns('Duck'); - - oDataVisitor.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitClassDeclaration for a ClassDeclaration', () => { - let thing = sinon.createStubInstance(ClassDeclaration); - thing.isClassDeclaration.returns(true); - let mockSpecialVisit = sinon.stub(oDataVisitor, 'visitClassDeclaration'); - mockSpecialVisit.returns('Duck'); - - oDataVisitor.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitField for a Field', () => { - let thing = sinon.createStubInstance(Field); - thing.isField.returns(true); - let mockSpecialVisit = sinon.stub(oDataVisitor, 'visitField'); - mockSpecialVisit.returns('Duck'); - - oDataVisitor.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitRelationship for a RelationshipDeclaration', () => { - let thing = sinon.createStubInstance(RelationshipDeclaration); - thing.isRelationship.returns(true); - let mockSpecialVisit = sinon.stub(oDataVisitor, 'visitRelationship'); - mockSpecialVisit.returns('Duck'); - - oDataVisitor.visit(thing, param).should.deep.equal('Duck'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitEnumValueDeclaration for a EnumValueDeclaration', () => { - let thing = sinon.createStubInstance(EnumValueDeclaration); - thing.isEnumValue.returns(true); - let mockSpecialVisit = sinon.stub(oDataVisitor, 'visitEnumValueDeclaration'); - mockSpecialVisit.returns('Goose'); - - oDataVisitor.visit(thing, param).should.deep.equal('Goose'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should return visitDecorator for a Decorator', () => { - let thing = sinon.createStubInstance(Decorator); - thing.isDecorator.returns(true); - let mockSpecialVisit = sinon.stub(oDataVisitor, 'visitDecorator'); - mockSpecialVisit.returns('Goose'); - - oDataVisitor.visit(thing, param).should.deep.equal('Goose'); - - mockSpecialVisit.calledWith(thing, param).should.be.ok; - }); - - it('should throw an error when an unrecognised type is supplied', () => { - let thing = 'Something of unrecognised type'; - - (() => { - oDataVisitor.visit(thing, param); - }).should.throw('Something of unrecognised type'); - }); - }); - - describe('visitModelManager', () => { - it('should call accept for each model file', () => { - let acceptSpy = sinon.spy(); - - let param = {}; - - let mockModelManager = sinon.createStubInstance(ModelManager); - mockModelManager.isModelManager.returns(true); - mockModelManager.getModelFiles.returns([{ - accept: acceptSpy - }, - { - accept: acceptSpy - } - ]); - - oDataVisitor.visitModelManager(mockModelManager, param); - - acceptSpy.withArgs(oDataVisitor, param).calledTwice.should.be.ok; - }); - }); - - describe('visitModelFile', () => { - let param; - beforeEach(() => { - param = { - fileWriter: mockFileWriter - }; - }); - it('should write lines for the imports that are not in own namespace (including super types) ignoring primitives', () => { - let acceptSpy = sinon.spy(); - let mockEnum = sinon.createStubInstance(EnumDeclaration); - mockEnum.isEnum.returns(true); - mockEnum.accept = acceptSpy; - - let property1 = { - isPrimitive: () => { - return false; - }, - getFullyQualifiedTypeName: () => { - return 'org.org1.Property1'; - } - }; - - let property2 = { - isPrimitive: () => { - return false; - }, - getFullyQualifiedTypeName: () => { - return 'org.acme.Property2'; - } - }; - - let property3 = { - isPrimitive: () => { - return true; - }, - getFullyQualifiedTypeName: () => { - return 'super.Property3'; - } - }; - - let mockModelManager = sinon.createStubInstance(ModelManager); - mockModelManager.isModelManager.returns(true); - - let mockClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration.isEnum.returns(false); - mockClassDeclaration.getNamespace.returns('org.acme'); - mockClassDeclaration.getSuperType.returns('super.Parent'); - mockClassDeclaration.getProperties.returns([property1, property2, property3]); - mockClassDeclaration.accept = acceptSpy; - - let mockImportedClassDeclaration = sinon.createStubInstance(ClassDeclaration); - mockImportedClassDeclaration.isEnum.returns(false); - mockImportedClassDeclaration.getNamespace.returns('org.imported'); - mockImportedClassDeclaration.getSuperType.returns('super.Parent'); - mockImportedClassDeclaration.getProperties.returns([]); - mockImportedClassDeclaration.accept = acceptSpy; - - mockModelManager.getType.returns(mockImportedClassDeclaration); - - let mockClassDeclaration2 = sinon.createStubInstance(ClassDeclaration); - mockClassDeclaration2.isEnum.returns(false); - mockClassDeclaration2.getNamespace.returns('org.acme'); - mockClassDeclaration2.getSuperType.returns('super.Parent'); - mockClassDeclaration2.getProperties.returns([]); - mockClassDeclaration2.accept = acceptSpy; - - let mockModelFile = sinon.createStubInstance(ModelFile); - mockModelFile.getModelManager.returns(mockModelManager); - mockModelFile.getNamespace.returns('org.acme'); - mockModelFile.getAllDeclarations.returns([ - mockEnum, - mockClassDeclaration, - mockClassDeclaration2 - ]); - mockModelFile.getImports.returns([ - 'org.org1.Import1', - 'org.org1.Import2', - 'org.org2.Import1', - 'super.Property3', - 'super.Parent' - ]); - - oDataVisitor.visitModelFile(mockModelFile, param); - - param.fileWriter.openFile.withArgs('org.acme.csdl').calledOnce.should.be.ok; - param.fileWriter.writeLine.callCount.should.deep.equal(15); - param.fileWriter.writeLine.getCall(0).args.should.deep.equal([0, '']); - param.fileWriter.writeLine.getCall(1).args.should.deep.equal([0, '