Service objects
Errors
FlatPeak uses HTTP status codes to indicate the success or failure of requests.
This includes:
Code | Description |
---|---|
2XX | Indicates success. |
4XX | Indicates an invalid request. (error type: invalid_request ) |
5XX | indicates FlatPeak-related issues (error type: api_error ). |
Error object
When an error needs to be returned in API response, FlatPeak uses a standardised error object across all endpoints:
Property | Description |
---|---|
object | Indicates API object type, i.e. error . |
live_mode | Indicates if live or test mode API key was used. |
context | Indicates error context. It provides information on which service and method has errored. For example, connect.postal_address_capture or api.location_create . |
type | Indicates error type; possible values are invalid_request - when your request is invalid. And api_error when the FlatPeak service cannot process the request (these are rare). |
code | Connect-related error codes are listed in connect-headless guide under code sample of every page. API-related error codes are listed in the API error codes table later on this page. Example: country_code_missing . |
message | Error description in the English language. Example: Country code is required . |
connect_token | The Connect token used to make the request resulted in an error. |
time_created | Timestamp when this error has occurred. |
Account disabled error
When your account is out of subscription or is disabled for any other reason, you will receive an error 422
when trying to access any of the API endpoints.
When it happens, open Dashboard and go to Settings > Billing to restore your subscription.
Was this page helpful?