Guides
Error Handling
GG365 Golf API
Documentation for the Golf Globe 365 API - Travel Agency Integration
Error Handling
The GG365 Golf API uses standard HTTP status codes and returns error details in a consistent format.
Error Response Format
Code
All error responses include:
| Field | Description |
|---|---|
code | Machine-readable error code |
message | Human-readable error description |
details | Additional context about the error (varies by error type) |
requestId | Unique identifier for the request (useful for support) |
HTTP Status Codes
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid input parameters or request body |
| 401 | Unauthorized - Missing or invalid API key |
| 403 | Forbidden - Valid API key, but insufficient permissions |
| 404 | Not Found - Resource does not exist |
| 409 | Conflict - Resource state conflicts with request (e.g., already booked) |
| 422 | Unprocessable Entity - Request validation failed |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Something went wrong on our end |
| 503 | Service Unavailable - API is temporarily unavailable |
Common Error Codes
Authentication Errors
| Error Code | Description |
|---|---|
missing_api_key | No API key was provided in the request |
invalid_api_key | The provided API key is invalid or revoked |
expired_api_key | The API key has expired |
insufficient_permissions | The API key doesn't have permission for this action |
Validation Errors
| Error Code | Description |
|---|---|
invalid_request | General validation error for request body |
missing_required_field | A required field is missing |
invalid_field_format | A field has an invalid format |
invalid_date | Date format is incorrect or date is invalid |
invalid_player_count | Number of players is invalid for this course |
invalid_handicap | Handicap value is outside the allowed range |
Booking Errors
| Error Code | Description |
|---|---|
course_not_found | The requested course does not exist |
booking_not_found | The requested booking does not exist |
invalid_tee_time | The requested tee time is unavailable |
tee_time_expired | The hold on the tee time has expired |
course_fully_booked | No tee times available on the requested date |
booking_already_cancelled | The booking is already in cancelled state |
booking_modification_not_allowed | The booking can no longer be modified |
offline_booking_required | This course requires offline booking |
System Errors
| Error Code | Description |
|---|---|
internal_error | Internal server error |
service_unavailable | Service is temporarily unavailable |
provider_error | Error from third-party provider |
database_error | Database operation failed |
Handling Rate Limit Errors
When you exceed your rate limit, you'll receive a 429 Too Many Requests response:
Code
Best Practices for Rate Limits
- Check the
X-RateLimit-Remainingheader to monitor your usage - When you receive a 429 error, use the
retryAftervalue to wait before retrying - Implement exponential backoff for repeated rate limit errors
- Consider caching frequently accessed data to reduce API calls
Error Handling Best Practices
- Always check the status code first to determine the type of error
- Parse the error code for programmatic handling of specific errors
- Display the error message to users when appropriate
- Log the requestId for troubleshooting with support
- Implement retry logic for 429 and 5xx errors
- Validate inputs before sending requests to avoid validation errors
Example: Handling Unavailable Tee Times
When a tee time becomes unavailable during the booking process:
Code
Getting Help with Errors
If you encounter persistent errors or need help debugging an issue:
- Note the
requestIdfrom the error response - Check if the error is documented in this guide
- Contact API support at [email protected] with the requestId and details
Including the requestId in support requests helps us quickly locate the specific API call and provide faster assistance.
Last modified on