cURL
curl --request POST \ --url https://api.example.com/api/unions \ --header 'Content-Type: application/json' \ --data ' { "name": "<string>", "location": "<string>", "address": "<string>", "creditOfficerId": "<string>" } '
{ "success": true, "message": "<string>", "data": { "id": "<string>", "name": "<string>", "location": "<string>", "address": "<string>", "creditOfficerId": "<string>", "createdAt": "<string>", "updatedAt": "<string>", "deletedAt": "<string>" } }
Authorization: Bearer <token>
Show Union properties
curl --request POST \ --url https://api.example.com/api/unions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Central Farmers Union", "location": "Lagos", "address": "123 Main Street, Ikeja, Lagos", "creditOfficerId": "clx1234567890" }'
{ "success": true, "message": "Union created successfully", "data": { "id": "clx9876543210", "name": "Central Farmers Union", "location": "Lagos", "address": "123 Main Street, Ikeja, Lagos", "creditOfficerId": "clx1234567890", "createdAt": "2024-03-15T10:30:00.000Z", "updatedAt": "2024-03-15T10:30:00.000Z", "deletedAt": null } }
{ "success": false, "message": "Unauthorized" }
{ "success": false, "message": "Access denied. Insufficient permissions." }
{ "success": false, "message": "Name and creditOfficerId are required" }
{ "success": false, "message": "Failed to create union" }
UNION_CREATED