Skip to content

Stripe: Retrieve a token

Stripe tokens.getTokensToken: arguments, response, policy and SDK examples.

← Tokens operations · Get started

Operation stripe.gettokenstoken

Provider route: GET /v1/tokens/{token}. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/stripe with npm, or alter-sdk-stripe with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { StripeIntegration } from "@alter-ai/stripe";
async function execute(input: Parameters<StripeIntegration["tokens"]["getTokensToken"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new StripeIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.tokens.getTokensToken(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_stripe import StripeIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = StripeIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.tokens.get_tokens_token(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.tokenstringRequired within parentMaximum length: 5000
queryobjectOptionalAdditional keys: not allowed
query.expandarrayOptional
query.expand[]stringEach itemMaximum length: 5000

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Retrieve a token — response body

Referenced models: Retrieve a token — response body

702 more schemas are linked from the tables above, on the schema pages.

Retrieve a token — response body
FieldTypePresenceDescription and constraints
$objectRootTokenization 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. Use our
[recommended payments integrations](https://docs.stripe.com/payments) to perform this process
on the client-side. This guarantees that no sensitive card data touches your server,
and allows your integration to operate in a PCI-compliant way.

If you can't use client-side tokenization, you can also create tokens using
the API with either your publishable or secret API key. If
your integration uses this method, you're responsible for any PCI compliance
that it might require, and you must keep your secret API key safe. Unlike with
client-side tokenization, your customer's information isn't sent directly to
Stripe, so we can't determine how it's handled or stored.

You can't store or use tokens more than once. To store card or bank account
information for later use, create [Customer](https://docs.stripe.com/api#customers)
objects or [External accounts](/api#external_accounts).
[Radar](https://docs.stripe.com/radar), our integrated solution for automatic fraud protection,
performs best with integrations that use client-side tokenization.
bank_accountModelOptionalExpand Retrieve a bank account — response body
cardModelOptionalExpand Retrieve a card — customers get Customers Customer Cards Id — response body
client_ipJSONOptional
client_ip (anyOf 1)stringAlternativeIP address of the client that generates the token.
Maximum length: 5000
client_ip (anyOf 2)nullAlternative
createdJSONRequired within parent
created (anyOf 1)integerAlternativeTime at which the object was created. Measured in seconds since the Unix epoch.
Format: unix-time
created (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
livemodebooleanRequired within parentIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: token
typestringRequired within parentType of the token: `account`, `bank_account`, `card`, or `pii`.
Maximum length: 5000
usedbooleanRequired within parentDetermines if you have already used this token (you can only use tokens once).

Referenced models: Retrieve a bank account — response body, Retrieve a card — customers get Customers Customer Cards Id — response body

Delete a customer — response body
FieldTypePresenceDescription and constraints
$objectRoot
deletedbooleanRequired within parentAlways true for a deleted object
Known values: True
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: customer
Retrieve a bank account — response body — requirements value currently due, errors, past due, pending verification
FieldTypePresenceDescription and constraints
$objectRoot
currently_dueJSONOptional
currently_due (anyOf 1)arrayAlternativeFields that need to be resolved to keep the external account enabled. If not resolved by `current_deadline`, these fields will appear in `past_due` as well, and the account is disabled.
currently_due (anyOf 1)[]stringEach itemMaximum length: 5000
currently_due (anyOf 2)nullAlternative
errorsJSONOptional
errors (anyOf 1)arrayAlternativeFields that are `currently_due` and need to be collected again because validation or verification failed.
errors (anyOf 1)[]ModelEach itemExpand Update an Account Capability — response body — requirements errors item
errors (anyOf 2)nullAlternative
past_dueJSONOptional
past_due (anyOf 1)arrayAlternativeFields that haven't been resolved by `current_deadline`. These fields need to be resolved to enable the external account.
past_due (anyOf 1)[]stringEach itemMaximum length: 5000
past_due (anyOf 2)nullAlternative
pending_verificationJSONOptional
pending_verification (anyOf 1)arrayAlternativeFields that are being reviewed, or might become required depending on the results of a review. If the review fails, these fields can move to `eventually_due`, `currently_due`, `past_due` or `alternatives`. Fields might appear in `eventually_due`, `currently_due`, `past_due` or `alternatives` and in `pending_verification` if one verification fails but another is still pending.
pending_verification (anyOf 1)[]stringEach itemMaximum length: 5000
pending_verification (anyOf 2)nullAlternative

Referenced models: Update an Account Capability — response body — requirements errors item

Retrieve a card — customers get Customers Customer Cards Id — response body — networks
FieldTypePresenceDescription and constraints
$objectRoot
preferredJSONOptional
preferred (anyOf 1)stringAlternativeThe preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card.
Maximum length: 5000
preferred (anyOf 2)nullAlternative
Create an account — response body — groups The groups associated with the account payments pricing
FieldTypePresenceDescription and constraints
$objectRoot
payments_pricingJSONOptional
payments_pricing (anyOf 1)stringAlternativeThe group the account is in to determine their payments pricing, and null if the account is on customized pricing. [See the Platform pricing tool documentation](https://docs.stripe.com/connect/platform-pricing-tools) for details.
Maximum length: 5000
payments_pricing (anyOf 2)nullAlternative
Create an account — response body — tos acceptance
FieldTypePresenceDescription and constraints
$objectRoot
dateJSONOptional
date (anyOf 1)JSONAlternative
date (anyOf 1) (anyOf 1)integerAlternativeThe Unix timestamp marking when the account representative accepted their service agreement
Format: unix-time
date (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
date (anyOf 2)nullAlternative
ipJSONOptional
ip (anyOf 1)stringAlternativeThe IP address from which the account representative accepted their service agreement
Maximum length: 5000
ip (anyOf 2)nullAlternative
service_agreementstringOptionalThe user's service agreement type
Maximum length: 5000
user_agentJSONOptional
user_agent (anyOf 1)stringAlternativeThe user agent of the browser from which the account representative accepted their service agreement
Maximum length: 5000
user_agent (anyOf 2)nullAlternative
Create an account — response body — controller
FieldTypePresenceDescription and constraints
$objectRoot
feesModelOptionalExpand Create an account — response body — controller fees
is_controllerbooleanOptional`true` if the Connect application retrieving the resource controls the account and can therefore exercise [platform controls](https://docs.stripe.com/connect/platform-controls-for-standard-accounts). Otherwise, this field is null.
lossesModelOptionalExpand Create an account — response body — controller losses
requirement_collectionstringOptionalA value indicating responsibility for collecting requirements on this account. Only returned when the Connect application retrieving the resource controls the account.
Known values: application, stripe
stripe_dashboardModelOptionalExpand Create an account — response body — controller stripe dashboard
typestringRequired within parentThe controller type. Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself.
Known values: account, application

Referenced models: Create an account — response body — controller fees, Create an account — response body — controller losses, Create an account — response body — controller stripe dashboard

Create an account — response body — requirements alternatives array item
FieldTypePresenceDescription and constraints
$objectRoot
alternative_fields_duearrayRequired within parentFields that can be provided to resolve all fields in `original_fields_due`.
alternative_fields_due[]stringEach itemMaximum length: 5000
original_fields_duearrayRequired within parentFields that are due and can be resolved by providing all fields in `alternative_fields_due`.
original_fields_due[]stringEach itemMaximum length: 5000

SDK function policy ID: stripe.gettokenstoken. Catalog operation: GetTokensToken. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"Stripe-Version": "2026-09-30.endive"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.