Toggle Partner Status
Activate or deactivate a partner.
WARNING
Requires super-admin role.
Endpoint
INFO
PATCH /api/v1/dashboard/partners/{partner}/toggle-status
Headers
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
partner | integer | Partner ID |
Example Request
bash
curl -X PATCH https://api.daakey.com/api/v1/dashboard/partners/1/toggle-status \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"Response
Success (200)
json
{
"success": true,
"message": "Partner status updated",
"data": {
"id": 1,
"name": "Acme Car Rentals",
"status": "inactive",
"updated_at": "2024-01-15T00:00:00Z"
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Error (400)
json
{
"success": false,
"message": "Cannot deactivate partner",
"data": {
"reason": "Partner has active bookings",
"active_bookings": 5
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Notes
- Deactivating a partner also deactivates all agencies
- Deactivated partners cannot accept new bookings
- Existing bookings continue until completion