Back to siteAPI Documentation
POST

/api/v1/auth/login

Auth: None

Login

Returns an access token used in the Authorization header for protected endpoints.

Body parameters

NameTypeRequiredDescription
emailstringYesMerchant user email address.
passwordstringYesMerchant user password.

Example response

<?php

return [
  'success' => true,
  'data' => [
    'token' => 'eyJhbGciOi...',
    'refresh_token' => 'def50200...',
    'expires_in' => 3600,
    'user' => [
      'user_id' => 'usr_001',
      'name' => 'Merchant Admin',
      'email' => '[email protected]',
      'role' => 'user',
      'status' => 'active'
    ]
  ]
];

Request examples

curl -X POST \
  "https://api.spaces.za.com/api/v1/auth/login" \
  -H "Content-Type: application/json" \\
  --data '{
  "email": "[email protected]",
  "password": "password1234"
}'