Waylo Commerce

Errors

The error body, status codes, and company error codes.

Every route returns errors in the same shape:

{
  "type": "not_allowed",
  "message": "A company must keep at least one active owner.",
  "code": "last_owner"
}
FieldMeaning
typeError type, for example invalid_data or unauthorized.
messageWhat went wrong, for a person to read. It can change, so don't match on it.
codeA stable, machine-readable reason, when the route defines one. Match on this. Schema validation failures have no code.

Status codes

StatusMeaning
400The request broke a validation or business rule.
401Missing or invalid credentials.
403Signed in, but not allowed.
404Not found, or something the caller may not see, such as another company's data.

Company error codes

Company routes return one of these in code on 400 and 403 responses. New codes may be added, so handle unknown codes as a generic failure.

CodeStatusWhen
company_not_active400The company is pending or suspended.
permission_denied403The caller's role lacks the permission the route needs.
owner_required403Only an owner can give or take the owner role, or remove an owner.
last_owner400The change would leave the company with no active owner.
self_modification400Callers can't change their own role or remove themselves.
already_in_company400The customer is already an active employee of a company.
customer_required400Signup with a registration token needs customer.
customer_not_allowed400A signed-in customer can't send customer on signup.
invalid_status_transition400The requested company status change is not allowed.

On this page