unsupported_version
The Canopy-Version request header named a version Canopy does not serve.
HTTP 400
When this happens
The Canopy-Version header pins a request to a specific dated API version. It is the first thing withPublicApi checks, ahead of route resolution, so this error fires whether or not the path and method would otherwise be valid.
- Header absent: resolves silently to the current version. This is not an error and is the normal, recommended way to call the API.
- Header present, and it names a version Canopy serves: the request is pinned to that version.
- Header present, and it names anything else: refused with
unsupported_version. An unrecognized pin is a caller error worth surfacing loudly, so Canopy refuses rather than quietly downgrading the request to whatever version is current.
The error envelope
{
"error": {
"code": "unsupported_version",
"message": "The requested Canopy-Version is not served.",
"request_id": "req_1a2b3c4d5e6f7a8b9c0d1e2f",
"docs": "https://canopypay.io/errors/unsupported_version"
}
}What to do about it
Either omit the Canopy-Version header entirely to get the current version, or pin to a version this API serves. Every response carries a canopy-version response header naming the version that was used, this HTTP 400 included, and that header is the authoritative way to discover which version is current. Confirm a version string against it before you hardcode one.