ABC V2 API
A complete integration interface for the ABC App to interact with the Soffa parking platform. Built for developers, designed for scale.
🔐 Authentication
All API requests must include a valid API key in the header. The API uses header-based authentication with X-API-Key.
X-API-Key: abc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Generate API Key
Use the Artisan command to generate a new API key with specific scopes:
php artisan api-key:generate "ABC App Production" --scopes=users:read --scopes=users:write
Base URL
/api
All endpoints are relative to this base URL
Create User
/create-user
Create a new user account in the system with full profile details.
{
"name": "John",
"surname": "Doe",
"email": "john.doe@example.com",
"username": "johndoe",
"password": "securePassword123",
"phone_number": "+1234567890",
"gender": 1,
"date_of_birth": "1990-01-15",
"nationality_id": 1,
"tenant_id": 1,
"is_email_confirmed": true,
"is_phone_confirmed": false
}
{
"success": true,
"message": "User created successfully",
"data": {
"id": 123,
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"username": "johndoe",
"email": "john.doe@example.com",
"phone_number": "+1234567890",
"is_active": true,
"email_verified": true,
"phone_verified": false,
"date_of_birth": "1990-01-15",
"gender": "male",
"created_at": "2024-01-15T10:30:00.000000Z"
}
}
Get User by Email or Phone
/user-by-email
Retrieve user information using email address or phone number as lookup keys.
email
string (optional)
phone_number
string (optional)
GET /user-by-email?email=john.doe@example.com&phone_number=+1234567890
Update User Profile
/user-profile
Update user profile information by email or phone number. Supports partial updates.
{
"email": "john.doe@example.com",
"name": "Johnny",
"surname": "Doe",
"new_email": "johnny.doe@example.com",
"new_phone_number": "+0987654321",
"profile_picture_url": "https://example.com/photo.jpg"
}
Delete User Profile
/user-profile
Performs a soft delete. The user is marked as deleted and inactive, and all their plates are deactivated.
{
"email": "john.doe@example.com",
"reason": "User requested account deletion"
}
🚗 Plate Management
Attach Plate to User
/attach-plate
Attach a new car plate to a user. Returns 409 Conflict if plate already attached.
{
"user_id": 123,
"plate_number": "ABC123",
"plate_name": "My BMW",
"origin_country_id": 1,
"usage_country_id": 1,
"is_favorite": true
}
Get User Plates
/user-plates
Retrieve all plates for a user by email or phone number.
Update Car Plate
/car-plates/{phoneNumber}/{carPlateId}
Note: Final plate number is concatenated: symbol + plate_number
Example: "Z" + "171696" = "Z171696"
Remove Car Plates
/car-plates/{phoneNumber}
Remove multiple car plates by phone number. Returns detailed breakdown of removed, not found, and not owned plates.
{
"car_plate_ids": [1, 2, 3]
}
Initiate Payment Method
/initiate-payment-method
Initiate Cybersource Secure Acceptance for credit card tokenization. Returns iframe URL and signed fields.
{
"phone_number": "+1234567890"
}
{
"iframe_url": "https://testsecureacceptance...",
"fields": { ... },
"signature": "base64signature...",
"reference_number": "ABC_123_1705765800"
}
Get All Countries
/countries
Retrieve a list of all countries with ISO codes and deployment status.
Search Countries
/countries/search?q={query}
Search countries by name. Minimum 2 characters required.
⚠️ Error Responses
Bad Request
Validation failed - check request parameters
validation_failed
Unauthorized
API key is missing or invalid
missing_api_key
Forbidden
User does not own this resource
plate_not_owned
Not Found
User or resource not found
user_not_found
Conflict
Resource already exists (e.g., plate already attached)
plate_already_attached
Internal Server Error
Server error - contact support
creation_failed
Data Types Reference
Gender Values
1
Male
2
Female
User Status Fields
IsActive
- Account active status
IsDeleted
- Soft delete status
IsEmailConfirmed
- Email verification
API Key Management
php artisan api-key:generate "ABC App Production" --scopes=users:read --scopes=users:write
php artisan api-key:list
php artisan api-key:list --active
php artisan api-key:list --revoked
php artisan api-key:revoke 1
php artisan api-key:rotate 1