POST
/
api
/
customers
Create a customer
curl --request POST \
  --url http://localhost:3000/api/customers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "address": "<string>",
  "phone": "<string>",
  "discount": 50,
  "notes": "<string>"
}
'
{
  "success": true,
  "message": "<string>",
  "data": {
    "_id": "<string>",
    "name": "<string>",
    "address": "<string>",
    "phone": "<string>",
    "discount": 50,
    "notes": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required
Minimum string length: 1
address
string
phone
string
discount
number
Required range: 0 <= x <= 100
notes
string

Response

Customer created

success
boolean
Example:

true

message
string
data
object