Customers
Generated from Malapos's own code: every route in this area, what it takes and how to call it.
List customers
GET /api/v1/customers
Query parameters
| Name |
Type |
Required |
Notes |
q |
any |
no |
|
Example
curl -X GET "https://malapos.com/api/v1/customers" \
-H "Authorization: Bearer sk_live_…"
Create a customer
POST /api/v1/customers
Body
| Field |
Type |
Required |
Notes |
name |
string |
yes |
min length 1; max length 120 |
phone |
string |
no |
max length 40; may be null |
email |
string (email) |
no |
max length 200; may be null |
note |
string |
no |
max length 500; may be null |
Example
curl -X POST "https://malapos.com/api/v1/customers" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{"name":"…","phone":"…","email":"…","note":"…"}'
Delete a customer
DELETE /api/v1/customers/{id}
Path parameters
| Name |
Type |
Required |
Notes |
id |
string |
yes |
|
Example
curl -X DELETE "https://malapos.com/api/v1/customers/:id" \
-H "Authorization: Bearer sk_live_…"
Get a customer
GET /api/v1/customers/{id}
Path parameters
| Name |
Type |
Required |
Notes |
id |
string |
yes |
|
Example
curl -X GET "https://malapos.com/api/v1/customers/:id" \
-H "Authorization: Bearer sk_live_…"
Update a customer
PATCH /api/v1/customers/{id}
Path parameters
| Name |
Type |
Required |
Notes |
id |
string |
yes |
|
Body
| Field |
Type |
Required |
Notes |
name |
string |
no |
min length 1; max length 120 |
phone |
string |
no |
max length 40; may be null |
email |
string (email) |
no |
max length 200; may be null |
note |
string |
no |
max length 500; may be null |
Example
curl -X PATCH "https://malapos.com/api/v1/customers/:id" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{"name":"…","phone":"…","email":"…","note":"…"}'
List loyalty
GET /api/v1/customers/{id}/loyalty
Path parameters
| Name |
Type |
Required |
Notes |
id |
string |
yes |
|
Example
curl -X GET "https://malapos.com/api/v1/customers/:id/loyalty" \
-H "Authorization: Bearer sk_live_…"
Create an adjust
POST /api/v1/customers/{id}/loyalty/adjust
Path parameters
| Name |
Type |
Required |
Notes |
id |
string |
yes |
|
Body
| Field |
Type |
Required |
Notes |
points |
integer |
yes |
|
reason |
string |
no |
max length 200 |
Example
curl -X POST "https://malapos.com/api/v1/customers/:id/loyalty/adjust" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{"points":1,"reason":"…"}'
Create a redeem
POST /api/v1/customers/{id}/loyalty/redeem
Path parameters
| Name |
Type |
Required |
Notes |
id |
string |
yes |
|
Body
| Field |
Type |
Required |
Notes |
points |
integer |
yes |
above 0 |
Example
curl -X POST "https://malapos.com/api/v1/customers/:id/loyalty/redeem" \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{"points":1}'