Stripe's domain centers on money moving objects (customers, payment methods, PaymentIntents, charges, refunds, invoices, subscriptions) plus a large set of adjunct domains (products/prices, Connect accounts and external accounts, payouts/transfers, issuing/terminal, treasury, tax). Most real user requests involve a small subset: create a charge or PaymentIntent, attach a payment method to a customer, refund, invoice, and manage subscriptions. Understand how those resources relate and which IDs you must fetch first; where possible, prefer the PaymentIntent path for modern payment flows.
How the API models money and customers (high-level)
- Customer is the canonical buyer record. Many flows start from or attach to a
customerid. Customers hold saved payment sources and PaymentMethods and own subscriptions and invoices. - PaymentMethod and legacy payment sources (cards, bank accounts, sources) represent payment credentials. PaymentMethods can be attached to a
customeror used directly with aPaymentIntent/SetupIntent. - PaymentIntent is the central object for processing payments in current Stripe flows: create a PaymentIntent, confirm it, then (optionally) capture it. Charges still exist (returned on some endpoints) and older integrations use
Chargedirectly; PaymentIntent is preferred for new payments. - Refunds can be created against a Charge or via Refund endpoints; PaymentIntent and Charge objects will show resulting refunds.
- Subscriptions are built from Prices/Plans and create Invoices. Invoices are finalized and paid; you can preview, pay, finalize, and send invoices.
- Products and Prices are the catalog: subscriptions reference
priceids; checkout sessions and payment links reference prices or products. - Connect accounts (Accounts) are separate Stripe accounts you manage; many account-scoped endpoints require an
accountid and expose external accounts, persons, and capabilities.
Entry points — what to call first
Start from the resource the user mentions. Common entry calls to discover IDs you will need next:
- If the user names a customer or asks “work with my customer,” call
GetCustomersorGetCustomersCustomerto obtain thecustomerid and inspect attached payment methods (useGetCustomersCustomerPaymentMethodsandGetCustomersCustomerSources). - If the user is asking to take a payment, create or inspect a
PaymentIntent:PostPaymentIntentsto create;GetPaymentIntentsIntentto retrieve. You will often need thepayment_intentid for confirm/capture/cancel operations. - For saved payment credentials, list the customer’s payment methods with
GetCustomersCustomerPaymentMethodsor retrieve a singlePaymentMethodwithGetPaymentMethodsPaymentMethod. - For subscriptions and recurring billing, list
GetSubscriptionsor get a specific subscription withGetSubscriptionsSubscriptionExposedId. Subscription items are available viaGetSubscriptionItemsandGetSubscriptionItemsItem. - For checkout pages or one-off links, use
GetCheckoutSessions/GetCheckoutSessionsSessionorGetPaymentLinks/GetPaymentLinksPaymentLinkto inspect active sessions and line items. - For Connect onboarding or account-level tasks, use
GetAccounts/GetAccountsAccountand create an account link withPostAccountLinksfor onboarding.
These list/get entry points return the IDs you will pass to subsequent calls (e.g., customer, payment_intent, charge, invoice, subscription_exposed_id, price, product, account).
Common tasks and the sequence of calls (quick recipes)
Create a modern card payment (recommended flow)
- Create a PaymentIntent:
PostPaymentIntents(includecustomerif saving or associating). - Confirm the PaymentIntent (if client-side confirmation is not used):
PostPaymentIntentsIntentConfirm. - If using manual capture, capture it with
PostPaymentIntentsIntentCapture. - To inspect the result, call
GetPaymentIntentsIntentor list charges viaGetChargesfiltered bypayment_intent.
Attach a PaymentMethod to a customer
- Create or fetch the
PaymentMethod(PostPaymentMethodsorGetPaymentMethods/GetCustomersCustomerPaymentMethods). - Attach with
PostPaymentMethodsPaymentMethodAttach(path parameterpayment_method) and then list customer payment methods if needed.
Refund a payment
- Refund a Charge with
PostChargesChargeRefunds(pathcharge) or create a Refund usingPostRefunds(body can referencechargeorpayment_intent). - Inspect refunds with
GetRefundsorGetRefundsRefund.
Create a subscription for a customer
- Ensure a
customerexists (PostCustomers/GetCustomers). - Create the subscription with
PostSubscriptionsorPostCustomersCustomerSubscriptions(passcustomeranditemsreferencingpriceids). - Manage or cancel: retrieve with
GetSubscriptionsSubscriptionExposedIdand cancel withDeleteSubscriptionsSubscriptionExposedIdor update withPostSubscriptionsSubscriptionExposedId.
Checkout / hosted payment
- Create a Checkout session with
PostCheckoutSessions(or create a Payment Link withPostPaymentLinks). - Inspect session with
GetCheckoutSessionsSessionand its line items withGetCheckoutSessionsSessionLineItems.
Invoice lifecycle (invoicing from subscriptions or one-off invoices)
- Create invoice items with
PostInvoiceitemsor create invoices withPostInvoices. - Preview with
PostInvoicesCreatePreviewif needed. - Finalize with
PostInvoicesInvoiceFinalizethenPostInvoicesInvoicePayto pay, orPostInvoicesInvoiceSendto email.
Manage Connect accounts
- List connected accounts with
GetAccountsand inspect a specificaccountwithGetAccountsAccount. - Create onboarding links with
PostAccountLinks. - Manage external bank accounts/retrievals with
GetAccountsAccountExternalAccounts,PostAccountsAccountExternalAccounts, and delete viaDeleteAccountsAccountExternalAccountsId.
Payouts and transfers
- Inspect
GetPayouts/GetPayoutsPayoutfor transfers to external accounts. - Create transfers with
PostTransfers, list withGetTransfers, and reverse withPostTransfersIdReversals.
Test helpers and simulation
- Use the test-helper endpoints (prefix
PostTestHelpers...) to simulate card shipping, issuing authorizations, inbound/outbound treasury flows, and test clocks. If the user asks to simulate test outcomes, these endpoints exist and return the simulated object state.
Patterns and conventions you will reuse
- Many resources have paired list and get endpoints: call the list endpoint to discover ids, then call the get endpoint to inspect a single resource. Use query filters (e.g.,
customer,payment_intent,status) to narrow lists. - Search endpoints (
GetChargesSearch,GetCustomersSearch,GetPaymentIntentsSearch,GetPricesSearch,GetProductsSearch,GetSubscriptionsSearch) return asearch_resultstructure withnext_page(usepageto fetch next results). Use search when you need field-level querying that lists cannot provide. - Many endpoints accept
expandso you can fetch nested objects in the same response (e.g., expand the PaymentIntent’spayment_methodor a Checkout Session’spayment_intent). Useexpandto avoid extra calls when you need nested data. - Create/update flows are usually
POSToperations and deletion usesDELETE. Deletes commonly return aDeletedXobject; retrieval endpoints sometimes return either the original resource or aDeleted...variant—inspect theobjector response fields to detect deletions. - For payment flows, note the three-step variants: create → confirm → capture. Some clients confirm on the frontend; you can run confirm server-side with
PostPaymentIntentsIntentConfirmif necessary.
IDs and fields you will frequently need
These IDs show up across domains. When the user doesn't supply an ID, fetch it from the appropriate list/get endpoint.
customer— used for payment methods, invoices, subscriptions, sessions.payment_intent/ PaymentIntent id — used to confirm, capture, cancel payments.charge— older flows and some refund endpoints still target charges.refund— refunds are retrievable and updatable.invoice— for invoice lines, payments, finalization and sending.subscription_exposed_id/subscription— subscription resource id used for update/cancel operations.price/product— catalog ids for subscriptions and one-off items.account— Connect account id used when operating on connected accounts and external accounts.payment_method— saved credentials: attach/detach or use directly with PaymentIntents.
Non-obvious gotchas and quirks
-
PaymentIntent vs Charge: modern integrations should use
PaymentIntent. Charges still appear (and many endpoints accept or return charge ids), so inspect both if you’re reconciling a payment. Refunds may be attached to achargeeven when you created the payment via aPaymentIntent. -
Responses for deleted resources: some retrieval endpoints return either the resource or a
Deleted...variant (e.g.,Customer | DeletedCustomer,TerminalConfiguration | DeletedTerminalConfiguration). Check the returned object shape rather than assuming deletion will mean a 404. -
client_secretexposure: some retrieval endpoints accept aclient_secretquery parameter when a publishable key is used to retrieve an object. When a user asks to return client-visible secrets, check whetherclient_secretis required/returned on that endpoint. -
expandis your friend: many objects embed references (payment method on a PaymentIntent, invoice on a credit note). When a user asks for full details, request the appropriateexpandvalues to reduce follow-up calls. -
Search pagination differs from list pagination: search endpoints use
pageand returnnext_page; list endpoints usestarting_after/ending_before/limit. If a user needs advanced filtering across fields, use the search endpoints and follow thenext_pagecursor. -
Subscriptions have two id flavors in this surface:
subscription_exposed_idappears in many subscription endpoints; some listing endpoints return the plainidfor subscription items. Use the exact id you retrieved from the subscription/list call for path parameters. -
Invoicing and credit notes: preview endpoints (
GetCreditNotesPreview,GetCreditNotesPreviewLines) let you simulate a credit note before creating it. When issuing a credit note that should also create refunds, includerefunds/refund_amountappropriately in the preview to see effects. -
Checkout Sessions and Payment Links: Checkout sessions can point to PaymentIntents, subscriptions, or one-off payments. Inspect
GetCheckoutSessionsSessionandGetCheckoutSessionsSessionLineItemsto map what the session will charge. -
Test-mode helpers: several
PostTestHelpers...endpoints exist to simulate outcomes (e.g., issuing authorizations, shipping cards, advancing test clocks). Use them only when the user explicitly asks to simulate test-mode behavior. -
Terminal readers and in-person flows: terminal operations are stateful (reader actions). If the user asks to interact with a reader, use the terminal reader endpoints (
GetTerminalReaders,PostTerminalReaders...andPostTerminalReadersReaderProcessPaymentIntent, etc.) and inspect reader state fields in the response to determine success.
Final note on prioritization
When a user asks for a payment-related task, default to the PaymentIntent flow and customer-centric approach: fetch or create the customer, ensure a saved payment_method if requested, create a PaymentIntent referencing those objects, confirm, then capture if required. For subscription billing, fetch product/price ids first, create the subscription, then inspect invoices and payment history. For Connect or treasury tasks, start from the account or financial_account list endpoints to obtain the account-scoped ids you'll need.
Use the list and get entry points described above to obtain IDs and then call the create/update/delete operations that follow the sequences in the recipes. The API returns enough context (including expanded objects when requested) to avoid extra calls if you request the right expand values up front.