Errors & Status Codes

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

CodeNameReason
200SuccessThe 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.
202AcceptedThe 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.
400Bad RequestThe request, as submitted was improper. This may be due to information missing in the request fields, malformed data within the request fields, etc.
401UnauthorizedThe given security credentials are not valid.
403ForbiddenYour security credentials are valid, but lack sufficient privileges to interact with the API.
404Not FoundThe enrollment was not found for the given id and/or authorized partner
429Too Many RequestsThe 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

CodeDescriptionReason
1000missing idempotency keyThe Idempotency-Key request header is missing.
1001invalid request bodyThe 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.
1002wrong coverage typeThe 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.
1003inactive offerThe 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.
1004offer unavailableThe 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.
1005offer not foundThe specified offerSku cannot be located by Spot.
1006offer missing date rangesThe specified offerSku is missing a valid date range. Contact Spot for assistance.
1007start date after end dateThe start date specified in your request is after the end date. The two date values are likely reversed.
1008purchase date before offer beginsThe purchase timestamp is prior to the offer's enrollment date range. If this is unexpected, please contact Spot for assistance.
1009purchase date after offer endsThe purchase timestamp is after the offer's enrollment date range. If this is unexpected, please contact Spot for assistance.
1010start date before offer beginsThe start date specified in your request is prior to the offer's enrollment date range. If this is unexpected, please contact Spot for assistance.
1011purchase date after end dateThe purchase timestamp is after the end date specified in your request.
1012invalid event multiplierInjury offers configured with a duration type of "event" must specify a multiplier exactly equal to 1.
1013cancellation timestamp after product start dateA cancellation cannot occur after the start date of coverage.
1014cancellation window expiredTrip (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).
1015too many insuredsTrip coverage can accept a maximum of 10 insureds.
1016invalid trip price changeThe 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.
1017untimely delivery of resolve CFAR requestCFAR 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.
1018mismatched CFAR payout currencyCFAR claims must be redeemed in the same currency as the original purchase.
1019CFAR policy already resolvedCFAR claims cannot be resolved more than once.
1020CFAR invalid payout amountCFAR claims must be resolved at an equal or lower value to the max benefit.
1021certificate not foundA certificate could not be found for the provided enrollmentId.
1022CFAR event time after utilization windowAn 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.
1023mismatched price update currencyCurrency for price updates must match the currency from the original purchase.
1024CFAR price update must include all pricesIf you pass newEventPrice or newSpotCost then you must pass both for CFAR price updates.
1025Trip price update must include all pricesIf you pass newEventPrice or newSpotCost then you must pass both for Trip price updates.
1026ineligible trip priceThe price of a trip must be strictly greater than $100 USD. Trips costing $100 or less are not eligible for insurance coverage.
1027cancellation after end dateThe cancellation timestamp is invalid as it represents a point in time that is after the end date of the coverage.
1028cancellation before purchase dateThe cancellation timestamp is invalid as it represents a point in time that is prior to the purchase date of the coverage.
1029ineligible CFAR date changeSeasonal CFAR offers do not support date changes (only prices changes may be applied).
1030CFAR resolve policy request invalid for interruptionThe resolve CFAR endpoint does not support being called for CFAR coverage which contain interruption benefits.
1031invalid currency for offerThe specified currencyCode is not supported by the offer.
1032event price exceeds the maximum event priceThe specified eventPrice (after converting it to USD if necessary) exceeds the maximum allowable event price.
1033start date before current timeThe startDate for a quote must be in the future
1034dates must fall within the insurance start and end date for this offerThe dates for an enrollment must fall within the offer sell dates
1035quote not foundA quote could not be found matching the id
1036quote is in invalid status for acceptanceThis quote can not be accepted from the status it is currently in.
1037quote is in invalid status to be declinedThis quote can not be declined from the status it is currently in.
1038quote request productPrice does not match quote accept productPriceThe quote request's productPrice doesn't match the quote accept productPrice
1039insured date of birth is invalidAn insured's date of birth in the request is invalid
1040country code is not supported for offerThe 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.
1041maximum coverage duration exceeded
1042end date before current dateThe end date is before the current date
1043enrollment is in invalid status to be requoted
1044invalid date(s) for requote
1045requote is in invalid status to be accepted
1046batch quotes must use offers with matching coverage details and payout schedules
1047unsupported currency codeThe provided currency code is not supported
1500bulk import certificate not foundAn 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.
2000invalid stringA field in the payload should be typed as a string, but is not.
2001invalid email formatA field in the payload should contain a valid email address, but does not.
2002invalid ISO date formatA field contains a date (not a date-time) specified in something other than YYYY-MM-DD format.
2003invalid postal codeThe postal code is invalid for the specified country code.
2004invalid state/province abbreviationThe stateOrProvince field contains an invalid value. States/provinces must be abbreviated (for example, TX instead of Texas).
2005invalid country codeThe country field contains an invalid value, which is not properly formatted according to ISO 3166-1 alpha-2.
2007invalid ISO8601 datetimeA date-time field contains a value that is not properly formatted according to ISO 8601.
2008invalid pricePrices 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.
2009invalid date formatA date field contains a value which does not appear to be a valid date, nor is it a valid date-time.
2010invalid object structureWhen specifying metadata, the given value must be an object where all values are of string, number, or boolean.
2011invalid arrayA field in the payload was expected to contain an array of values, but the given value is not an array.
2012empty arrayA field in the payload must be a non-empty array, such as the insureds array for trip enrollments.
2013invalid positive numberA field in the payload contains a value that is either not a number, or is a number yet is not a positive value.
2014invalid UUIDA field in the payload was expected to contain a valid UUID, but does not.
2015invalid date rangeA request to update coverage fails to specify a new start date, a new end date, or both.
2016invalid DTO instanceA nested object within the payload does not conform to the correct shape.
2017invalid enumA field contains an invalid value for the specified enum.
2018invalid booleanA field in the payload was expected to be a boolean, but is not.
9999Unknown errorThis 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.