所有错误均遵循 RFC 7807。响应体类型为 application/problem+json,字段包括 type、title、status、detail、request_id,以及可选的 reason 或 errors[]。
{
"type": "https://www.kernelhost.com/en/reseller-api/errors/payment_required",
"title": "Payment required",
"status": 402,
"detail": "The order could not be paid.",
"request_id": "01HX7Z3K8Q...",
"reason": "insufficient_credit_and_no_card"
}
| HTTP | type | 含义 |
|---|---|---|
| 400 | validation_failed | 输入校验失败。具体字段错误请参见 errors[]。 |
| 401 | auth_failed | 身份验证失败。reason 字段说明具体原因:missing_headers、bad_key、bad_timestamp、timestamp_out_of_window、bad_nonce、bad_signature、signature_mismatch、replay_detected、unknown_or_locked_key、ip_not_allowed。 |
| 402 | payment_required | 需要付款。具体 reason 请参见下文。 |
| 403 | forbidden_scope | 权限缺失。reason:missing_scope。 |
| 404 | not_found | 资源不存在或对该密钥不可见(防止租户枚举)。 |
| 409 | idempotency_conflict | Idempotency-Key 已被使用且请求体不同。 |
| 429 | rate_limited | 超出速率限制。请遵循 Retry-After 响应头。 |
| 500 | internal_error | 内部服务器错误。联系技术支持时请提供 request_id 以便与审计日志关联。 |
Payment Required 原因(HTTP 402)
当订单无法完成付款时,API 返回 HTTP 402,并在 JSON 响应体中提供机器可读的 reason 字段。
insufficient_credit_and_no_card(余额不足且未绑定信用卡。解决方法:充值余额或在客户门户中添加信用卡。)card_declined(信用卡被银行或支付网关拒绝。解决方法:尝试其他信用卡或联系您的银行。)card_expired(信用卡已过期。解决方法:在客户门户中添加新的信用卡。)client_not_found(未找到账户 ID(实际几乎不会发生,请联系技术支持)。)

