POST
/
products
/
add
curl --request POST \
  --url https://waas-staging.cafeone.ng/api/v1/products/add \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "name": "<string>",
  "organizationId": "<string>",
  "description": "<string>",
  "direction": "<string>",
  "isActive": true
}'

Request Body

name
string
required

The name of the resource.
Example: ‘Loan’

organizationId
string
required

The unique identifier of the organization associated with the resource.
Example: ‘e678b629-fb56-11ef-a8a9-6045bd97b81d’

description
string
required

A description of the resource.
Example: ‘Loan’

direction
string
required

The direction of the resource (e.g., ‘D’ for debit).
Example: ‘D’

isActive
boolean
required

Indicates whether the resource is active.
Example: true

Response

✅ Success Response

Status Code: 200 OK

{
  "code": "00",
  "success": true,
  "message": "Created Successfully",
  "data": {
    "id": "ed639208-0be4-11f0-a8a9-6045bd97b81d",
    "name": "Loan",
    "organizationId": "e678b629-fb56-11ef-a8a9-6045bd97b81d",
    "description": "Loan",
    "direction": "D",
    "isActive": true,
    "dateCreated": "2025-03-28T14:57:11"
  }
}

❌ Error Responses

Status Code: 400 Bad Request

{
  "code": "400",
  "success": false,
  "message": "Invalid input data",
  "data": null
}

Status Code: 500 Internal Server Error

{
  "code": "500",
  "success": false,
  "message": "An unexpected error occurred",
  "data": null
}