API Basics
Authentication
All API requests must include a Bearer token in the Authorization header.
Authorization: Bearer {api_key}
- Only HTTPS requests are accepted.
- Your API key will be provided by Mozrest during onboarding.
Errors
Mozrest uses standard HTTP response codes.
| Code | State | Description |
|---|---|---|
| 400 | Bad Request | Invalid or missing required parameters |
| 401 | Unauthorized | API key is missing or incorrect |
| 403 | Forbidden | Valid request but insufficient permissions |
| 404 | Not Found | The requested resource does not exist |
| 409 | Conflict | Request conflicts with current state (e.g. table already occupied) |
| 500 | Server Error | Unexpected server-side error |
| 503 | Unavailable | Temporary server overload or maintenance |
Error response format
{
"error": {
"code": 400,
"message": "Validation failed",
"details": {
"checks": [
{ "checkNumber": ["This value should not be blank."] }
]
}
}
}
Best practices
- Validate request payloads before submission.
- Implement retries with exponential backoff for
500and503errors. - Log and monitor all
4xxand5xxerrors.
Forward Compatibility
Mozrest may add new fields to request and response payloads at any time. These additions are not considered breaking changes.
Your integration must:
- Ignore unknown fields — do not reject or fail when receiving properties that are not in your current implementation.
- Use lenient deserialization — avoid strict schema validation that would break on new fields.
Mozrest will never make backward-incompatible changes (removing fields, changing types, or altering semantics of existing fields) without prior notice and a migration plan.
Definitions
Payment details
Payment information sent from the POS should include:
| Field | Type | Description |
|---|---|---|
totalAmount | Number | Final bill amount after tax and service charges |
tax | Number | Tax applied to the bill |
tip | Number | Gratuity added by the guest |
discount | Number | Any applied discounts |
paymentMethod | String | Payment method: card, cash, etc. |
Order and check statuses
| Status | Applies to | Meaning |
|---|---|---|
open | Order / Check | Active and in progress |
closed | Order / Check | Completed and paid |
void | Check | Cancelled / voided |