Skip to main content

Error Response Format

Every error response follows the same structure:
Always use the code field for error handling in your code, not message. The message text may be updated to be more helpful — the code will remain stable.

Error Codes

Validation Rules

Every field is validated on the server. Here are the rules for each field:

Date Format

Strict ISO 8601. No exceptions. When a date fails validation, the error message includes what you sent and what’s expected:
Turkish PMS systems (Protel, Byte, Hicell) commonly use DD.MM.YYYY format. Make sure your integration converts dates to YYYY-MM-DD before sending to RecepAI.

Phone Number Format

E.164 format required. Starts with +, followed by country code and number. No spaces, dashes, or parentheses.

Common Mistakes

This is the most common error for Turkish PMS integrations. Protel, Byte, and Hicell all default to DD.MM.YYYY internally.Fix: Convert all dates to YYYY-MM-DD before sending. For example, 18.02.20262026-02-18.
Sending 05551234567 instead of +905551234567. The phone field requires the full international number with country code.Fix: Prepend the country code with +. For Turkey, that’s +90. For Germany, +49. For the UK, +44.
Sending {"roomNumber": 301} instead of {"roomNumber": "301"}. Room numbers are strings because they can contain letters (e.g., "301A", "P2-105").Fix: Always send room numbers as strings: "301", not 301.
All POST endpoints require an Idempotency-Key header. Without it, you’ll receive a 400 error.Fix: Include Idempotency-Key: your_unique_key in every POST request. See Idempotency for key format recommendations.
Each unique operation needs its own key. If you use the same key for two different guests, the second request will return the first guest’s cached response.Fix: Use a key format like {operation}_{pmsGuestId}_{date}. Example: checkin_RES2026001_20260218.
If Room 301 still has an active guest and you try to check in a new guest to Room 301, you’ll get a 409 ROOM_OCCUPIED error.Fix: Always send a checkout for the departing guest before checking in the new guest. Or use the Full Sync endpoint which handles this automatically.

Handling Errors in Your Code

Here’s a recommended error handling pattern:
Retry guidance:
  • 4xx errors (except 429): Fix your request before retrying. Retrying the same payload will return the same error.
  • 429 errors: Wait for the retryAfter period, then retry.
  • 5xx errors: Retry with exponential backoff (1s, 2s, 4s, 8s). Include the requestId if contacting support.