# PostEphemeralKeys

From **Stripe API**.

`POST /v1/ephemeral_keys`

<p>Creates a short-lived API key for a given resource.</p>

## Request body

- Required: false
### `application/x-www-form-urlencoded`

- Type: `object`

```json
{"additionalProperties":false,"properties":{"customer":{"description":"The ID of the Customer you'd like to modify using the resulting ephemeral key.","maxLength":5000,"type":"string"},"expand":{"description":"Specifies which fields in the response should be expanded.","items":{"maxLength":5000,"type":"string"},"type":"array"},"issuing_card":{"description":"The ID of the Issuing Card you'd like to access using the resulting ephemeral key.","maxLength":5000,"type":"string"}},"type":"object"}
```

## Security

### `basicAuth`

- Type: `http`
- Request header: `Authorization`
- Scheme: `basic`
Send credentials in the `Authorization` request header using the `Basic` scheme.

Basic HTTP authentication. Allowed headers-- Authorization: Basic <api_key> | Authorization: Basic <base64 hash of `api_key:`>

### `bearerAuth`

- Type: `http`
- Request header: `Authorization`
- Scheme: `bearer`
- Bearer format: `auth-scheme`
Send the token in the `Authorization` request header using the `Bearer` scheme.

Bearer HTTP authentication. Allowed headers-- Authorization: Bearer <api_key>

## Responses

### `200`

Successful response.

### `application/json`

- Type: `object`

```json
{"properties":{"created":{"description":"Time at which the object was created. Measured in seconds since the Unix epoch.","format":"unix-time","type":"integer"},"expires":{"description":"Time at which the key will expire. Measured in seconds since the Unix epoch.","format":"unix-time","type":"integer"},"id":{"description":"Unique identifier for the object.","maxLength":5000,"type":"string"},"livemode":{"description":"Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.","type":"boolean"},"object":{"description":"String representing the object's type. Objects of the same type share the same value.","enum":["ephemeral_key"],"type":"string"},"secret":{"description":"The key's secret. You can use this value to make authorized requests to the Stripe API.","maxLength":5000,"type":"string"}},"required":["created","expires","id","livemode","object"],"title":"EphemeralKey","type":"object","x-expandableFields":[],"x-resourceId":"ephemeral_key"}
```

### `default`

Error response.

### `application/json`

- Type: `object`

An error response from the Stripe API

```json
{"description":"An error response from the Stripe API","properties":{"error":{"$ref":"#/components/schemas/api_errors"}},"required":["error"],"type":"object"}
```

## Request examples

### cURL

```shell
curl --request POST \
  --url https://api.stripe.com/v1/ephemeral_keys \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data '{
  "customer": "string",
  "expand": [
    "string"
  ],
  "issuing_card": "string"
}'
```
