Errors & rate limits

Every error carries a machine-readable code, and the HTTP status is always real.

The response envelope

Every response — success or failure — uses the same envelope, so you can write one unwrapping helper and reuse it everywhere.

HTTP/1.1 200 OK
{
  "success": true,
  "data": { ... },
  "meta": {
    "request_id": "req_01HX...",
    "timestamp": "2026-05-07T14:22:00Z",
    "environment": "sandbox"
  }
}
HTTP/1.1 404 Not Found
{
  "success": false,
  "error": {
    "code": "ACCOUNT_NOT_FOUND",
    "message": "No account found for this account_id.",
    "status": 404
  },
  "meta": { "request_id": "req_01HX..." }
}

The HTTP status is always the real status. A 404 is sent as an HTTP 404, a 422 as an HTTP 422. The error.status field mirrors the HTTP status for clients that only log the body — it never replaces it. Wishbone does not return 200 OK with a failure inside. Branch on res.ok, then read error.code for the specific reason.

Always log meta.request_id. It is the fastest way for us to find a specific call. The same value comes back in the X-Request-ID response header, so you have it even when a body fails to parse.

To tie our logs to yours, send your own trace ID as X-Request-ID — up to 64 letters, digits, _ or -. We use it as the request ID instead of generating one. Anything else is ignored and replaced.

Status codes

StatusMeaningWhat to do
400Malformed request — e.g. an unparseable pagination cursor.Fix the request; do not retry as-is.
401Missing, malformed, or revoked API key — or a key for the other environment.Check the header name, the key format, and that the key matches the host.
404Resource does not exist, or is not visible to you — including a school your bank is not authorized for.Verify the identifier.
409Conflict — usually a repeated bank_transaction_ref.error.details.donation_id names the gift that already exists. Treat as success.
422Well-formed JSON that fails validation.Read error.details — it names the offending field.
429Rate limited.Back off and honor Retry-After.
405That method isn't supported on this path.Check the method in the reference.
5xxServer-side failure. The body is still the standard envelope.Retry with backoff. Safe when you reuse the same bank_transaction_ref. Quote meta.request_id if it persists.

400 vs 422: 400 means we could not parse or interpret the request at all. 422 means we understood it and a field was invalid — a negative dollar_amount, a fund_designation the school does not offer, an amount under the fund minimum. Only 422 carries error.details.

Error codes

CodeStatusCause
ACCOUNT_NOT_FOUND404No active account with that id or cardholder_ref at your bank.
DONATION_DUPLICATE409A gift with this bank_transaction_ref already exists. details.donation_id names it.
CONFLICT409The action no longer applies — e.g. cancelling a gift the school already received.
LINKING_UNAVAILABLE422This school does not support cardholder account linking yet.
SCHOOL_NOT_ACTIVE404School not found, not currently accepting gifts, or not open to your bank.
FUND_INVALID422fund_designation is not recognized for this school.
AMOUNT_BELOW_MINIMUM422Below the school or fund minimum, whichever is higher.
UNAUTHORIZED401Missing, malformed or revoked key, or a key for the other environment.
NOT_FOUND404No such resource at your bank.
VALIDATION_FAILED422Request body failed schema validation. See error.details.
METHOD_NOT_ALLOWED405The method isn't supported on this path.
RATE_LIMITED429Too many requests.
SERVER_ERROR500Unhandled server-side failure.

Validation failures

A 422 names every field that failed and why. It never repeats the value you sent, so a cardholder_ref or bank_transaction_ref can't leak into a log through an error:

HTTP/1.1 422 Unprocessable Entity
{
  "success": false,
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "Validation failed. See error.details.",
    "status": 422,
    "details": [
      {
        "loc": ["body", "dollar_amount"],
        "msg": "Input should be greater than 0",
        "type": "greater_than"
      }
    ]
  },
  "meta": { "request_id": "req_01HX..." }
}

Rate limits

SurfaceLimit
Bank / Issuer API1,000 requests per minute per API key

Rate limiting is applied at the edge, ahead of the application. Treat the numbers above as the contract and always handle 429 with Retry-After. Per-response X-RateLimit-* headers are not currently emitted — do not build a client that depends on reading your remaining quota from a response.