{
  "$comment": "SACP error code registry. Machine-readable copy of the table at https://agentictradestandard.org/api/#error-registry. Version 1.3.0-draft.",
  "version": "1.3.0-draft",
  "media_type": "application/problem+json",
  "codes": [
    {
      "code": "invalid_request",
      "status": 400,
      "title": "Invalid request",
      "type": "https://agentictradestandard.org/api/#err-invalid_request",
      "retryable": false,
      "description": "The request is malformed: bad JSON, a missing header or a value of the wrong type that is not covered by a more specific code.",
      "since": "1.3.0"
    },
    {
      "code": "phase_mismatch",
      "status": 400,
      "title": "Phase mismatch",
      "type": "https://agentictradestandard.org/api/#err-phase_mismatch",
      "retryable": false,
      "description": "The declared agent_phase does not fit the call. Example: shopping on POST /checkout/prepare.",
      "since": "1.2.0"
    },
    {
      "code": "phase_undeclared",
      "status": 400,
      "title": "Phase undeclared",
      "type": "https://agentictradestandard.org/api/#err-phase_undeclared",
      "retryable": false,
      "description": "The shop advertises agent.lane and the request declares no phase.",
      "since": "1.2.0"
    },
    {
      "code": "phase_conflict",
      "status": 400,
      "title": "Phase conflict",
      "type": "https://agentictradestandard.org/api/#err-phase_conflict",
      "retryable": false,
      "description": "The body and the SACP-Agent-Phase header declare different phases.",
      "since": "1.2.0"
    },
    {
      "code": "idempotency_key_missing",
      "status": 400,
      "title": "Idempotency-Key missing",
      "type": "https://agentictradestandard.org/api/#err-idempotency_key_missing",
      "retryable": false,
      "description": "The call requires an Idempotency-Key header and none was sent.",
      "since": "1.3.0"
    },
    {
      "code": "version_unsupported",
      "status": 400,
      "title": "Version unsupported",
      "type": "https://agentictradestandard.org/api/#err-version_unsupported",
      "retryable": false,
      "description": "The SACP-Version header names a version the shop does not serve. The body lists the supported versions.",
      "since": "1.3.0"
    },
    {
      "code": "signature_required",
      "status": 401,
      "title": "Signature required",
      "type": "https://agentictradestandard.org/api/#err-signature_required",
      "retryable": false,
      "description": "The call requires an HTTP Message Signature (or a client certificate) and none was sent. The response may carry Accept-Signature.",
      "since": "1.3.0"
    },
    {
      "code": "signature_invalid",
      "status": 401,
      "title": "Signature invalid",
      "type": "https://agentictradestandard.org/api/#err-signature_invalid",
      "retryable": false,
      "description": "The signature does not verify, the key is unknown, the algorithm is not allowed, or a required component is not covered.",
      "since": "1.3.0"
    },
    {
      "code": "signature_expired",
      "status": 401,
      "title": "Signature expired",
      "type": "https://agentictradestandard.org/api/#err-signature_expired",
      "retryable": true,
      "description": "The created or expires parameter is outside the allowed window. Check the clock and sign again.",
      "since": "1.3.0"
    },
    {
      "code": "replay_detected",
      "status": 401,
      "title": "Replay detected",
      "type": "https://agentictradestandard.org/api/#err-replay_detected",
      "retryable": false,
      "description": "The nonce was already used inside its window. Sign a new request with a new nonce.",
      "since": "1.3.0"
    },
    {
      "code": "authority_denied",
      "status": 403,
      "title": "Authority denied",
      "type": "https://agentictradestandard.org/api/#err-authority_denied",
      "retryable": false,
      "description": "The mandate does not cover the terms. The reasons member lists why.",
      "since": "1.1.0"
    },
    {
      "code": "autonomous_not_offered",
      "status": 403,
      "title": "Autonomous checkout not offered",
      "type": "https://agentictradestandard.org/api/#err-autonomous_not_offered",
      "retryable": false,
      "description": "checkout_mode is autonomous and the shop does not advertise checkout.autonomous.",
      "since": "1.2.0"
    },
    {
      "code": "not_found",
      "status": 404,
      "title": "Not found",
      "type": "https://agentictradestandard.org/api/#err-not_found",
      "retryable": false,
      "description": "The product, collection or checkout does not exist, or the caller may not see it.",
      "since": "1.3.0"
    },
    {
      "code": "terms_changed",
      "status": 409,
      "title": "Terms changed",
      "type": "https://agentictradestandard.org/api/#err-terms_changed",
      "retryable": false,
      "description": "A material change voided the approval. No handoff is issued and nothing is confirmed. The body carries the diff and the current terms.",
      "since": "1.1.0"
    },
    {
      "code": "idempotency_in_progress",
      "status": 409,
      "title": "Idempotency in progress",
      "type": "https://agentictradestandard.org/api/#err-idempotency_in_progress",
      "retryable": true,
      "description": "A request with the same Idempotency-Key is still running. Retry after Retry-After.",
      "since": "1.3.0"
    },
    {
      "code": "checkout_state_conflict",
      "status": 409,
      "title": "Checkout state conflict",
      "type": "https://agentictradestandard.org/api/#err-checkout_state_conflict",
      "retryable": false,
      "description": "The checkout is in a state that does not allow this call. Example: confirm on a human_handoff checkout.",
      "since": "1.3.0"
    },
    {
      "code": "checkout_expired",
      "status": 410,
      "title": "Checkout expired",
      "type": "https://agentictradestandard.org/api/#err-checkout_expired",
      "retryable": false,
      "description": "The prepared checkout passed expires_at. Prepare a new one.",
      "since": "1.3.0"
    },
    {
      "code": "precondition_failed",
      "status": 412,
      "title": "Precondition failed",
      "type": "https://agentictradestandard.org/api/#err-precondition_failed",
      "retryable": false,
      "description": "If-Match does not equal the current ETag. The checkout changed after the agent read it. Fetch it again with GET.",
      "since": "1.3.0"
    },
    {
      "code": "payload_too_large",
      "status": 413,
      "title": "Payload too large",
      "type": "https://agentictradestandard.org/api/#err-payload_too_large",
      "retryable": false,
      "description": "The body is larger than the shop accepts. The limit is 1 MiB unless the shop advertises another limit.",
      "since": "1.3.0"
    },
    {
      "code": "unsupported_media_type",
      "status": 415,
      "title": "Unsupported media type",
      "type": "https://agentictradestandard.org/api/#err-unsupported_media_type",
      "retryable": false,
      "description": "The Content-Type is not application/json.",
      "since": "1.3.0"
    },
    {
      "code": "validation_failed",
      "status": 422,
      "title": "Validation failed",
      "type": "https://agentictradestandard.org/api/#err-validation_failed",
      "retryable": false,
      "description": "The body is valid JSON but breaks the schema or a business rule. The errors member lists JSON Pointers.",
      "since": "1.3.0"
    },
    {
      "code": "idempotency_key_reuse",
      "status": 422,
      "title": "Idempotency-Key reused",
      "type": "https://agentictradestandard.org/api/#err-idempotency_key_reuse",
      "retryable": false,
      "description": "The Idempotency-Key was used before with a different request. Use a new key for a new request.",
      "since": "1.3.0"
    },
    {
      "code": "approval_required",
      "status": 428,
      "title": "Approval required",
      "type": "https://agentictradestandard.org/api/#err-approval_required",
      "retryable": false,
      "description": "The amount is above an approval threshold. A named approver must sign an approval bound to the terms hash.",
      "since": "1.1.0"
    },
    {
      "code": "precondition_required",
      "status": 428,
      "title": "Precondition required",
      "type": "https://agentictradestandard.org/api/#err-precondition_required",
      "retryable": false,
      "description": "The call requires an If-Match header and none was sent.",
      "since": "1.3.0"
    },
    {
      "code": "rate_limited",
      "status": 429,
      "title": "Rate limited",
      "type": "https://agentictradestandard.org/api/#err-rate_limited",
      "retryable": true,
      "description": "The limit for the agent phase was exceeded. Wait Retry-After seconds.",
      "since": "1.2.0"
    },
    {
      "code": "internal_error",
      "status": 500,
      "title": "Internal error",
      "type": "https://agentictradestandard.org/api/#err-internal_error",
      "retryable": true,
      "description": "The shop failed. Retry with the same Idempotency-Key.",
      "since": "1.3.0"
    },
    {
      "code": "service_unavailable",
      "status": 503,
      "title": "Service unavailable",
      "type": "https://agentictradestandard.org/api/#err-service_unavailable",
      "retryable": true,
      "description": "The shop is down or in maintenance. Retry after Retry-After.",
      "since": "1.3.0"
    }
  ]
}
