Registrar dispositivo

Registrar un cliente anonimo por device token.

POST/api/sdk/clients/register-device

Registra un dispositivo como cliente anonimo. Si el token ya existe, retorna el cliente existente.

Request body

ParametroTipoDescripcion

Ejemplo

curl -X POST https://southgames.ai/api/sdk/clients/register-device \
  -H "Authorization: Bearer sg_live_xxx" \
  -H "X-Org-Id: mi-empresa" \
  -H "Content-Type: application/json" \
  -d '{
    "deviceToken": "fcm_token_abc123",
    "os": "android",
    "locale": "es-CL"
  }'

Respuesta

{
  "success": true,
  "data": {
    "clientId": "abc123def456",
    "created": true
  }
}
CampoTipoDescripcion
clientIdstringID del cliente (nuevo o existente)
createdbooleantrue si se creo un nuevo cliente anonimo

Notas

  • Los clientes anonimos se crean con anonymous: true en Firestore.
  • Si el deviceToken ya pertenece a un cliente existente, se retorna ese cliente sin crear uno nuevo.
  • Para identificar al cliente posteriormente, usa /clients/register con el campo anonymousClientId.