Ephemeral Keys
Ephemeral keys give the SDKs (like Stripe’s mobile SDKs and Issuing Elements) temporary, scoped access to a specific resource, such as a Customer, Issuing Card, or Identity VerificationSession, without exposing your secret API key.
Related guides: Using Issuing Elements.
Was this section helpful? Yes No
Create an ephemeral key
POST / v1 / ephemeral_keys
Immediately invalidate an ephemeral key
DELETE / v1 / ephemeral_keys /:id
The Ephemeral Key object
Attributes
- id string Unique identifier for the object.
- object string, value is "ephemeral_key" String representing the object’s type. Objects of the same type share the same value.
- created timestamp Time at which the object was created. Measured in seconds since the Unix epoch.
- expires timestamp Time at which the key will expire. Measured in seconds since the Unix epoch.
- livemode boolean If the object exists in live mode, the value is
true. If the object exists in test mode, the value isfalse. - secret string The key’s secret. You can use this value to make authorized requests to the Stripe API.
The Ephemeral Key object
{ "id": "ephkey_1Mr6PhLkdIwHu7ix9Al0eucz", "object": "ephemeral_key", "associated_objects": [ { "type": "customer", "id": "cus_NcCEBjJZgYGgljz" } ], "created": 1680226347, "expires": 1680229947, "livemode": false, "secret": "ek_test_YWNjdF8xTTJKVGtMa2RJd0h1N2l4LDJTWXVEUUY2c0hZTllRc0dGb2hVanBXRktQTlZoNHc_00TkfmS8Az"}
Create an ephemeral key
POST / v1 / ephemeral_keys
Creates a short-lived API key for a given resource.
Parameters
- customer string The ID of the Customer you’d like to modify using the resulting ephemeral key.
- issuing _ card string The ID of the Issuing Card you’d like to access using the resulting ephemeral key.
- nonce string A single-use token, created by Stripe.js, used for creating ephemeral keys for Issuing Cards without exchanging sensitive information.
- verification _ session string The ID of the Identity VerificationSession you’d like to access using the resulting ephemeral key
Returns
Returns the key object.
cURL
Response
{ "id": "ephkey_1Mr6PhLkdIwHu7ix9Al0eucz", "object": "ephemeral_key", "associated_objects": [ { "type": "customer", "id": "cus_NcCEBjJZgYGgljz" } ], "created": 1680226347, "expires": 1680229947, "livemode": false, "secret": "ek_test_YWNjdF8xTTJKVGtMa2RJd0h1N2l4LDJTWXVEUUY2c0hZTllRc0dGb2hVanBXRktQTlZoNHc_00TkfmS8Az"}
