Skip to content

Create Partner

Create a new partner organization.

WARNING

Requires partners.create permission.

Endpoint

INFO

POST /api/v1/dashboard/partners

Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer {token}Yes

Request Body

ParameterTypeRequiredDescription
namestringYesPartner name
codestringYesUnique partner code
emailstringYesContact email
phonestringNoContact phone
addressstringNoPhysical address
logofileNoPartner 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

Daakey Car Sharing Platform