Mint a customer-portal access token
Returns a short-lived HS256 JWT for the customer portal. A customer not in the key's organisation is reported as 400 here (not 404); an organizationId mismatch is 403. When your Clocknext plan does not include the Customer portal, every call is 403 FEATURE_LOCKED.
Base URL https://payments.clocknext.com/api/v1
apiKeyAuthorizationBearer <cnk_…>Organisation-scoped key from Settings → API Keys.
application/json- body
customerId*stringThe ClockNext id of the customer the portal is for. Your own externalId is not accepted here.
1 <= lengthorganizationId?stringIf present, must equal the key's organisation (else 403).
1 <= lengthttlSeconds?integerClamped to the organisation's configured TTL cap.
1 <= value <= 3600memberEmail?stringPaid-by / receipt email; embedded as the token's email claim.
emailToken minted.
application/json- response
statusCode*integerThe HTTP status code of the response, repeated in the body.
statusDetail*The status of the request. status is SUCCESS, and message says what happened.
result*The customer-portal token and when it expires.
curl -X POST 'https://payments.clocknext.com/api/v1/portal/token' \ -H 'Content-Type: application/json' \ -d '{ "customerId": "cmvgva5po000c07iir1vtn8vl"}'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Request processed successfully." }, "result": { "token": "eyJhbGciO…redacted", "expiresAt": 1792516260, "expiresIn": 3600 }}Types
Every object type on this page, with its fields.
PortalTokenInput
| Field | Type | Required | Description |
|---|---|---|---|
customerId | string | yes | The ClockNext id of the customer the portal is for. Your own externalId is not accepted here. |
organizationId | string | no | If present, must equal the key's organisation (else 403). |
ttlSeconds | integer | no | Clamped to the organisation's configured TTL cap. |
memberEmail | string | no | Paid-by / receipt email; embedded as the token's email claim. |
PortalToken
| Field | Type | Required | Description |
|---|---|---|---|
token | string | yes | HS256 JWT (header.payload.signature). |
expiresAt | integer | yes | Expiry as a Unix timestamp (seconds). |
expiresIn | integer | yes | Seconds until expiry. |