Create Partner
Create a new partner organization.
WARNING
Requires partners.create permission.
Endpoint
INFO
POST /api/v1/dashboard/partners
Headers
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Partner name |
code | string | Yes | Unique partner code |
email | string | Yes | Contact email |
phone | string | No | Contact phone |
address | string | No | Physical address |
logo | file | No | Partner logo (PNG, JPG) |
Example Request
bash
curl -X POST https://api.daakey.com/api/v1/dashboard/partners \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{
"name": "New Partner Inc",
"code": "NEWPART",
"email": "contact@newpartner.com",
"phone": "+1234567890",
"address": "123 Business Ave, City"
}'Response
Success (201)
json
{
"success": true,
"message": "Partner created successfully",
"data": {
"id": 3,
"name": "New Partner Inc",
"code": "NEWPART",
"email": "contact@newpartner.com",
"phone": "+1234567890",
"address": "123 Business Ave, City",
"status": "active",
"logo_url": null,
"created_at": "2024-01-20T00:00:00Z"
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Error (422)
json
{
"success": false,
"message": "Validation failed",
"errors": {
"code": ["The code has already been taken."],
"email": ["The email must be a valid email address."]
},
"data": null,
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Notes
- Partner code must be unique across the system
- Partner code is used in API references and cannot be changed
- After creation, agencies can be added to the partner