Skip to content

Customers API ​

Use the Customers API to create and manage customer records in a Cedius workspace.

Portfolio note: This is an illustrative API specification created for a technical-writing portfolio. The examples do not call a live production service.

Base path ​

text
/customers

All requests require:

http
Authorization: Bearer YOUR_API_KEY

Customer object ​

FieldTypeDescription
idstringUnique customer ID with the cus_ prefix.
namestringCustomer or business name.
emailstring | nullEmail address.
phonestring | nullPhone number.
companystring | nullCompany name.
addressstring | nullCustomer address.
statusstringactive or inactive.
notesstring | nullInternal notes.
created_atstringISO 8601 creation timestamp.
updated_atstringISO 8601 last-update timestamp.
json
{
  "id": "cus_4d7c21",
  "name": "Adewale Johnson",
  "email": "adewale@example.com",
  "phone": "+2348012345678",
  "company": "Johnson Ventures",
  "address": "12 Allen Avenue, Ikeja, Lagos",
  "status": "active",
  "notes": "Prefers bank transfer.",
  "created_at": "2026-09-09T11:12:40Z",
  "updated_at": "2026-09-09T11:12:40Z"
}

List customers ​

http
GET /customers

Returns customers in the authenticated workspace.

Query parameters ​

ParameterTypeRequiredDescription
pageintegerNoPage number. Default: 1.
limitintegerNoRecords per page. Default: 20; maximum: 100.
statusstringNoFilter by active or inactive.
searchstringNoSearch by name, email, or company.
sortstringNoSort field, such as created_at.
orderstringNoasc or desc.

Example request ​

bash
curl "https://api.cedius.app/v1/customers?status=active&page=1&limit=20" \
  -H "Authorization: Bearer cedius_test_sk_example"

Example response ​

200 OK

json
{
  "data": [
    {
      "id": "cus_4d7c21",
      "name": "Adewale Johnson",
      "email": "adewale@example.com",
      "phone": "+2348012345678",
      "company": "Johnson Ventures",
      "address": "12 Allen Avenue, Ikeja, Lagos",
      "status": "active",
      "notes": "Prefers bank transfer.",
      "created_at": "2026-09-09T11:12:40Z",
      "updated_at": "2026-09-09T11:12:40Z"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 86,
    "total_pages": 5
  }
}

Create a customer ​

http
POST /customers

Creates a customer in the authenticated workspace.

Request body ​

FieldTypeRequiredDescription
namestringYesName; 1–120 characters.
emailstringNoValid email address.
phonestringNoMaximum 30 characters.
companystringNoCompany name.
addressstringNoCustomer address.
notesstringNoInternal notes.

New customers are created with status: active.

Example request ​

bash
curl -X POST https://api.cedius.app/v1/customers \
  -H "Authorization: Bearer cedius_test_sk_example" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Adewale Johnson",
    "email": "adewale@example.com",
    "phone": "+2348012345678",
    "company": "Johnson Ventures"
  }'

Example response ​

201 Created

json
{
  "data": {
    "id": "cus_4d7c21",
    "name": "Adewale Johnson",
    "email": "adewale@example.com",
    "phone": "+2348012345678",
    "company": "Johnson Ventures",
    "address": null,
    "status": "active",
    "notes": null,
    "created_at": "2026-09-09T11:12:40Z",
    "updated_at": "2026-09-09T11:12:40Z"
  }
}

Validation error ​

422 Unprocessable Entity

json
{
  "error": {
    "code": "validation_error",
    "message": "One or more fields are invalid.",
    "details": [
      {
        "field": "email",
        "message": "Enter a valid email address."
      }
    ],
    "request_id": "req_71fa2c"
  }
}

Retrieve a customer ​

http
GET /customers/{customer_id}

Path parameter ​

ParameterTypeRequiredDescription
customer_idstringYesCustomer ID beginning with cus_.

Example request ​

bash
curl https://api.cedius.app/v1/customers/cus_4d7c21 \
  -H "Authorization: Bearer cedius_test_sk_example"

Example response ​

200 OK

json
{
  "data": {
    "id": "cus_4d7c21",
    "name": "Adewale Johnson",
    "email": "adewale@example.com",
    "phone": "+2348012345678",
    "company": "Johnson Ventures",
    "address": "12 Allen Avenue, Ikeja, Lagos",
    "status": "active",
    "notes": "Prefers bank transfer.",
    "created_at": "2026-09-09T11:12:40Z",
    "updated_at": "2026-09-09T11:12:40Z"
  }
}

If the customer does not exist, return 404 Not Found with resource_not_found.


Update a customer ​

http
PATCH /customers/{customer_id}

Editable fields are name, email, phone, company, address, status, and notes. Omitted fields remain unchanged.

Example request ​

bash
curl -X PATCH https://api.cedius.app/v1/customers/cus_4d7c21 \
  -H "Authorization: Bearer cedius_test_sk_example" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "+2348098765432",
    "notes": "Updated contact number."
  }'

Example response ​

200 OK

json
{
  "data": {
    "id": "cus_4d7c21",
    "name": "Adewale Johnson",
    "email": "adewale@example.com",
    "phone": "+2348098765432",
    "company": "Johnson Ventures",
    "address": "12 Allen Avenue, Ikeja, Lagos",
    "status": "active",
    "notes": "Updated contact number.",
    "created_at": "2026-09-09T11:12:40Z",
    "updated_at": "2026-09-09T15:42:10Z"
  }
}

Delete a customer ​

http
DELETE /customers/{customer_id}

Deletes a customer only when no blocking financial records are associated with that customer. Customers with invoice or payment history should normally be marked inactive instead.

Example request ​

bash
curl -X DELETE https://api.cedius.app/v1/customers/cus_4d7c21 \
  -H "Authorization: Bearer cedius_test_sk_example"

Successful response ​

204 No Content

A successful deletion returns no response body.

If financial records block deletion, return 409 Conflict:

json
{
  "error": {
    "code": "conflict",
    "message": "This customer cannot be deleted because financial records are associated with the customer. Mark the customer as inactive instead.",
    "request_id": "req_b184c2"
  }
}

Common errors ​

StatusCodeMeaning
401authentication_failedAPI key is missing or invalid.
403permission_deniedThe authenticated identity cannot perform the action.
404resource_not_foundCustomer does not exist.
409conflictOperation conflicts with the customer's current state.
422validation_errorOne or more submitted values are invalid.
429rate_limit_exceededRequest limit has been exceeded.

Validation rules ​

FieldRule
nameRequired on creation; 1–120 characters.
emailMust be a valid email when provided.
phoneMaximum 30 characters when provided.
statusMust be active or inactive.

Cedius is an illustrative API documentation portfolio project.