Headless Checkout API - Errors
This page describes the errors you might encounter when using the Headless Checkout API.
General
General information about the API can be found in the Headless Checkout - Backend Integration Guide.
Observability
All Ingrid responses will containt a grpc-metadata-trace_id
header. In case of any problems or question, providing this value to us will allow us to go back to you with more accurate feedback.
< HTTP/2 200
< content-type: application/json
< grpc-metadata-trace_id: 01JVRVS4Q5GFFZASB681S244ZF
<
{...}
Errors
In case of any errors, Ingrid will return a 4xx or 5xx HTTP status code. The response body will contain a JSON object with the following structure:
{
"code": 16,
"message": "unauthenticated"
}
Timeout
We recommend setting the timeout as follows:
- 7 seconds for the
CreateSession
andUpdateSession
endpoints (as carrier calls are made in the background) - 3 seconds for the
CompleteSession
andGetSession
endpoints
Errors
This section describes in detail the errors you might encounter when using the Headless Checkout API.
Unauthenticated
The request is unauthenticated. This means that the API token is missing or invalid.
{
"code": 16,
"message": "unauthenticated"
}
Validation
The request is invalid. This means that the request body is missing a field or the value is invalid. Check the request body and the error message for more details.
{
"code": 3,
"message": "validation error:\n - session.purchase.country_code: value does not match regex pattern `^[A-Z]{2}$` [string.pattern]",
"details": [
{
"@type": "type.googleapis.com/buf.validate.Violations",
"violations": [
{
"field": {
"elements": [
{
"field_number": 1,
"field_name": "session",
"field_type": "TYPE_MESSAGE"
},
{
"field_number": 3,
"field_name": "purchase",
"field_type": "TYPE_MESSAGE"
},
{
"field_number": 1,
"field_name": "country_code",
"field_type": "TYPE_STRING"
}
]
},
"rule": {
"elements": [
{
"field_number": 14,
"field_name": "string",
"field_type": "TYPE_MESSAGE"
},
{
"field_number": 6,
"field_name": "pattern",
"field_type": "TYPE_STRING"
}
]
},
"constraint_id": "string.pattern",
"message": "value does not match regex pattern `^[A-Z]{2}$`"
}
]
}
]
}
Country not configured in Ingrid
This is a configuration issue. It means that the country is not configured in Ingrid and the retailer needs to configure delivery options for that country in the Ingrid dashboard (https://mad.ingrid.com/).
{
"code": 3,
"message": "no regions available for given purchase country"
}
Session has no delivery options in Ingrid
This means that the delivery offering for given session finds no available delivery options. Retailer configuration needs to improved in the Ingrid dashboard (https://mad.ingrid.com/) for this specific case.
{
"code": 3,
"message": "failed to get any shipping parameters",
"details": [
{
"@type": "type.googleapis.com/ingrid.service.cos.SessionValidationError",
"cause": "NO_SHIPPING_OPTIONS"
},
{
"@type": "type.googleapis.com/ingrid.common.details.PublicMessage",
"payload": {
"@type": "type.googleapis.com/ingrid.common.details.PublicError",
"msg": "failed to get any shipping parameters",
"cause": "COS_NO_SHIPPING_OPTIONS_FOUND",
"cause_text": "COS_NO_SHIPPING_OPTIONS_FOUND"
}
}
]
}