diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 714ead978..d9f3b7218 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v174 \ No newline at end of file +v183 \ No newline at end of file diff --git a/stripe/api_resources/__init__.py b/stripe/api_resources/__init__.py index 815130bba..ee71a7610 100644 --- a/stripe/api_resources/__init__.py +++ b/stripe/api_resources/__init__.py @@ -40,6 +40,9 @@ from stripe.api_resources.customer_balance_transaction import ( CustomerBalanceTransaction, ) +from stripe.api_resources.customer_cash_balance_transaction import ( + CustomerCashBalanceTransaction, +) from stripe.api_resources.dispute import Dispute from stripe.api_resources.ephemeral_key import EphemeralKey from stripe.api_resources.event import Event diff --git a/stripe/api_resources/account.py b/stripe/api_resources/account.py index fd5ff77e0..f9799d6c8 100644 --- a/stripe/api_resources/account.py +++ b/stripe/api_resources/account.py @@ -32,6 +32,15 @@ class Account( ListableAPIResource, UpdateableAPIResource, ): + """ + This is an object representing a Stripe account. You can retrieve it to see + properties on the account like its current e-mail address or if the account is + enabled yet to make live charges. + + Some properties, marked below, are available only to platforms that want to + [create and manage Express or Custom accounts](https://stripe.com/docs/connect/accounts). + """ + OBJECT_NAME = "account" @classmethod diff --git a/stripe/api_resources/account_link.py b/stripe/api_resources/account_link.py index 8ee5e043c..238aaa06e 100644 --- a/stripe/api_resources/account_link.py +++ b/stripe/api_resources/account_link.py @@ -5,4 +5,11 @@ class AccountLink(CreateableAPIResource): + """ + Account Links are the means by which a Connect platform grants a connected account permission to access + Stripe-hosted applications, such as Connect Onboarding. + + Related guide: [Connect Onboarding](https://stripe.com/docs/connect/connect-onboarding). + """ + OBJECT_NAME = "account_link" diff --git a/stripe/api_resources/application_fee_refund.py b/stripe/api_resources/application_fee_refund.py index 271140c8e..46accf087 100644 --- a/stripe/api_resources/application_fee_refund.py +++ b/stripe/api_resources/application_fee_refund.py @@ -8,6 +8,14 @@ class ApplicationFeeRefund(UpdateableAPIResource): + """ + `Application Fee Refund` objects allow you to refund an application fee that + has previously been created but not yet refunded. Funds will be refunded to + the Stripe account from which the fee was originally collected. + + Related guide: [Refunding Application Fees](https://stripe.com/docs/connect/destination-charges#refunding-app-fee). + """ + OBJECT_NAME = "fee_refund" @classmethod diff --git a/stripe/api_resources/apps/secret.py b/stripe/api_resources/apps/secret.py index 7e7df6a98..8a57f756c 100644 --- a/stripe/api_resources/apps/secret.py +++ b/stripe/api_resources/apps/secret.py @@ -6,6 +6,18 @@ class Secret(CreateableAPIResource, ListableAPIResource): + """ + Secret Store is an API that allows Stripe Apps developers to securely persist secrets for use by UI Extensions and app backends. + + The primary resource in Secret Store is a `secret`. Other apps can't view secrets created by an app. Additionally, secrets are scoped to provide further permission control. + + All Dashboard users and the app backend share `account` scoped secrets. Use the `account` scope for secrets that don't change per-user, like a third-party API key. + + A `user` scoped secret is accessible by the app backend and one specific Dashboard user. Use the `user` scope for per-user secrets like per-user OAuth tokens, where different users might have different permissions. + + Related guide: [Store data between page reloads](https://stripe.com/docs/stripe-apps/store-auth-data-custom-objects). + """ + OBJECT_NAME = "apps.secret" @classmethod diff --git a/stripe/api_resources/balance.py b/stripe/api_resources/balance.py index 7462b69a9..03c9d03db 100644 --- a/stripe/api_resources/balance.py +++ b/stripe/api_resources/balance.py @@ -5,6 +5,20 @@ class Balance(SingletonAPIResource): + """ + This is an object representing your Stripe balance. You can retrieve it to see + the balance currently on your Stripe account. + + You can also retrieve the balance history, which contains a list of + [transactions](https://stripe.com/docs/reporting/balance-transaction-types) that contributed to the balance + (charges, payouts, and so forth). + + The available and pending amounts for each currency are broken down further by + payment source types. + + Related guide: [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). + """ + OBJECT_NAME = "balance" @classmethod diff --git a/stripe/api_resources/balance_transaction.py b/stripe/api_resources/balance_transaction.py index dc0659551..82a3b3e83 100644 --- a/stripe/api_resources/balance_transaction.py +++ b/stripe/api_resources/balance_transaction.py @@ -5,4 +5,11 @@ class BalanceTransaction(ListableAPIResource): + """ + Balance transactions represent funds moving through your Stripe account. + They're created for every type of transaction that comes into or flows out of your Stripe account balance. + + Related guide: [Balance Transaction Types](https://stripe.com/docs/reports/balance-transaction-types). + """ + OBJECT_NAME = "balance_transaction" diff --git a/stripe/api_resources/bank_account.py b/stripe/api_resources/bank_account.py index e9cc7c948..411d96fc2 100644 --- a/stripe/api_resources/bank_account.py +++ b/stripe/api_resources/bank_account.py @@ -12,6 +12,16 @@ class BankAccount(DeletableAPIResource, UpdateableAPIResource, VerifyMixin): + """ + These bank accounts are payment methods on `Customer` objects. + + On the other hand [External Accounts](https://stripe.com/docs/api#external_accounts) are transfer + destinations on `Account` objects for [Custom accounts](https://stripe.com/docs/connect/custom-accounts). + They can be bank accounts or debit cards as well, and are documented in the links above. + + Related guide: [Bank Debits and Transfers](https://stripe.com/docs/payments/bank-debits-transfers). + """ + OBJECT_NAME = "bank_account" def instance_url(self): diff --git a/stripe/api_resources/billing_portal/configuration.py b/stripe/api_resources/billing_portal/configuration.py index a6bcfcd7c..02e2e3069 100644 --- a/stripe/api_resources/billing_portal/configuration.py +++ b/stripe/api_resources/billing_portal/configuration.py @@ -11,4 +11,8 @@ class Configuration( ListableAPIResource, UpdateableAPIResource, ): + """ + A portal configuration describes the functionality and behavior of a portal session. + """ + OBJECT_NAME = "billing_portal.configuration" diff --git a/stripe/api_resources/billing_portal/session.py b/stripe/api_resources/billing_portal/session.py index ca06b42aa..9e25bc776 100644 --- a/stripe/api_resources/billing_portal/session.py +++ b/stripe/api_resources/billing_portal/session.py @@ -5,4 +5,21 @@ class Session(CreateableAPIResource): + """ + The Billing customer portal is a Stripe-hosted UI for subscription and + billing management. + + A portal configuration describes the functionality and features that you + want to provide to your customers through the portal. + + A portal session describes the instantiation of the customer portal for + a particular customer. By visiting the session's URL, the customer + can manage their subscriptions and billing details. For security reasons, + sessions are short-lived and will expire if the customer does not visit the URL. + Create sessions on-demand when customers intend to manage their subscriptions + and billing details. + + Learn more in the [integration guide](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal). + """ + OBJECT_NAME = "billing_portal.session" diff --git a/stripe/api_resources/capability.py b/stripe/api_resources/capability.py index b9dcdd919..bc527332d 100644 --- a/stripe/api_resources/capability.py +++ b/stripe/api_resources/capability.py @@ -8,6 +8,12 @@ class Capability(UpdateableAPIResource): + """ + This is an object representing a capability for a Stripe account. + + Related guide: [Account capabilities](https://stripe.com/docs/connect/account-capabilities). + """ + OBJECT_NAME = "capability" def instance_url(self): diff --git a/stripe/api_resources/card.py b/stripe/api_resources/card.py index 6945f60d8..54a64b516 100644 --- a/stripe/api_resources/card.py +++ b/stripe/api_resources/card.py @@ -11,6 +11,14 @@ class Card(DeletableAPIResource, UpdateableAPIResource): + """ + You can store multiple cards on a customer in order to charge the customer + later. You can also store multiple debit cards on a recipient in order to + transfer to those cards later. + + Related guide: [Card Payments with Sources](https://stripe.com/docs/sources/cards). + """ + OBJECT_NAME = "card" def instance_url(self): diff --git a/stripe/api_resources/cash_balance.py b/stripe/api_resources/cash_balance.py index 959e5a15a..e61423e60 100644 --- a/stripe/api_resources/cash_balance.py +++ b/stripe/api_resources/cash_balance.py @@ -8,6 +8,10 @@ class CashBalance(APIResource): + """ + A customer's `Cash balance` represents real funds. Customers can add funds to their cash balance by sending a bank transfer. These funds can be used for payment and can eventually be paid out to your bank account. + """ + OBJECT_NAME = "cash_balance" def instance_url(self): diff --git a/stripe/api_resources/charge.py b/stripe/api_resources/charge.py index 77a5a1684..73e3155f3 100644 --- a/stripe/api_resources/charge.py +++ b/stripe/api_resources/charge.py @@ -14,6 +14,14 @@ class Charge( SearchableAPIResource, UpdateableAPIResource, ): + """ + To charge a credit or a debit card, you create a `Charge` object. You can + retrieve and refund individual charges as well as list all charges. Charges + are identified by a unique, random ID. + + Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges). + """ + OBJECT_NAME = "charge" @classmethod diff --git a/stripe/api_resources/checkout/session.py b/stripe/api_resources/checkout/session.py index d484fd252..49ef5777a 100644 --- a/stripe/api_resources/checkout/session.py +++ b/stripe/api_resources/checkout/session.py @@ -7,6 +7,23 @@ class Session(CreateableAPIResource, ListableAPIResource): + """ + A Checkout Session represents your customer's session as they pay for + one-time purchases or subscriptions through [Checkout](https://stripe.com/docs/payments/checkout) + or [Payment Links](https://stripe.com/docs/payments/payment-links). We recommend creating a + new Session each time your customer attempts to pay. + + Once payment is successful, the Checkout Session will contain a reference + to the [Customer](https://stripe.com/docs/api/customers), and either the successful + [PaymentIntent](https://stripe.com/docs/api/payment_intents) or an active + [Subscription](https://stripe.com/docs/api/subscriptions). + + You can create a Checkout Session on your server and pass its ID to the + client to begin Checkout. + + Related guide: [Checkout Quickstart](https://stripe.com/docs/checkout/quickstart). + """ + OBJECT_NAME = "checkout.session" @classmethod diff --git a/stripe/api_resources/country_spec.py b/stripe/api_resources/country_spec.py index 86254337f..6f0953f74 100644 --- a/stripe/api_resources/country_spec.py +++ b/stripe/api_resources/country_spec.py @@ -5,4 +5,13 @@ class CountrySpec(ListableAPIResource): + """ + Stripe needs to collect certain pieces of information about each account + created. These requirements can differ depending on the account's country. The + Country Specs API makes these rules available to your integration. + + You can also view the information from this API call as [an online + guide](/docs/connect/required-verification-information). + """ + OBJECT_NAME = "country_spec" diff --git a/stripe/api_resources/coupon.py b/stripe/api_resources/coupon.py index e258aacc3..ab425e978 100644 --- a/stripe/api_resources/coupon.py +++ b/stripe/api_resources/coupon.py @@ -13,4 +13,10 @@ class Coupon( ListableAPIResource, UpdateableAPIResource, ): + """ + A coupon contains information about a percent-off or amount-off discount you + might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices), + [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). + """ + OBJECT_NAME = "coupon" diff --git a/stripe/api_resources/credit_note.py b/stripe/api_resources/credit_note.py index 0eabc74da..7d0baf648 100644 --- a/stripe/api_resources/credit_note.py +++ b/stripe/api_resources/credit_note.py @@ -12,6 +12,12 @@ class CreditNote( ListableAPIResource, UpdateableAPIResource, ): + """ + Issue a credit note to adjust an invoice's amount after the invoice is finalized. + + Related guide: [Credit Notes](https://stripe.com/docs/billing/invoices/credit-notes). + """ + OBJECT_NAME = "credit_note" @classmethod diff --git a/stripe/api_resources/customer.py b/stripe/api_resources/customer.py index 934cf8ff1..f5ba8e973 100644 --- a/stripe/api_resources/customer.py +++ b/stripe/api_resources/customer.py @@ -17,6 +17,10 @@ "balance_transaction", operations=["create", "retrieve", "update", "list"], ) +@nested_resource_class_methods( + "cash_balance_transaction", + operations=["retrieve", "list"], +) @nested_resource_class_methods( "source", operations=["create", "retrieve", "update", "delete", "list"], @@ -32,6 +36,12 @@ class Customer( SearchableAPIResource, UpdateableAPIResource, ): + """ + This object represents a customer of your business. It lets you create recurring charges and track payments that belong to the same customer. + + Related guide: [Save a card during payment](https://stripe.com/docs/payments/save-during-payment). + """ + OBJECT_NAME = "customer" @classmethod diff --git a/stripe/api_resources/customer_balance_transaction.py b/stripe/api_resources/customer_balance_transaction.py index 59d233091..68c839d9d 100644 --- a/stripe/api_resources/customer_balance_transaction.py +++ b/stripe/api_resources/customer_balance_transaction.py @@ -8,6 +8,15 @@ class CustomerBalanceTransaction(APIResource): + """ + Each customer has a [`balance`](https://stripe.com/docs/api/customers/object#customer_object-balance) value, + which denotes a debit or credit that's automatically applied to their next invoice upon finalization. + You may modify the value directly by using the [update customer API](https://stripe.com/docs/api/customers/update), + or by creating a Customer Balance Transaction, which increments or decrements the customer's `balance` by the specified `amount`. + + Related guide: [Customer Balance](https://stripe.com/docs/billing/customer/balance) to learn more. + """ + OBJECT_NAME = "customer_balance_transaction" def instance_url(self): diff --git a/stripe/api_resources/customer_cash_balance_transaction.py b/stripe/api_resources/customer_cash_balance_transaction.py new file mode 100644 index 000000000..14893a2b8 --- /dev/null +++ b/stripe/api_resources/customer_cash_balance_transaction.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec +from __future__ import absolute_import, division, print_function + +from stripe.api_resources.abstract import ListableAPIResource + + +class CustomerCashBalanceTransaction(ListableAPIResource): + """ + Customers with certain payments enabled have a cash balance, representing funds that were paid + by the customer to a merchant, but have not yet been allocated to a payment. Cash Balance Transactions + represent when funds are moved into or out of this balance. This includes funding by the customer, allocation + to payments, and refunds to the customer. + """ + + OBJECT_NAME = "customer_cash_balance_transaction" diff --git a/stripe/api_resources/dispute.py b/stripe/api_resources/dispute.py index 7acb3dc02..f96624b2f 100644 --- a/stripe/api_resources/dispute.py +++ b/stripe/api_resources/dispute.py @@ -7,6 +7,16 @@ class Dispute(ListableAPIResource, UpdateableAPIResource): + """ + A dispute occurs when a customer questions your charge with their card issuer. + When this happens, you're given the opportunity to respond to the dispute with + evidence that shows that the charge is legitimate. You can find more + information about the dispute process in our [Disputes and + Fraud](/docs/disputes) documentation. + + Related guide: [Disputes and Fraud](https://stripe.com/docs/disputes). + """ + OBJECT_NAME = "dispute" @classmethod diff --git a/stripe/api_resources/event.py b/stripe/api_resources/event.py index a86a1d802..c16326e78 100644 --- a/stripe/api_resources/event.py +++ b/stripe/api_resources/event.py @@ -5,4 +5,36 @@ class Event(ListableAPIResource): + """ + Events are our way of letting you know when something interesting happens in + your account. When an interesting event occurs, we create a new `Event` + object. For example, when a charge succeeds, we create a `charge.succeeded` + event; and when an invoice payment attempt fails, we create an + `invoice.payment_failed` event. Note that many API requests may cause multiple + events to be created. For example, if you create a new subscription for a + customer, you will receive both a `customer.subscription.created` event and a + `charge.succeeded` event. + + Events occur when the state of another API resource changes. The state of that + resource at the time of the change is embedded in the event's data field. For + example, a `charge.succeeded` event will contain a charge, and an + `invoice.payment_failed` event will contain an invoice. + + As with other API resources, you can use endpoints to retrieve an + [individual event](https://stripe.com/docs/api#retrieve_event) or a [list of events](https://stripe.com/docs/api#list_events) + from the API. We also have a separate + [webhooks](http://en.wikipedia.org/wiki/Webhook) system for sending the + `Event` objects directly to an endpoint on your server. Webhooks are managed + in your + [account settings](https://dashboard.stripe.com/account/webhooks), + and our [Using Webhooks](https://stripe.com/docs/webhooks) guide will help you get set up. + + When using [Connect](https://stripe.com/docs/connect), you can also receive notifications of + events that occur in connected accounts. For these events, there will be an + additional `account` attribute in the received `Event` object. + + **NOTE:** Right now, access to events through the [Retrieve Event API](https://stripe.com/docs/api#retrieve_event) is + guaranteed only for 30 days. + """ + OBJECT_NAME = "event" diff --git a/stripe/api_resources/exchange_rate.py b/stripe/api_resources/exchange_rate.py index dbd412aaa..f3f28a8bf 100644 --- a/stripe/api_resources/exchange_rate.py +++ b/stripe/api_resources/exchange_rate.py @@ -5,4 +5,18 @@ class ExchangeRate(ListableAPIResource): + """ + `Exchange Rate` objects allow you to determine the rates that Stripe is + currently using to convert from one currency to another. Since this number is + variable throughout the day, there are various reasons why you might want to + know the current rate (for example, to dynamically price an item for a user + with a default payment in a foreign currency). + + If you want a guarantee that the charge is made with a certain exchange rate + you expect is current, you can pass in `exchange_rate` to charges endpoints. + If the value is no longer up to date, the charge won't go through. Please + refer to our [Exchange Rates API](https://stripe.com/docs/exchange-rates) guide for more + details. + """ + OBJECT_NAME = "exchange_rate" diff --git a/stripe/api_resources/file.py b/stripe/api_resources/file.py index ebc9e9274..626a148ad 100644 --- a/stripe/api_resources/file.py +++ b/stripe/api_resources/file.py @@ -8,6 +8,16 @@ class File(ListableAPIResource): + """ + This is an object representing a file hosted on Stripe's servers. The + file may have been uploaded by yourself using the [create file](https://stripe.com/docs/api#create_file) + request (for example, when uploading dispute evidence) or it may have + been created by Stripe (for example, the results of a [Sigma scheduled + query](#scheduled_queries)). + + Related guide: [File Upload Guide](https://stripe.com/docs/file-upload). + """ + OBJECT_NAME = "file" # This resource can have two different object names. In latter API diff --git a/stripe/api_resources/file_link.py b/stripe/api_resources/file_link.py index 67ea204f4..cdd379bba 100644 --- a/stripe/api_resources/file_link.py +++ b/stripe/api_resources/file_link.py @@ -11,4 +11,10 @@ class FileLink( ListableAPIResource, UpdateableAPIResource, ): + """ + To share the contents of a `File` object with non-Stripe users, you can + create a `FileLink`. `FileLink`s contain a URL that can be used to + retrieve the contents of the file without authentication. + """ + OBJECT_NAME = "file_link" diff --git a/stripe/api_resources/financial_connections/account.py b/stripe/api_resources/financial_connections/account.py index 0ad616727..9748041ae 100644 --- a/stripe/api_resources/financial_connections/account.py +++ b/stripe/api_resources/financial_connections/account.py @@ -6,6 +6,10 @@ class Account(ListableAPIResource): + """ + A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access. + """ + OBJECT_NAME = "financial_connections.account" @classmethod diff --git a/stripe/api_resources/financial_connections/account_ownership.py b/stripe/api_resources/financial_connections/account_ownership.py index d2f0fafbb..03a790228 100644 --- a/stripe/api_resources/financial_connections/account_ownership.py +++ b/stripe/api_resources/financial_connections/account_ownership.py @@ -5,4 +5,8 @@ class AccountOwnership(StripeObject): + """ + Describes a snapshot of the owners of an account at a particular point in time. + """ + OBJECT_NAME = "financial_connections.account_ownership" diff --git a/stripe/api_resources/financial_connections/session.py b/stripe/api_resources/financial_connections/session.py index aa5905dba..e1f0d25e2 100644 --- a/stripe/api_resources/financial_connections/session.py +++ b/stripe/api_resources/financial_connections/session.py @@ -5,4 +5,8 @@ class Session(CreateableAPIResource): + """ + A Financial Connections Session is the secure way to programmatically launch the client-side Stripe.js modal that lets your users link their accounts. + """ + OBJECT_NAME = "financial_connections.session" diff --git a/stripe/api_resources/funding_instructions.py b/stripe/api_resources/funding_instructions.py index f2c88a599..e4ffaa977 100644 --- a/stripe/api_resources/funding_instructions.py +++ b/stripe/api_resources/funding_instructions.py @@ -5,4 +5,12 @@ class FundingInstructions(StripeObject): + """ + Each customer has a [`balance`](https://stripe.com/docs/api/customers/object#customer_object-balance) that is + automatically applied to future invoices and payments using the `customer_balance` payment method. + Customers can fund this balance by initiating a bank transfer to any account in the + `financial_addresses` field. + Related guide: [Customer Balance - Funding Instructions](https://stripe.com/docs/payments/customer-balance/funding-instructions) to learn more + """ + OBJECT_NAME = "funding_instructions" diff --git a/stripe/api_resources/identity/verification_report.py b/stripe/api_resources/identity/verification_report.py index d110f8f7b..993f7c4f3 100644 --- a/stripe/api_resources/identity/verification_report.py +++ b/stripe/api_resources/identity/verification_report.py @@ -5,4 +5,18 @@ class VerificationReport(ListableAPIResource): + """ + A VerificationReport is the result of an attempt to collect and verify data from a user. + The collection of verification checks performed is determined from the `type` and `options` + parameters used. You can find the result of each verification check performed in the + appropriate sub-resource: `document`, `id_number`, `selfie`. + + Each VerificationReport contains a copy of any data collected by the user as well as + reference IDs which can be used to access collected images through the [FileUpload](https://stripe.com/docs/api/files) + API. To configure and create VerificationReports, use the + [VerificationSession](https://stripe.com/docs/api/identity/verification_sessions) API. + + Related guides: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results). + """ + OBJECT_NAME = "identity.verification_report" diff --git a/stripe/api_resources/identity/verification_session.py b/stripe/api_resources/identity/verification_session.py index 74ecc880a..ad073c1d9 100644 --- a/stripe/api_resources/identity/verification_session.py +++ b/stripe/api_resources/identity/verification_session.py @@ -12,6 +12,20 @@ class VerificationSession( ListableAPIResource, UpdateableAPIResource, ): + """ + A VerificationSession guides you through the process of collecting and verifying the identities + of your users. It contains details about the type of verification, such as what [verification + check](/docs/identity/verification-checks) to perform. Only create one VerificationSession for + each verification in your system. + + A VerificationSession transitions through [multiple + statuses](/docs/identity/how-sessions-work) throughout its lifetime as it progresses through + the verification flow. The VerificationSession contains the user's verified data after + verification checks are complete. + + Related guide: [The Verification Sessions API](https://stripe.com/docs/identity/verification-sessions) + """ + OBJECT_NAME = "identity.verification_session" @classmethod diff --git a/stripe/api_resources/invoice.py b/stripe/api_resources/invoice.py index 65ee6116a..4978566ce 100644 --- a/stripe/api_resources/invoice.py +++ b/stripe/api_resources/invoice.py @@ -16,6 +16,41 @@ class Invoice( SearchableAPIResource, UpdateableAPIResource, ): + """ + Invoices are statements of amounts owed by a customer, and are either + generated one-off, or generated periodically from a subscription. + + They contain [invoice items](https://stripe.com/docs/api#invoiceitems), and proration adjustments + that may be caused by subscription upgrades/downgrades (if necessary). + + If your invoice is configured to be billed through automatic charges, + Stripe automatically finalizes your invoice and attempts payment. Note + that finalizing the invoice, + [when automatic](https://stripe.com/docs/billing/invoices/workflow/#auto_advance), does + not happen immediately as the invoice is created. Stripe waits + until one hour after the last webhook was successfully sent (or the last + webhook timed out after failing). If you (and the platforms you may have + connected to) have no webhooks configured, Stripe waits one hour after + creation to finalize the invoice. + + If your invoice is configured to be billed by sending an email, then based on your + [email settings](https://dashboard.stripe.com/account/billing/automatic), + Stripe will email the invoice to your customer and await payment. These + emails can contain a link to a hosted page to pay the invoice. + + Stripe applies any customer credit on the account before determining the + amount due for the invoice (i.e., the amount that will be actually + charged). If the amount due for the invoice is less than Stripe's [minimum allowed charge + per currency](/docs/currencies#minimum-and-maximum-charge-amounts), the + invoice is automatically marked paid, and we add the amount due to the + customer's credit balance which is applied to the next invoice. + + More details on the customer's credit balance are + [here](https://stripe.com/docs/billing/customer/balance). + + Related guide: [Send Invoices to Customers](https://stripe.com/docs/billing/invoices/sending). + """ + OBJECT_NAME = "invoice" @classmethod diff --git a/stripe/api_resources/invoice_item.py b/stripe/api_resources/invoice_item.py index 58b7dd871..ff7ab0e64 100644 --- a/stripe/api_resources/invoice_item.py +++ b/stripe/api_resources/invoice_item.py @@ -13,4 +13,14 @@ class InvoiceItem( ListableAPIResource, UpdateableAPIResource, ): + """ + Sometimes you want to add a charge or credit to a customer, but actually + charge or credit the customer's card only at the end of a regular billing + cycle. This is useful for combining several charges (to minimize + per-transaction fees), or for having Stripe tabulate your usage-based billing + totals. + + Related guide: [Subscription Invoices](https://stripe.com/docs/billing/invoices/subscription#adding-upcoming-invoice-items). + """ + OBJECT_NAME = "invoiceitem" diff --git a/stripe/api_resources/issuing/authorization.py b/stripe/api_resources/issuing/authorization.py index c7419fbd2..707baa130 100644 --- a/stripe/api_resources/issuing/authorization.py +++ b/stripe/api_resources/issuing/authorization.py @@ -7,6 +7,14 @@ class Authorization(ListableAPIResource, UpdateableAPIResource): + """ + When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization` + object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the + purchase to be completed successfully. + + Related guide: [Issued Card Authorizations](https://stripe.com/docs/issuing/purchases/authorizations). + """ + OBJECT_NAME = "issuing.authorization" @classmethod diff --git a/stripe/api_resources/issuing/card.py b/stripe/api_resources/issuing/card.py index ad9db4b82..cf2383809 100644 --- a/stripe/api_resources/issuing/card.py +++ b/stripe/api_resources/issuing/card.py @@ -11,6 +11,10 @@ @test_helpers class Card(CreateableAPIResource, ListableAPIResource, UpdateableAPIResource): + """ + You can [create physical or virtual cards](https://stripe.com/docs/issuing/cards) that are issued to cardholders. + """ + OBJECT_NAME = "issuing.card" class TestHelpers(APIResourceTestHelpers): diff --git a/stripe/api_resources/issuing/cardholder.py b/stripe/api_resources/issuing/cardholder.py index e8060341d..3dcc5a80d 100644 --- a/stripe/api_resources/issuing/cardholder.py +++ b/stripe/api_resources/issuing/cardholder.py @@ -11,4 +11,10 @@ class Cardholder( ListableAPIResource, UpdateableAPIResource, ): + """ + An Issuing `Cardholder` object represents an individual or business entity who is [issued](https://stripe.com/docs/issuing) cards. + + Related guide: [How to create a Cardholder](https://stripe.com/docs/issuing/cards#create-cardholder) + """ + OBJECT_NAME = "issuing.cardholder" diff --git a/stripe/api_resources/issuing/dispute.py b/stripe/api_resources/issuing/dispute.py index ad601be90..56d799e1f 100644 --- a/stripe/api_resources/issuing/dispute.py +++ b/stripe/api_resources/issuing/dispute.py @@ -12,6 +12,12 @@ class Dispute( ListableAPIResource, UpdateableAPIResource, ): + """ + As a [card issuer](https://stripe.com/docs/issuing), you can dispute transactions that the cardholder does not recognize, suspects to be fraudulent, or has other issues with. + + Related guide: [Disputing Transactions](https://stripe.com/docs/issuing/purchases/disputes) + """ + OBJECT_NAME = "issuing.dispute" @classmethod diff --git a/stripe/api_resources/issuing/transaction.py b/stripe/api_resources/issuing/transaction.py index 319b717c8..5f0a976df 100644 --- a/stripe/api_resources/issuing/transaction.py +++ b/stripe/api_resources/issuing/transaction.py @@ -6,4 +6,12 @@ class Transaction(ListableAPIResource, UpdateableAPIResource): + """ + Any use of an [issued card](https://stripe.com/docs/issuing) that results in funds entering or leaving + your Stripe account, such as a completed purchase or refund, is represented by an Issuing + `Transaction` object. + + Related guide: [Issued Card Transactions](https://stripe.com/docs/issuing/purchases/transactions). + """ + OBJECT_NAME = "issuing.transaction" diff --git a/stripe/api_resources/line_item.py b/stripe/api_resources/line_item.py index 9c847f8e4..8716676bf 100644 --- a/stripe/api_resources/line_item.py +++ b/stripe/api_resources/line_item.py @@ -5,4 +5,8 @@ class LineItem(StripeObject): + """ + A line item. + """ + OBJECT_NAME = "item" diff --git a/stripe/api_resources/mandate.py b/stripe/api_resources/mandate.py index acee29432..b8b213782 100644 --- a/stripe/api_resources/mandate.py +++ b/stripe/api_resources/mandate.py @@ -5,4 +5,8 @@ class Mandate(APIResource): + """ + A Mandate is a record of the permission a customer has given you to debit their payment method. + """ + OBJECT_NAME = "mandate" diff --git a/stripe/api_resources/order.py b/stripe/api_resources/order.py index 83100ae9c..3fdccdbc8 100644 --- a/stripe/api_resources/order.py +++ b/stripe/api_resources/order.py @@ -8,6 +8,14 @@ class Order(CreateableAPIResource, ListableAPIResource, UpdateableAPIResource): + """ + An Order describes a purchase being made by a customer, including the + products & quantities being purchased, the order status, the payment information, + and the billing/shipping details. + + Related guide: [Orders overview](https://stripe.com/docs/orders) + """ + OBJECT_NAME = "order" @classmethod diff --git a/stripe/api_resources/payment_intent.py b/stripe/api_resources/payment_intent.py index e4656d259..e9e544dfb 100644 --- a/stripe/api_resources/payment_intent.py +++ b/stripe/api_resources/payment_intent.py @@ -14,6 +14,20 @@ class PaymentIntent( SearchableAPIResource, UpdateableAPIResource, ): + """ + A PaymentIntent guides you through the process of collecting a payment from your customer. + We recommend that you create exactly one PaymentIntent for each order or + customer session in your system. You can reference the PaymentIntent later to + see the history of payment attempts for a particular session. + + A PaymentIntent transitions through + [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) + throughout its lifetime as it interfaces with Stripe.js to perform + authentication flows and ultimately creates at most one successful charge. + + Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents). + """ + OBJECT_NAME = "payment_intent" @classmethod diff --git a/stripe/api_resources/payment_link.py b/stripe/api_resources/payment_link.py index b9cb485ad..5adb2b277 100644 --- a/stripe/api_resources/payment_link.py +++ b/stripe/api_resources/payment_link.py @@ -12,6 +12,14 @@ class PaymentLink( ListableAPIResource, UpdateableAPIResource, ): + """ + A payment link is a shareable URL that will take your customers to a hosted payment page. A payment link can be shared and used multiple times. + + When a customer opens a payment link it will open a new [checkout session](https://stripe.com/docs/api/checkout/sessions) to render the payment page. You can use [checkout session events](https://stripe.com/docs/api/events/types#event_types-checkout.session.completed) to track payments through payment links. + + Related guide: [Payment Links API](https://stripe.com/docs/payments/payment-links/api) + """ + OBJECT_NAME = "payment_link" @classmethod diff --git a/stripe/api_resources/payment_method.py b/stripe/api_resources/payment_method.py index 057018cbd..25dab7e38 100644 --- a/stripe/api_resources/payment_method.py +++ b/stripe/api_resources/payment_method.py @@ -12,6 +12,14 @@ class PaymentMethod( ListableAPIResource, UpdateableAPIResource, ): + """ + PaymentMethod objects represent your customer's payment instruments. + You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + Customer objects to store instrument details for future payments. + + Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + """ + OBJECT_NAME = "payment_method" @classmethod diff --git a/stripe/api_resources/payout.py b/stripe/api_resources/payout.py index 6b0a9a236..904259871 100644 --- a/stripe/api_resources/payout.py +++ b/stripe/api_resources/payout.py @@ -10,6 +10,17 @@ class Payout( CreateableAPIResource, ListableAPIResource, UpdateableAPIResource ): + """ + A `Payout` object is created when you receive funds from Stripe, or when you + initiate a payout to either a bank account or debit card of a [connected + Stripe account](/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts, + as well as list all payouts. Payouts are made on [varying + schedules](/docs/connect/manage-payout-schedule), depending on your country and + industry. + + Related guide: [Receiving Payouts](https://stripe.com/docs/payouts). + """ + OBJECT_NAME = "payout" @classmethod diff --git a/stripe/api_resources/person.py b/stripe/api_resources/person.py index 45df5a826..2de4bd269 100644 --- a/stripe/api_resources/person.py +++ b/stripe/api_resources/person.py @@ -8,6 +8,15 @@ class Person(UpdateableAPIResource): + """ + This is an object representing a person associated with a Stripe account. + + A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. + See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform pre-filling and account onboarding steps. + + Related guide: [Handling Identity Verification with the API](https://stripe.com/docs/connect/identity-verification-api#person-information). + """ + OBJECT_NAME = "person" def instance_url(self): diff --git a/stripe/api_resources/plan.py b/stripe/api_resources/plan.py index 9f9904d94..46b9a854b 100644 --- a/stripe/api_resources/plan.py +++ b/stripe/api_resources/plan.py @@ -13,4 +13,15 @@ class Plan( ListableAPIResource, UpdateableAPIResource, ): + """ + You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. + + Plans define the base price, currency, and billing cycle for recurring purchases of products. + [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme. + + For example, you might have a single "gold" product that has plans for $10/month, $100/year, EUR 9/month, and EUR 90/year. + + Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](https://stripe.com/docs/products-prices/overview). + """ + OBJECT_NAME = "plan" diff --git a/stripe/api_resources/price.py b/stripe/api_resources/price.py index 775037f76..b12e73438 100644 --- a/stripe/api_resources/price.py +++ b/stripe/api_resources/price.py @@ -13,6 +13,15 @@ class Price( SearchableAPIResource, UpdateableAPIResource, ): + """ + Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. + [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme. + + For example, you might have a single "gold" product that has prices for $10/month, $100/year, and EUR 9 once. + + Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/products-prices/overview). + """ + OBJECT_NAME = "price" @classmethod diff --git a/stripe/api_resources/product.py b/stripe/api_resources/product.py index b345b7eeb..65641a84a 100644 --- a/stripe/api_resources/product.py +++ b/stripe/api_resources/product.py @@ -15,6 +15,17 @@ class Product( SearchableAPIResource, UpdateableAPIResource, ): + """ + Products describe the specific goods or services you offer to your customers. + For example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product. + They can be used in conjunction with [Prices](https://stripe.com/docs/api#prices) to configure pricing in Payment Links, Checkout, and Subscriptions. + + Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), + [share a Payment Link](https://stripe.com/docs/payments/payment-links/overview), + [accept payments with Checkout](https://stripe.com/docs/payments/accept-a-payment#create-product-prices-upfront), + and more about [Products and Prices](https://stripe.com/docs/products-prices/overview) + """ + OBJECT_NAME = "product" @classmethod diff --git a/stripe/api_resources/promotion_code.py b/stripe/api_resources/promotion_code.py index 1b3ba12de..50f4709ca 100644 --- a/stripe/api_resources/promotion_code.py +++ b/stripe/api_resources/promotion_code.py @@ -11,4 +11,9 @@ class PromotionCode( ListableAPIResource, UpdateableAPIResource, ): + """ + A Promotion Code represents a customer-redeemable code for a [coupon](https://stripe.com/docs/api#coupons). It can be used to + create multiple codes for a single coupon. + """ + OBJECT_NAME = "promotion_code" diff --git a/stripe/api_resources/quote.py b/stripe/api_resources/quote.py index 608f5b7ab..5c4dbf1c9 100644 --- a/stripe/api_resources/quote.py +++ b/stripe/api_resources/quote.py @@ -11,6 +11,11 @@ class Quote(CreateableAPIResource, ListableAPIResource, UpdateableAPIResource): + """ + A Quote is a way to model prices that you'd like to provide to a customer. + Once accepted, it will automatically create an invoice, subscription or subscription schedule. + """ + OBJECT_NAME = "quote" @classmethod diff --git a/stripe/api_resources/radar/early_fraud_warning.py b/stripe/api_resources/radar/early_fraud_warning.py index 46a871eb4..a17351bcd 100644 --- a/stripe/api_resources/radar/early_fraud_warning.py +++ b/stripe/api_resources/radar/early_fraud_warning.py @@ -5,4 +5,11 @@ class EarlyFraudWarning(ListableAPIResource): + """ + An early fraud warning indicates that the card issuer has notified us that a + charge may be fraudulent. + + Related guide: [Early Fraud Warnings](https://stripe.com/docs/disputes/measuring#early-fraud-warnings). + """ + OBJECT_NAME = "radar.early_fraud_warning" diff --git a/stripe/api_resources/radar/value_list.py b/stripe/api_resources/radar/value_list.py index cba9e5c75..06ff82d52 100644 --- a/stripe/api_resources/radar/value_list.py +++ b/stripe/api_resources/radar/value_list.py @@ -13,4 +13,10 @@ class ValueList( ListableAPIResource, UpdateableAPIResource, ): + """ + Value lists allow you to group values together which can then be referenced in rules. + + Related guide: [Default Stripe Lists](https://stripe.com/docs/radar/lists#managing-list-items). + """ + OBJECT_NAME = "radar.value_list" diff --git a/stripe/api_resources/radar/value_list_item.py b/stripe/api_resources/radar/value_list_item.py index 7c2c71d53..2c9034f35 100644 --- a/stripe/api_resources/radar/value_list_item.py +++ b/stripe/api_resources/radar/value_list_item.py @@ -11,4 +11,10 @@ class ValueListItem( DeletableAPIResource, ListableAPIResource, ): + """ + Value list items allow you to add specific values to a given Radar value list, which can then be used in rules. + + Related guide: [Managing List Items](https://stripe.com/docs/radar/lists#managing-list-items). + """ + OBJECT_NAME = "radar.value_list_item" diff --git a/stripe/api_resources/refund.py b/stripe/api_resources/refund.py index 332b1f1bc..6cce4e2ca 100644 --- a/stripe/api_resources/refund.py +++ b/stripe/api_resources/refund.py @@ -13,6 +13,14 @@ class Refund( CreateableAPIResource, ListableAPIResource, UpdateableAPIResource ): + """ + `Refund` objects allow you to refund a charge that has previously been created + but not yet refunded. Funds will be refunded to the credit or debit card that + was originally charged. + + Related guide: [Refunds](https://stripe.com/docs/refunds). + """ + OBJECT_NAME = "refund" @classmethod diff --git a/stripe/api_resources/reporting/report_run.py b/stripe/api_resources/reporting/report_run.py index d04405040..e45993649 100644 --- a/stripe/api_resources/reporting/report_run.py +++ b/stripe/api_resources/reporting/report_run.py @@ -6,4 +6,15 @@ class ReportRun(CreateableAPIResource, ListableAPIResource): + """ + The Report Run object represents an instance of a report type generated with + specific run parameters. Once the object is created, Stripe begins processing the report. + When the report has finished running, it will give you a reference to a file + where you can retrieve your results. For an overview, see + [API Access to Reports](https://stripe.com/docs/reporting/statements/api). + + Note that certain report types can only be run based on your live-mode data (not test-mode + data), and will error when queried without a [live-mode API key](https://stripe.com/docs/keys#test-live-modes). + """ + OBJECT_NAME = "reporting.report_run" diff --git a/stripe/api_resources/reporting/report_type.py b/stripe/api_resources/reporting/report_type.py index 694bbb832..f5e30d6eb 100644 --- a/stripe/api_resources/reporting/report_type.py +++ b/stripe/api_resources/reporting/report_type.py @@ -5,4 +5,15 @@ class ReportType(ListableAPIResource): + """ + The Report Type resource corresponds to a particular type of report, such as + the "Activity summary" or "Itemized payouts" reports. These objects are + identified by an ID belonging to a set of enumerated values. See + [API Access to Reports documentation](https://stripe.com/docs/reporting/statements/api) + for those Report Type IDs, along with required and optional parameters. + + Note that certain report types can only be run based on your live-mode data (not test-mode + data), and will error when queried without a [live-mode API key](https://stripe.com/docs/keys#test-live-modes). + """ + OBJECT_NAME = "reporting.report_type" diff --git a/stripe/api_resources/reversal.py b/stripe/api_resources/reversal.py index eadeee536..d9e8060a8 100644 --- a/stripe/api_resources/reversal.py +++ b/stripe/api_resources/reversal.py @@ -8,6 +8,22 @@ class Reversal(UpdateableAPIResource): + """ + [Stripe Connect](https://stripe.com/docs/connect) platforms can reverse transfers made to a + connected account, either entirely or partially, and can also specify whether + to refund any related application fees. Transfer reversals add to the + platform's balance and subtract from the destination account's balance. + + Reversing a transfer that was made for a [destination + charge](/docs/connect/destination-charges) is allowed only up to the amount of + the charge. It is possible to reverse a + [transfer_group](https://stripe.com/docs/connect/charges-transfers#transfer-options) + transfer only if the destination account has enough balance to cover the + reversal. + + Related guide: [Reversing Transfers](https://stripe.com/docs/connect/charges-transfers#reversing-transfers). + """ + OBJECT_NAME = "transfer_reversal" def instance_url(self): diff --git a/stripe/api_resources/review.py b/stripe/api_resources/review.py index a05e5c907..f48db9e94 100644 --- a/stripe/api_resources/review.py +++ b/stripe/api_resources/review.py @@ -6,6 +6,13 @@ class Review(ListableAPIResource): + """ + Reviews can be used to supplement automated fraud detection with human expertise. + + Learn more about [Radar](/radar) and reviewing payments + [here](https://stripe.com/docs/radar/reviews). + """ + OBJECT_NAME = "review" @classmethod diff --git a/stripe/api_resources/setup_attempt.py b/stripe/api_resources/setup_attempt.py index 14b93ab52..26dab48c8 100644 --- a/stripe/api_resources/setup_attempt.py +++ b/stripe/api_resources/setup_attempt.py @@ -5,4 +5,11 @@ class SetupAttempt(ListableAPIResource): + """ + A SetupAttempt describes one attempted confirmation of a SetupIntent, + whether that confirmation was successful or unsuccessful. You can use + SetupAttempts to inspect details of a specific attempt at setting up a + payment method using a SetupIntent. + """ + OBJECT_NAME = "setup_attempt" diff --git a/stripe/api_resources/setup_intent.py b/stripe/api_resources/setup_intent.py index d07004ca2..0cee2c43b 100644 --- a/stripe/api_resources/setup_intent.py +++ b/stripe/api_resources/setup_intent.py @@ -12,6 +12,31 @@ class SetupIntent( ListableAPIResource, UpdateableAPIResource, ): + """ + A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. + For example, you could use a SetupIntent to set up and save your customer's card without immediately collecting a payment. + Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. + + Create a SetupIntent as soon as you're ready to collect your customer's payment credentials. + Do not maintain long-lived, unconfirmed SetupIntents as they may no longer be valid. + The SetupIntent then transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides + you through the setup process. + + Successful SetupIntents result in payment credentials that are optimized for future payments. + For example, cardholders in [certain regions](/guides/strong-customer-authentication) may need to be run through + [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) at the time of payment method collection + in order to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents). + If the SetupIntent is used with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), upon success, + it will automatically attach the resulting payment method to that Customer. + We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on + PaymentIntents to save payment methods in order to prevent saving invalid or unoptimized payment methods. + + By using SetupIntents, you ensure that your customers experience the minimum set of required friction, + even as regulations change over time. + + Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents). + """ + OBJECT_NAME = "setup_intent" @classmethod diff --git a/stripe/api_resources/shipping_rate.py b/stripe/api_resources/shipping_rate.py index eb701c7e3..2f89063b9 100644 --- a/stripe/api_resources/shipping_rate.py +++ b/stripe/api_resources/shipping_rate.py @@ -11,4 +11,10 @@ class ShippingRate( ListableAPIResource, UpdateableAPIResource, ): + """ + Shipping rates describe the price of shipping presented to your customers and can be + applied to [Checkout Sessions](https://stripe.com/docs/payments/checkout/shipping) + and [Orders](https://stripe.com/docs/orders/shipping) to collect shipping costs. + """ + OBJECT_NAME = "shipping_rate" diff --git a/stripe/api_resources/sigma/scheduled_query_run.py b/stripe/api_resources/sigma/scheduled_query_run.py index 058516c12..527cf7cac 100644 --- a/stripe/api_resources/sigma/scheduled_query_run.py +++ b/stripe/api_resources/sigma/scheduled_query_run.py @@ -5,6 +5,13 @@ class ScheduledQueryRun(ListableAPIResource): + """ + If you have [scheduled a Sigma query](https://stripe.com/docs/sigma/scheduled-queries), you'll + receive a `sigma.scheduled_query_run.created` webhook each time the query + runs. The webhook contains a `ScheduledQueryRun` object, which you can use to + retrieve the query results. + """ + OBJECT_NAME = "scheduled_query_run" @classmethod diff --git a/stripe/api_resources/sku.py b/stripe/api_resources/sku.py index 75d97249d..0f4aee843 100644 --- a/stripe/api_resources/sku.py +++ b/stripe/api_resources/sku.py @@ -13,4 +13,13 @@ class SKU( ListableAPIResource, UpdateableAPIResource, ): + """ + Stores representations of [stock keeping units](http://en.wikipedia.org/wiki/Stock_keeping_unit). + SKUs describe specific product variations, taking into account any combination of: attributes, + currency, and cost. For example, a product may be a T-shirt, whereas a specific SKU represents + the `size: large`, `color: red` version of that shirt. + + Can also be used to manage inventory. + """ + OBJECT_NAME = "sku" diff --git a/stripe/api_resources/source.py b/stripe/api_resources/source.py index 11c5db7fe..62d980c01 100644 --- a/stripe/api_resources/source.py +++ b/stripe/api_resources/source.py @@ -10,6 +10,15 @@ class Source(CreateableAPIResource, UpdateableAPIResource): + """ + `Source` objects allow you to accept a variety of payment methods. They + represent a customer's payment instrument, and can be used with the Stripe API + just like a `Card` object: once chargeable, they can be charged, or can be + attached to customers. + + Related guides: [Sources API](https://stripe.com/docs/sources) and [Sources & Customers](https://stripe.com/docs/sources/customers). + """ + OBJECT_NAME = "source" @classmethod diff --git a/stripe/api_resources/source_transaction.py b/stripe/api_resources/source_transaction.py index 6bd8fdcc6..37dd4fd50 100644 --- a/stripe/api_resources/source_transaction.py +++ b/stripe/api_resources/source_transaction.py @@ -5,4 +5,11 @@ class SourceTransaction(StripeObject): + """ + Some payment methods have no required amount that a customer must send. + Customers can be instructed to send any amount, and it can be made up of + multiple transactions. As such, sources can have multiple associated + transactions. + """ + OBJECT_NAME = "source_transaction" diff --git a/stripe/api_resources/subscription.py b/stripe/api_resources/subscription.py index 18a85a5b7..e194f707d 100644 --- a/stripe/api_resources/subscription.py +++ b/stripe/api_resources/subscription.py @@ -16,6 +16,12 @@ class Subscription( SearchableAPIResource, UpdateableAPIResource, ): + """ + Subscriptions allow you to charge a customer on a recurring basis. + + Related guide: [Creating Subscriptions](https://stripe.com/docs/billing/subscriptions/creating). + """ + OBJECT_NAME = "subscription" @classmethod diff --git a/stripe/api_resources/subscription_item.py b/stripe/api_resources/subscription_item.py index 619e61879..220e9a675 100644 --- a/stripe/api_resources/subscription_item.py +++ b/stripe/api_resources/subscription_item.py @@ -20,4 +20,9 @@ class SubscriptionItem( ListableAPIResource, UpdateableAPIResource, ): + """ + Subscription items allow you to create customer subscriptions with more than + one plan, making it easy to represent complex billing relationships. + """ + OBJECT_NAME = "subscription_item" diff --git a/stripe/api_resources/subscription_schedule.py b/stripe/api_resources/subscription_schedule.py index 1247b352e..73b96e590 100644 --- a/stripe/api_resources/subscription_schedule.py +++ b/stripe/api_resources/subscription_schedule.py @@ -12,6 +12,12 @@ class SubscriptionSchedule( ListableAPIResource, UpdateableAPIResource, ): + """ + A subscription schedule allows you to create and manage the lifecycle of a subscription by predefining expected changes. + + Related guide: [Subscription Schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules). + """ + OBJECT_NAME = "subscription_schedule" @classmethod diff --git a/stripe/api_resources/tax_code.py b/stripe/api_resources/tax_code.py index 9663acb4c..e7609553c 100644 --- a/stripe/api_resources/tax_code.py +++ b/stripe/api_resources/tax_code.py @@ -5,4 +5,8 @@ class TaxCode(ListableAPIResource): + """ + [Tax codes](https://stripe.com/docs/tax/tax-categories) classify goods and services for tax purposes. + """ + OBJECT_NAME = "tax_code" diff --git a/stripe/api_resources/tax_id.py b/stripe/api_resources/tax_id.py index 7a44bfcf0..ba6933839 100644 --- a/stripe/api_resources/tax_id.py +++ b/stripe/api_resources/tax_id.py @@ -8,6 +8,13 @@ class TaxId(APIResource): + """ + You can add one or multiple tax IDs to a [customer](https://stripe.com/docs/api/customers). + A customer's tax IDs are displayed on invoices and credit notes issued for the customer. + + Related guide: [Customer Tax Identification Numbers](https://stripe.com/docs/billing/taxes/tax-ids). + """ + OBJECT_NAME = "tax_id" def instance_url(self): diff --git a/stripe/api_resources/tax_rate.py b/stripe/api_resources/tax_rate.py index 874f82720..bf4122232 100644 --- a/stripe/api_resources/tax_rate.py +++ b/stripe/api_resources/tax_rate.py @@ -11,4 +11,10 @@ class TaxRate( ListableAPIResource, UpdateableAPIResource, ): + """ + Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + + Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates). + """ + OBJECT_NAME = "tax_rate" diff --git a/stripe/api_resources/terminal/configuration.py b/stripe/api_resources/terminal/configuration.py index 5ed720722..ecf78c7f4 100644 --- a/stripe/api_resources/terminal/configuration.py +++ b/stripe/api_resources/terminal/configuration.py @@ -13,4 +13,8 @@ class Configuration( ListableAPIResource, UpdateableAPIResource, ): + """ + A Configurations object represents how features should be configured for terminal readers. + """ + OBJECT_NAME = "terminal.configuration" diff --git a/stripe/api_resources/terminal/connection_token.py b/stripe/api_resources/terminal/connection_token.py index 0ec7c8944..cf94937e7 100644 --- a/stripe/api_resources/terminal/connection_token.py +++ b/stripe/api_resources/terminal/connection_token.py @@ -5,4 +5,10 @@ class ConnectionToken(CreateableAPIResource): + """ + A Connection Token is used by the Stripe Terminal SDK to connect to a reader. + + Related guide: [Fleet Management](https://stripe.com/docs/terminal/fleet/locations). + """ + OBJECT_NAME = "terminal.connection_token" diff --git a/stripe/api_resources/terminal/location.py b/stripe/api_resources/terminal/location.py index 49c69fb20..3873bb3f3 100644 --- a/stripe/api_resources/terminal/location.py +++ b/stripe/api_resources/terminal/location.py @@ -13,4 +13,10 @@ class Location( ListableAPIResource, UpdateableAPIResource, ): + """ + A Location represents a grouping of readers. + + Related guide: [Fleet Management](https://stripe.com/docs/terminal/fleet/locations). + """ + OBJECT_NAME = "terminal.location" diff --git a/stripe/api_resources/terminal/reader.py b/stripe/api_resources/terminal/reader.py index 018466a6b..772769139 100644 --- a/stripe/api_resources/terminal/reader.py +++ b/stripe/api_resources/terminal/reader.py @@ -17,6 +17,12 @@ class Reader( ListableAPIResource, UpdateableAPIResource, ): + """ + A Reader represents a physical device for accepting payment details. + + Related guide: [Connecting to a Reader](https://stripe.com/docs/terminal/payments/connect-reader). + """ + OBJECT_NAME = "terminal.reader" @classmethod diff --git a/stripe/api_resources/test_helpers/test_clock.py b/stripe/api_resources/test_helpers/test_clock.py index f3ae02d46..e2a7a89af 100644 --- a/stripe/api_resources/test_helpers/test_clock.py +++ b/stripe/api_resources/test_helpers/test_clock.py @@ -12,6 +12,12 @@ class TestClock( DeletableAPIResource, ListableAPIResource, ): + """ + A test clock enables deterministic control over objects in testmode. With a test clock, you can create + objects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. After the clock advances, + you can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time. + """ + OBJECT_NAME = "test_helpers.test_clock" @classmethod diff --git a/stripe/api_resources/token.py b/stripe/api_resources/token.py index a101d935c..ace3d1def 100644 --- a/stripe/api_resources/token.py +++ b/stripe/api_resources/token.py @@ -5,4 +5,29 @@ class Token(CreateableAPIResource): + """ + Tokenization is the process Stripe uses to collect sensitive card or bank + account details, or personally identifiable information (PII), directly from + your customers in a secure manner. A token representing this information is + returned to your server to use. You should use our + [recommended payments integrations](https://stripe.com/docs/payments) to perform this process + client-side. This ensures that no sensitive card data touches your server, + and allows your integration to operate in a PCI-compliant way. + + If you cannot use client-side tokenization, you can also create tokens using + the API with either your publishable or secret API key. Keep in mind that if + your integration uses this method, you are responsible for any PCI compliance + that may be required, and you must keep your secret API key safe. Unlike with + client-side tokenization, your customer's information is not sent directly to + Stripe, so we cannot determine how it is handled or stored. + + Tokens cannot be stored or used more than once. To store card or bank account + information for later use, you can create [Customer](https://stripe.com/docs/api#customers) + objects or [Custom accounts](https://stripe.com/docs/api#external_accounts). Note that + [Radar](https://stripe.com/docs/radar), our integrated solution for automatic fraud protection, + performs best with integrations that use client-side tokenization. + + Related guide: [Accept a payment](https://stripe.com/docs/payments/accept-a-payment-charges#web-create-token) + """ + OBJECT_NAME = "token" diff --git a/stripe/api_resources/topup.py b/stripe/api_resources/topup.py index 3f6dca70a..e43a77c8c 100644 --- a/stripe/api_resources/topup.py +++ b/stripe/api_resources/topup.py @@ -8,6 +8,14 @@ class Topup(CreateableAPIResource, ListableAPIResource, UpdateableAPIResource): + """ + To top up your Stripe balance, you create a top-up object. You can retrieve + individual top-ups, as well as list all top-ups. Top-ups are identified by a + unique, random ID. + + Related guide: [Topping Up your Platform Account](https://stripe.com/docs/connect/top-ups). + """ + OBJECT_NAME = "topup" @classmethod diff --git a/stripe/api_resources/transfer.py b/stripe/api_resources/transfer.py index baa7ea95a..7facb754a 100644 --- a/stripe/api_resources/transfer.py +++ b/stripe/api_resources/transfer.py @@ -16,4 +16,17 @@ class Transfer( ListableAPIResource, UpdateableAPIResource, ): + """ + A `Transfer` object is created when you move funds between Stripe accounts as + part of Connect. + + Before April 6, 2017, transfers also represented movement of funds from a + Stripe account to a card or bank account. This behavior has since been split + out into a [Payout](https://stripe.com/docs/api#payout_object) object, with corresponding payout endpoints. For more + information, read about the + [transfer/payout split](https://stripe.com/docs/transfer-payout-split). + + Related guide: [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/charges-transfers). + """ + OBJECT_NAME = "transfer" diff --git a/stripe/api_resources/treasury/credit_reversal.py b/stripe/api_resources/treasury/credit_reversal.py index 6d2cea8e9..1386ac7b5 100644 --- a/stripe/api_resources/treasury/credit_reversal.py +++ b/stripe/api_resources/treasury/credit_reversal.py @@ -6,4 +6,8 @@ class CreditReversal(CreateableAPIResource, ListableAPIResource): + """ + You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + """ + OBJECT_NAME = "treasury.credit_reversal" diff --git a/stripe/api_resources/treasury/debit_reversal.py b/stripe/api_resources/treasury/debit_reversal.py index 5f1a416f0..a88396bb1 100644 --- a/stripe/api_resources/treasury/debit_reversal.py +++ b/stripe/api_resources/treasury/debit_reversal.py @@ -6,4 +6,8 @@ class DebitReversal(CreateableAPIResource, ListableAPIResource): + """ + You can reverse some [ReceivedDebits](https://stripe.com/docs/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. + """ + OBJECT_NAME = "treasury.debit_reversal" diff --git a/stripe/api_resources/treasury/financial_account.py b/stripe/api_resources/treasury/financial_account.py index 3cb1bda58..0b89b47cb 100644 --- a/stripe/api_resources/treasury/financial_account.py +++ b/stripe/api_resources/treasury/financial_account.py @@ -12,6 +12,11 @@ class FinancialAccount( ListableAPIResource, UpdateableAPIResource, ): + """ + Stripe Treasury provides users with a container for money called a FinancialAccount that is separate from their Payments balance. + FinancialAccounts serve as the source and destination of Treasury's money movement APIs. + """ + OBJECT_NAME = "treasury.financial_account" @classmethod diff --git a/stripe/api_resources/treasury/inbound_transfer.py b/stripe/api_resources/treasury/inbound_transfer.py index 3297ce431..83914bb05 100644 --- a/stripe/api_resources/treasury/inbound_transfer.py +++ b/stripe/api_resources/treasury/inbound_transfer.py @@ -10,6 +10,10 @@ @test_helpers class InboundTransfer(CreateableAPIResource, ListableAPIResource): + """ + Use [InboundTransfers](https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + """ + OBJECT_NAME = "treasury.inbound_transfer" @classmethod diff --git a/stripe/api_resources/treasury/outbound_payment.py b/stripe/api_resources/treasury/outbound_payment.py index 7669bed9b..345c641c5 100644 --- a/stripe/api_resources/treasury/outbound_payment.py +++ b/stripe/api_resources/treasury/outbound_payment.py @@ -10,6 +10,12 @@ @test_helpers class OutboundPayment(CreateableAPIResource, ListableAPIResource): + """ + Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). + + Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. + """ + OBJECT_NAME = "treasury.outbound_payment" @classmethod diff --git a/stripe/api_resources/treasury/outbound_transfer.py b/stripe/api_resources/treasury/outbound_transfer.py index 92cc81bf8..9f5f9e22f 100644 --- a/stripe/api_resources/treasury/outbound_transfer.py +++ b/stripe/api_resources/treasury/outbound_transfer.py @@ -10,6 +10,12 @@ @test_helpers class OutboundTransfer(CreateableAPIResource, ListableAPIResource): + """ + Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + + Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. + """ + OBJECT_NAME = "treasury.outbound_transfer" @classmethod diff --git a/stripe/api_resources/treasury/received_credit.py b/stripe/api_resources/treasury/received_credit.py index 2cfb6a886..e089899c9 100644 --- a/stripe/api_resources/treasury/received_credit.py +++ b/stripe/api_resources/treasury/received_credit.py @@ -8,6 +8,10 @@ @test_helpers class ReceivedCredit(ListableAPIResource): + """ + ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. + """ + OBJECT_NAME = "treasury.received_credit" class TestHelpers(APIResourceTestHelpers): diff --git a/stripe/api_resources/treasury/received_debit.py b/stripe/api_resources/treasury/received_debit.py index 6187e1a38..acd665d74 100644 --- a/stripe/api_resources/treasury/received_debit.py +++ b/stripe/api_resources/treasury/received_debit.py @@ -8,6 +8,10 @@ @test_helpers class ReceivedDebit(ListableAPIResource): + """ + ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount. + """ + OBJECT_NAME = "treasury.received_debit" class TestHelpers(APIResourceTestHelpers): diff --git a/stripe/api_resources/treasury/transaction.py b/stripe/api_resources/treasury/transaction.py index b4e916525..4ccab45c4 100644 --- a/stripe/api_resources/treasury/transaction.py +++ b/stripe/api_resources/treasury/transaction.py @@ -5,4 +5,8 @@ class Transaction(ListableAPIResource): + """ + Transactions represent changes to a [FinancialAccount's](https://stripe.com/docs/api#financial_accounts) balance. + """ + OBJECT_NAME = "treasury.transaction" diff --git a/stripe/api_resources/treasury/transaction_entry.py b/stripe/api_resources/treasury/transaction_entry.py index c4710c938..178a4c475 100644 --- a/stripe/api_resources/treasury/transaction_entry.py +++ b/stripe/api_resources/treasury/transaction_entry.py @@ -5,6 +5,10 @@ class TransactionEntry(ListableAPIResource): + """ + TransactionEntries represent individual units of money movements within a single [Transaction](https://stripe.com/docs/api#transactions). + """ + OBJECT_NAME = "treasury.transaction_entry" @classmethod diff --git a/stripe/api_resources/usage_record.py b/stripe/api_resources/usage_record.py index 9dc913838..e3b169571 100644 --- a/stripe/api_resources/usage_record.py +++ b/stripe/api_resources/usage_record.py @@ -6,6 +6,13 @@ class UsageRecord(APIResource): + """ + Usage records allow you to report customer usage and metrics to Stripe for + metered billing of subscription prices. + + Related guide: [Metered Billing](https://stripe.com/docs/billing/subscriptions/metered-billing). + """ + OBJECT_NAME = "usage_record" @classmethod diff --git a/stripe/api_resources/webhook_endpoint.py b/stripe/api_resources/webhook_endpoint.py index 86d90eafa..7a00f671d 100644 --- a/stripe/api_resources/webhook_endpoint.py +++ b/stripe/api_resources/webhook_endpoint.py @@ -13,4 +13,14 @@ class WebhookEndpoint( ListableAPIResource, UpdateableAPIResource, ): + """ + You can configure [webhook endpoints](https://stripe.com/docs/webhooks/) via the API to be + notified about events that happen in your Stripe account or connected + accounts. + + Most users configure webhooks from [the dashboard](https://dashboard.stripe.com/webhooks), which provides a user interface for registering and testing your webhook endpoints. + + Related guide: [Setting up Webhooks](https://stripe.com/docs/webhooks/configure). + """ + OBJECT_NAME = "webhook_endpoint" diff --git a/stripe/object_classes.py b/stripe/object_classes.py index c1444bbb8..e8beec348 100644 --- a/stripe/object_classes.py +++ b/stripe/object_classes.py @@ -31,6 +31,7 @@ api_resources.CreditNoteLineItem.OBJECT_NAME: api_resources.CreditNoteLineItem, api_resources.Customer.OBJECT_NAME: api_resources.Customer, api_resources.CustomerBalanceTransaction.OBJECT_NAME: api_resources.CustomerBalanceTransaction, + api_resources.CustomerCashBalanceTransaction.OBJECT_NAME: api_resources.CustomerCashBalanceTransaction, api_resources.Dispute.OBJECT_NAME: api_resources.Dispute, api_resources.EphemeralKey.OBJECT_NAME: api_resources.EphemeralKey, api_resources.Event.OBJECT_NAME: api_resources.Event, diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index d26ab95a5..b558f3717 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -158,42 +158,6 @@ def test_invoice_upcoming(self, request_mock): stripe.Invoice.upcoming(customer="cus_9utnxg47pWjV1e") request_mock.assert_requested("get", "/v1/invoices/upcoming") - def test_order_create(self, request_mock): - stripe.Order.create( - description="description", - currency="usd", - line_items=[{"description": "my line item"}], - ) - request_mock.assert_requested("post", "/v1/orders") - - def test_order_retrieve(self, request_mock): - stripe.Order.retrieve("order_xyz") - request_mock.assert_requested("get", "/v1/orders/order_xyz") - - def test_order_update(self, request_mock): - stripe.Order.modify( - "order_xyz", - metadata={"reference_number": "123"}, - ip_address="0.0.0.0", - ) - request_mock.assert_requested("post", "/v1/orders/order_xyz") - - def test_order_cancel(self, request_mock): - stripe.Order.cancel("order_xyz") - request_mock.assert_requested("post", "/v1/orders/order_xyz/cancel") - - def test_order_list_line_items(self, request_mock): - stripe.Order.list_line_items("order_xyz") - request_mock.assert_requested("get", "/v1/orders/order_xyz/line_items") - - def test_order_reopen(self, request_mock): - stripe.Order.reopen("order_xyz") - request_mock.assert_requested("post", "/v1/orders/order_xyz/reopen") - - def test_order_submit(self, request_mock): - stripe.Order.submit("order_xyz", expected_total=100) - request_mock.assert_requested("post", "/v1/orders/order_xyz/submit") - def test_paymentintent_create(self, request_mock): stripe.PaymentIntent.create( amount=1099, @@ -1256,10 +1220,6 @@ def test_mandate_retrieve(self, request_mock): "get", "/v1/mandates/mandate_xxxxxxxxxxxxx" ) - def test_order_list(self, request_mock): - stripe.Order.list(limit=3) - request_mock.assert_requested("get", "/v1/orders") - def test_paymentintent_list(self, request_mock): stripe.PaymentIntent.list(limit=3) request_mock.assert_requested("get", "/v1/payment_intents")