Skip to main content

API Response Status Codes

All API responses from the Cakrahub Booking Engine follow a standard structure:

Default Response Structure

{
"StatusCode": 0,
"Message": "Success",
"Result": { /* response data or null */ }
}
  • StatusCode: Indicates the status of the API call. 0 means success; other values indicate errors.
  • Message: Human-readable message describing the result of the API call. Could be used as Toast Message.
  • Result: Contains the main result. This is an object with the response data, or null if there is no result.

Status Code Reference

CodeNameDescription
0SuccessfullyRequest was successful
1NotAuthorizedNot authorized / invalid or missing token
2InvalidDataFormatData format is invalid
3ErrorCreateTokenError occurred while creating token
4DataNotFoundRequested data not found
5InvalidDataValueData value is invalid
6DatabaseValueChangedDatabase value has changed
7DatabaseErrorDatabase error
8EmptyRequireFieldRequired field is empty
9PaymentDateCannotLowerThanIssuedDatePayment date cannot be earlier than issued date
10SuccessfullyWithStatusRequest was successful, with additional status
11DuplicateEntryDuplicate entry detected
12SubscriptionExpiredSubscription has expired
13UnregisteredNot registered
500InternalServerErrorInternal server error
999OtherResultOther/unknown result

Use these codes to interpret the result of any API call. For error handling, check the StatusCode and Message fields in the response.

Error Handling

When an error occurs, the API will return an appropriate HTTP status code along with an error message in the response body.