Spot APIs use standard HTTP status codes to indicate request outcomes:
- 2xx: Success
- 4xx: Client error
- 5xx: Server error
Failed requests typically include a short error code and an error_description with additional details. For example, a 401 error when exchanging a client ID and secret for a Bearer Token looks like:
{
"error": "access_denied",
"error_description": "Unauthorized"
}Other errors, such as the 429 error, may have a slightly different shape:
{
"statusCode": 429,
"message": "Too Many Requests"
}Status Codes
| Code | Name | Reason |
|---|---|---|
| 200 | Success | The request worked as expected. Examples of 200 responses include exchanging OAuth client id and secret for a bearer token, fetching an enrollment, and cancelling an enrollment. |
| 202 | Accepted | The request has been accepted by Spot. While there may be some additional, asynchronous processing to be performed by Spot, the initial request has been accepted. |
| 400 | Bad Request | The request, as submitted was improper. This may be due to information missing in the request fields, malformed data within the request fields, etc. |
| 401 | Unauthorized | The given security credentials are not valid. |
| 403 | Forbidden | Your security credentials are valid, but lack sufficient privileges to interact with the API. |
| 404 | Not Found | The enrollment was not found for the given id and/or authorized partner |
| 429 | Too Many Requests | The allowed rate limit for the given partner has been exceeded. Examine the Retry-After header in the response for the number of seconds that must elapse before requests can be accepted again. |
Bad Request Codes
When responding with the HTTP 400 Bad Request status, Spot will include an object named spotErrors, which contains a list of errors. Each error will include an error code, a short description, and a detailed reason. For example, if a request was sent with several invalid values inside of the purchaser field, the response body might contain the following shape:
{
"message": "Bad Request",
"statusCode": 400,
"spotErrors": [
{
"code": 2000,
"description": "invalid string",
"reason": "purchaser.firstName 2345 must be a non-empty string"
},
{
"code": 2002,
"description": "invalid ISO date format",
"reason": "purchaser.dateOfBirth 07/13/2005 must be specified in YYYY-MM-DD format"
},
{
"code": 2001,
"description": "invalid email format",
"reason": "purchaser.email foo@example must be a valid email address"
}
]
}The goal is to provide a set of unique error codes which are indicative of validation failures. The codes are static values, as published below. This allows a partner to interact with our API, and not have to perform string matching (and possibly further reasoning) in order to interpret why a request has failed.
The codes attempt to loosely follow a similar pattern to HTTP status codes (200-299 indicating success, 300-399 indicating redirection, etc.). Specifically, the Spot error ranges are 4 digit codes where:
- 1XXX is indicative of bad HTTP headers, shapes, or other business rules violations
- 2XXX is indicative of invalid formatting for fields within the request
- 9XXX is indicative of an error that Spot does not yet know how to interpret
| Code | Description | Reason |
|---|---|---|
| 1000 | missing idempotency key | The Idempotency-Key request header is missing. |
| 1001 | invalid request body | The top-level fields within the request body are named in such a way such that the request body does not match any known coverage type. |
| 1002 | wrong coverage type | The request body has a valid shape, but is meant for a different endpoint. For example, you may be attempting to submit an injury request payload to the refund endpoint. |
| 1003 | inactive offer | The offer has not been configured by Spot to be in the enrolling status. This is either due to the fact that the offer is not yet ready to accept enrollments, or there is a configuration error. If this is unexpected, please contact spot for assistance. |
| 1004 | offer unavailable | The specified offerSku is valid but may not be enrolled for the given X-Spot-Partner-Id. Alternatively, this enrollment may be for a different coverage type. |
| 1005 | offer not found | The specified offerSku cannot be located by Spot. |
| 1006 | offer missing date ranges | The specified offerSku is missing a valid date range. Contact Spot for assistance. |
| 1007 | start date after end date | The start date specified in your request is after the end date. The two date values are likely reversed. |
| 1008 | purchase date before offer begins | The purchase timestamp is prior to the offer's enrollment date range. If this is unexpected, please contact Spot for assistance. |
| 1009 | purchase date after offer ends | The purchase timestamp is after the offer's enrollment date range. If this is unexpected, please contact Spot for assistance. |
| 1010 | start date before offer begins | The start date specified in your request is prior to the offer's enrollment date range. If this is unexpected, please contact Spot for assistance. |
| 1011 | purchase date after end date | The purchase timestamp is after the end date specified in your request. |
| 1012 | invalid event multiplier | Injury offers configured with a duration type of "event" must specify a multiplier exactly equal to 1. |
| 1013 | cancellation timestamp after product start date | A cancellation cannot occur after the start date of coverage. |
| 1014 | cancellation window expired | Trip (or refund) coverage may not be cancelled after 10 days from the purchase date, even if the start date of coverage is still in the future. CFAR claims (request for a refund) must be received prior to the maximum cutoff time (generally 24 hours prior to the event start time). |
| 1015 | too many insureds | Trip coverage can accept a maximum of 10 insureds. |
| 1016 | invalid trip price change | The price of trip coverage cannot be updated to a value less than the current spotPrice after 10 days from the initial purchase date, or if the trip start date has already started. |
| 1017 | untimely delivery of resolve CFAR request | CFAR claims (request for a refund) must be made by the customer prior to the maximum cutoff time (generally 24 hours prior to the event start time). For partners that process their own customer refunds, the notification about that refund must be delivered to Spot shortly after the 24 hour cutoff applied to the end customer. |
| 1018 | mismatched CFAR payout currency | CFAR claims must be redeemed in the same currency as the original purchase. |
| 1019 | CFAR policy already resolved | CFAR claims cannot be resolved more than once. |
| 1020 | CFAR invalid payout amount | CFAR claims must be resolved at an equal or lower value to the max benefit. |
| 1021 | certificate not found | A certificate could not be found for the provided enrollmentId. |
| 1022 | CFAR event time after utilization window | An event time after the utilization window would result in no payout. Ex. Creating an enrollment 23 hours before the event when the user can cancel up until 24 hours before the event. |
| 1023 | mismatched price update currency | Currency for price updates must match the currency from the original purchase. |
| 1024 | CFAR price update must include all prices | If you pass newEventPrice or newSpotCost then you must pass both for CFAR price updates. |
| 1025 | Trip price update must include all prices | If you pass newEventPrice or newSpotCost then you must pass both for Trip price updates. |
| 1026 | ineligible trip price | The price of a trip must be strictly greater than $100 USD. Trips costing $100 or less are not eligible for insurance coverage. |
| 1027 | cancellation after end date | The cancellation timestamp is invalid as it represents a point in time that is after the end date of the coverage. |
| 1028 | cancellation before purchase date | The cancellation timestamp is invalid as it represents a point in time that is prior to the purchase date of the coverage. |
| 1029 | ineligible CFAR date change | Seasonal CFAR offers do not support date changes (only prices changes may be applied). |
| 1030 | CFAR resolve policy request invalid for interruption | The resolve CFAR endpoint does not support being called for CFAR coverage which contain interruption benefits. |
| 1031 | invalid currency for offer | The specified currencyCode is not supported by the offer. |
| 1032 | event price exceeds the maximum event price | The specified eventPrice (after converting it to USD if necessary) exceeds the maximum allowable event price. |
| 1033 | start date before current time | The startDate for a quote must be in the future |
| 1034 | dates must fall within the insurance start and end date for this offer | The dates for an enrollment must fall within the offer sell dates |
| 1035 | quote not found | A quote could not be found matching the id |
| 1036 | quote is in invalid status for acceptance | This quote can not be accepted from the status it is currently in. |
| 1037 | quote is in invalid status to be declined | This quote can not be declined from the status it is currently in. |
| 1038 | quote request productPrice does not match quote accept productPrice | The quote request's productPrice doesn't match the quote accept productPrice |
| 1039 | insured date of birth is invalid | An insured's date of birth in the request is invalid |
| 1040 | country code is not supported for offer | The country code provided for the insured or purchaser is not supported for this offer, this is typically due to a policy restriction prohibiting the sale of coverage to non-us residents. |
| 1041 | maximum coverage duration exceeded | |
| 1042 | end date before current date | The end date is before the current date |
| 1043 | enrollment is in invalid status to be requoted | |
| 1044 | invalid date(s) for requote | |
| 1045 | requote is in invalid status to be accepted | |
| 1046 | batch quotes must use offers with matching coverage details and payout schedules | |
| 1047 | unsupported currency code | The provided currency code is not supported |
| 1500 | bulk import certificate not found | An update or a cancel operation was specified in a row of the bulk import file, but the given combination of transactionItemId and offerSku cannot identify an existing certificate of coverage. |
| 2000 | invalid string | A field in the payload should be typed as a string, but is not. |
| 2001 | invalid email format | A field in the payload should contain a valid email address, but does not. |
| 2002 | invalid ISO date format | A field contains a date (not a date-time) specified in something other than YYYY-MM-DD format. |
| 2003 | invalid postal code | The postal code is invalid for the specified country code. |
| 2004 | invalid state/province abbreviation | The stateOrProvince field contains an invalid value. States/provinces must be abbreviated (for example, TX instead of Texas). |
| 2005 | invalid country code | The country field contains an invalid value, which is not properly formatted according to ISO 3166-1 alpha-2. |
| 2007 | invalid ISO8601 datetime | A date-time field contains a value that is not properly formatted according to ISO 8601. |
| 2008 | invalid price | Prices must be numeric values, greater than zero with no more than 2 decimal places. In other words, the provided number, when multiplied by 100, should be a valid ISO 4217:2015 integer value, indicating an amount in cents. |
| 2009 | invalid date format | A date field contains a value which does not appear to be a valid date, nor is it a valid date-time. |
| 2010 | invalid object structure | When specifying metadata, the given value must be an object where all values are of string, number, or boolean. |
| 2011 | invalid array | A field in the payload was expected to contain an array of values, but the given value is not an array. |
| 2012 | empty array | A field in the payload must be a non-empty array, such as the insureds array for trip enrollments. |
| 2013 | invalid positive number | A field in the payload contains a value that is either not a number, or is a number yet is not a positive value. |
| 2014 | invalid UUID | A field in the payload was expected to contain a valid UUID, but does not. |
| 2015 | invalid date range | A request to update coverage fails to specify a new start date, a new end date, or both. |
| 2016 | invalid DTO instance | A nested object within the payload does not conform to the correct shape. |
| 2017 | invalid enum | A field contains an invalid value for the specified enum. |
| 2018 | invalid boolean | A field in the payload was expected to be a boolean, but is not. |
| 9999 | Unknown error | This error is not one that is currently cataloged by Spot. This may occur for several reasons, but the recommendation is to reach out to Spot so that we may determine what happened. In the future, Spot can then create a unique error code for the given situation and return a more meaningful code than 9999. |
