Create a publishable API key
Creates a new publishable key (pk_…) owned by the authenticated principal.
The full key value is returned in this response and never again — store it
immediately. Publishable keys are safe to include in client-side code; they
are restricted to payment-method tokenization.
Authorizations
A merchant standard (sk_…) or restricted (rk_…) secret key sent as Authorization: Bearer <key>.
Body
Environment scope. test for sandbox; live for production.
test, live Optional display name for the key.
Optional notes about the key's intended use.
Authorization policy for a secret key. standard follows Ionic's
current explicitly registered data-plane policy; when explicitly
selected, the permissions field must be omitted (even an empty
array is rejected). restricted is a deny-by-default snapshot and
requires at least one explicit permission. Omit with no permissions
to create a standard key; omit with explicit permissions to infer
restricted access. Publishable keys do not support this field.
standard, restricted Permission scopes granted to the key. Values follow the resource:action
pattern, for example payments:write or api_keys:read. A non-empty
permission list creates restricted access unless access_profile is
explicitly set, in which case it must be restricted. Restricted
access requires at least one permission. An explicitly selected
standard profile rejects the field, including an empty array.
Merchant account and lifecycle permissions are not grantable API-key
scopes; historical merchants:read and merchants:write values are
inert.
RFC 3339 timestamp when the key expires. Must be in the future. Omit for a non-expiring key.
"2027-06-01T00:00:00Z"
Response
The created publishable key, including its full value.
Returned when a key is created or rotated. Includes the full authenticatable
value (key), which is shown exactly once and is not stored by Ionic. Store
it immediately.
Unique resource identifier. sk_… for secret keys; pk_… for publishable keys.
The full authenticatable token used as the Authorization: Bearer value. Present only in create and rotate responses — not included in any other response.
First 19 characters of the full key. Use this to identify the key after the secret is no longer available.
secret for server-side keys; publishable for client-side keys.
secret, publishable Environment scope this key operates in.
test, live Whether this key belongs to a merchant or a platform.
merchant, platform Identifier of the owning merchant or platform.
Permission scopes granted to this key.
Authorization policy for secret keys. Omitted for publishable keys and for temporarily unclassified legacy rows during rollout.
standard, restricted Display name assigned at creation, if set.
Notes, if set.
Unix epoch seconds when the key expires. Null if the key does not expire.

