Introduction

Customers API

Overview

Organisation-scoped customer records. Other services store this id only — vehicles, jobs, bookings, and invoices stay in their own APIs.

Integration guide: Customers service docs

OpenAPI v0.1.0 · source openapi/customers.json

OpenAPI 3.0.0 · v0.1.0 · 8 operations

Operations

System

Liveness and generated documentation.

get/health

Health check

Example request

curl -sS \
  -X GET \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <jwt>" \
  "https://api.mayawealth.co.uk/customers/health"

Operation ID: getHealth

Responses

  • 200

    Service is running

    application/json

get/v1/health

Health check (versioned)

Example request

curl -sS \
  -X GET \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <jwt>" \
  "https://api.mayawealth.co.uk/customers/v1/health"

Operation ID: getHealthV1

Responses

  • 200

    Service is running

    application/json

Customers

Customer records for any site.

get/v1/customers

List customers

Example request

curl -sS \
  -X GET \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <jwt>" \
  "https://api.mayawealth.co.uk/customers/v1/customers"

Summary rows without `details`; use GET `/v1/customers/{id}` for full metadata.

Operation ID: listCustomers

Parameters

NameInTypeDescription
pagequeryinteger—
page_sizequeryinteger—
qquerystring—

Responses

  • 200

    Customers

    application/json

  • 401

    Missing or invalid JWT.

    application/json

  • 403

    Authenticated but not permitted.

    application/json

  • 422

    Validation failed.

    application/json

  • 429

    Rate limit exceeded.

    application/json

  • 500

    Unexpected server error.

    application/json

post/v1/customers

Create customer

Example request

curl -sS \
  -X POST \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <jwt>" \
  -H "Content-Type: application/json" \
  "https://api.mayawealth.co.uk/customers/v1/customers"

Required: `first_name`, `last_name`, `primary_phone`, and `email`. Optional company, address, notes, and `details.subject_refs` (`service` gateway slug + `subject_id` UUID) go in `details`.

Operation ID: createCustomer

Request body(required)

  • application/jsonCustomerCreate

Responses

  • 201

    Customer created

    application/json

  • 400

    Malformed request.

    application/json

  • 401

    Missing or invalid JWT.

    application/json

  • 403

    Authenticated but not permitted.

    application/json

  • 404

    The requested resource was not found.

    application/json

  • 409

    Conflict — version mismatch, idempotency conflict, or invalid state transition.

    application/json

  • 422

    Validation failed.

    application/json

  • 429

    Rate limit exceeded.

    application/json

  • 500

    Unexpected server error.

    application/json

get/v1/customers/{id}

Get customer

Example request

curl -sS \
  -X GET \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <jwt>" \
  "https://api.mayawealth.co.uk/customers/v1/customers/example-id"

Operation ID: getCustomer

Parameters

NameInTypeDescription
id*pathstring—

Responses

  • 200

    Customer

    application/json

  • 401

    Missing or invalid JWT.

    application/json

  • 403

    Authenticated but not permitted.

    application/json

  • 404

    The requested resource was not found.

    application/json

  • 422

    Validation failed.

    application/json

  • 429

    Rate limit exceeded.

    application/json

  • 500

    Unexpected server error.

    application/json

patch/v1/customers/{id}

Update customer

Example request

curl -sS \
  -X PATCH \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <jwt>" \
  -H "Content-Type: application/json" \
  "https://api.mayawealth.co.uk/customers/v1/customers/example-id"

Operation ID: updateCustomer

Parameters

NameInTypeDescription
id*pathstring—

Request body(required)

  • application/jsonCustomerPatch

Responses

  • 200

    Customer updated

    application/json

  • 400

    Malformed request.

    application/json

  • 401

    Missing or invalid JWT.

    application/json

  • 403

    Authenticated but not permitted.

    application/json

  • 404

    The requested resource was not found.

    application/json

  • 409

    Conflict — version mismatch, idempotency conflict, or invalid state transition.

    application/json

  • 422

    Validation failed.

    application/json

  • 429

    Rate limit exceeded.

    application/json

  • 500

    Unexpected server error.

    application/json

post/v1/customers/search

Search customers

Example request

curl -sS \
  -X POST \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <jwt>" \
  "https://api.mayawealth.co.uk/customers/v1/customers/search"

Operation ID: searchCustomers

Parameters

NameInTypeDescription
pagequeryinteger—
page_sizequeryinteger—
qquerystring—

Responses

  • 200

    Customers

    application/json

  • 401

    Missing or invalid JWT.

    application/json

  • 403

    Authenticated but not permitted.

    application/json

  • 422

    Validation failed.

    application/json

  • 429

    Rate limit exceeded.

    application/json

  • 500

    Unexpected server error.

    application/json

Audit

Immutable change log for this service.

get/v1/audit

Audit trail

Example request

curl -sS \
  -X GET \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <jwt>" \
  "https://api.mayawealth.co.uk/customers/v1/audit"

Events for the current JWT organisation only.

Operation ID: listAudit

Responses

  • 200

    Audit events

    application/json

  • 401

    Missing or invalid JWT.

    application/json

  • 403

    Authenticated but not permitted.

    application/json

  • 422

    Validation failed.

    application/json

  • 429

    Rate limit exceeded.

    application/json

  • 500

    Unexpected server error.

    application/json