CanopyAPI docs

not_found

Either no route matches this method and path, or the referenced resource does not exist for this key's account.

HTTP 404

When this happens

Two genuinely different situations both produce this code:

  • No matching route. Straight after the Canopy-Version header, and before authentication is attempted, withPublicApi checks whether the request's method and path match anything in ROUTES. A typo'd path or the wrong HTTP verb lands here.
  • The resource does not exist for you. GET /api/v1/intents/{id} and GET /api/v1/intents/{id}/origins return this code, with the same "No such intent." message, both when the id was never created and when it belongs to a different merchant. The database query filters by your account id directly, so a cross-merchant read reads exactly like a nonexistent id and this response cannot confirm that another merchant's intent id is real.

The error envelope

json
{
  "error": {
    "code": "not_found",
    "message": "No such intent.",
    "request_id": "req_1a2b3c4d5e6f7a8b9c0d1e2f",
    "docs": "https://canopypay.io/errors/not_found"
  }
}

What to do about it

For a route-level 404, check the method and path against the reference. A trailing slash, a wrong verb, or an unversioned path missing /api/v1 all land here. For a resource-level 404, confirm the intent id was returned by a prior POST /api/v1/intents call made under the same secret key's account. An id created under a different key never becomes visible, however it was obtained. This is never retried automatically: a resource that does not exist will not start existing on a retry.