Sample - Stripe API
POST/v1/ephemeral_keys

Create an ephemeral key

Creates a short-lived API key for a given resource.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.
  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

5 body fields
customerstringoptional
The ID of the Customer you'd like to modify using the resulting ephemeral key.
expandarray<string>optional
Specifies which fields in the response should be expanded.
issuing_cardstringoptional
The ID of the Issuing Card you'd like to access using the resulting ephemeral key.
noncestringoptional
A single-use token, created by Stripe.js, used for creating ephemeral keys for Issuing Cards without exchanging sensitive information.
verification_sessionstringoptional
The ID of the Identity VerificationSession you'd like to access using the resulting ephemeral key

2 status codes
200Successful response.
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
expiresintegerrequired
Time at which the key will expire. Measured in seconds since the Unix epoch.
idstringrequired
Unique identifier for the object.
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:ephemeral_key
secretstringoptional
The key's secret. You can use this value to make authorized requests to the Stripe API.
defaultError response.
errorobjectrequired

Error handling

Any other status is an error: Error response.