Skip to content

CreateCustomerSSOCode

Description: Creates a one-time terminal sign-in URL for an enabled customer. The link is bound to the customer's brand and expires after 60 seconds.

Access Control

🔐 Session required: manager, admin, dealer, CRM manager, or CRM admin.

The normal grant requires access_crm = 1 and the explicit create_customer_sso = 1 permission. Only a global super admin (super_admin = 1) bypasses these grant checks. Brand-admin status does not automatically grant this permission. The server also checks current CRM brand, assignment/desk visibility and that the target customer and brand are enabled and admitted for licensed API access. The brand's configured terminal host must also be approved for terminal access; API admission alone is insufficient.

Request Parameters

Name Type Required Description
customer_id integer Yes Positive ID of the enabled customer to sign in.

Request Example

{
  "command": "CreateCustomerSSOCode",
  "extID": "sso-customer-1",
  "__token": "<manager session JWT>",
  "data": {
    "customer_id": 1042
  }
}

Response Parameters

The fields below are returned inside data in the TCP response envelope.

Name Type Description
login_url string Complete terminal URL with sso_code=<64 lowercase hex characters>. Customer preferred language is used, then brand default, then en.
expires_in integer Code lifetime in seconds (60).

Response Example

{
  "extID": "sso-customer-1",
  "status": 200,
  "data": {
    "login_url": "https://terminal.example/en/platform?sso_code=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
    "expires_in": 60
  }
}

Codes are stored as hashes in bounded process memory. A server restart invalidates outstanding codes. Each recognized code is consumed by one redemption attempt, including an attempt on the wrong brand.

Errors

Status Error Description
400 INVALID_DATA customer_id is missing, not an integer, or not positive.
403 RET_NOT_ENOUGH_RIGHTS Router staff permission or scope check failed.
403 SSO_ACCESS_DENIED Caller/target is disabled, required permission is missing, or current customer visibility checks failed.
503 SSO_CONFIGURATION_INVALID Terminal URL or language cannot be used to form a safe URL.
503 SSO_CODE_UNAVAILABLE Secure code generation failed or the in-memory store reached capacity.
503 LICENSE_NOT_ACTIVE A required active license lease is unavailable.