Delete a Secret 

Deletes a secret from the secret store by name and scope.

Parameters

  • namestringRequired

    A name for the secret that’s unique within the scope.

  • scopeassociative arrayRequired

    Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.

Returns

Returns the deleted secret object.

POST /v1/apps/secrets/delete
$stripe = new \Stripe\StripeClient('sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2');
$secret = $stripe->apps->secrets->deleteWhere([
'name' => 'my-api-key',
'scope' => ['type' => 'account'],
]);
Response
{
"id": "appsecret_5110hHS1707T6fjBnah1LkdIwHu7ix",
"object": "apps.secret",
"deleted": true
}

Find a Secret 

Finds a secret in the secret store by name and scope.

Parameters

  • namestringRequired

    A name for the secret that’s unique within the scope.

  • scopeassociative arrayRequired

    Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.

Returns

Returns a secret object.

GET /v1/apps/secrets/find
$stripe = new \Stripe\StripeClient('sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2');
$secret = $stripe->apps->secrets->find([
'name' => 'my-api-key',
'scope' => ['type' => 'account'],
]);
Response
{
"id": "appsecret_5110hHS1707T6fjBnah1LkdIwHu7ix",
"object": "apps.secret",
"created": 1680209063,
"expires_at": null,
"livemode": false,
"name": "my-api-key",
"scope": {
"type": "account"
}
}

Set a Secret 

Create or replace a secret in the secret store.

Parameters

  • namestringRequired

    A name for the secret that’s unique within the scope.

  • payloadstringRequired

    The plaintext secret value to be stored.

  • scopeassociative arrayRequired

    Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user.

  • expires_attimestamp

    The Unix timestamp for the expiry time of the secret, after which the secret deletes.

Returns

Returns a secret object.

POST /v1/apps/secrets
$stripe = new \Stripe\StripeClient('sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2');
$secret = $stripe->apps->secrets->create([
'name' => 'my-api-key',
'payload' => 'secret_key_xxxxxx',
'scope' => ['type' => 'account'],
]);
Response
{
"id": "appsecret_5110hHS1707T6fjBnah1LkdIwHu7ix",
"object": "apps.secret",
"created": 1680209063,
"expires_at": null,
"livemode": false,
"name": "my-api-key",
"scope": {
"type": "account"
}
}

Early Fraud Warning 

An early fraud warning indicates that the card issuer has notified us that a charge may be fraudulent.

Related guide: Early fraud warnings

Reviews 

Reviews can be used to supplement automated fraud detection with human expertise.

Learn more about Radar and reviewing payments here.