Create payment enrollment token
LogsPOST /payment-connectors/enrollment-tokens
Issue a payment connector enrollment token for the caller's tenant, returned once
Creates a one-time-visible enrollment token (prefixed enr_) that a payment connector exchanges to register itself with this tenant, and returns it with 201. The raw token is in the response only; just its hash is stored. The body takes an optional name (defaults to "default"), max_uses (0 means unlimited) and valid_duration_seconds (defaults to 30 days). Requires the payments:write permission.
Body application/json
namemax_usesvalid_duration_seconds
Returns
201 Token issued
Show attributes
tenant_ididtokenReturned once; store securely before closing the dialog
namemax_usesuses_countexpires_atcreated_at
Permissions payments:write · Roles: admin, billing_clerk, finance, owner
curl -X POST "$BUSINESS_API/payment-connectors/enrollment-tokens" \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Ana Matsinhe",
"max_uses": 1,
"valid_duration_seconds": 1
}'
# No matching CLI command; use cURL or direct HTTP.
const res = await fetch("$BUSINESS_API/payment-connectors/enrollment-tokens", {
method: "POST",
headers: {
Authorization: "Bearer sk_test_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "Ana Matsinhe",
"max_uses": 1,
"valid_duration_seconds": 1
})
});
const data = await res.json();
import requests
res = requests.post(
"$BUSINESS_API/payment-connectors/enrollment-tokens",
headers={
"Authorization": "Bearer sk_test_..."
},
json={
"name": "Ana Matsinhe",
"max_uses": 1,
"valid_duration_seconds": 1
}
)
data = res.json()
body := strings.NewReader(`{
"name": "Ana Matsinhe",
"max_uses": 1,
"valid_duration_seconds": 1
}`)
req, _ := http.NewRequest("POST", "$BUSINESS_API/payment-connectors/enrollment-tokens", body)
req.Header.Set("Authorization", "Bearer sk_test_...")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
{
"tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
"id": "idx_2xBW8Tr0oR5YsrNoIdzQO7t4Gjn",
"token": "token",
"name": "Ana Matsinhe",
"max_uses": 1,
"uses_count": 1,
"expires_at": "2026-11-19T09:30:00Z",
"created_at": "2026-11-19T09:30:00Z"
}