{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "Error.json",
  "title": "Error",
  "description": "Every v1 error has this body.",
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "Machine-readable. Branch on this."
    },
    "message": {
      "type": "string",
      "description": "Human-readable and safe to show to an operator."
    },
    "details": {
      "description": "Extra data for some codes, else null."
    }
  },
  "required": [
    "code",
    "message",
    "details"
  ],
  "examples": [
    {
      "code": "invalid_request",
      "message": "Add at least one invoice item",
      "details": null
    }
  ]
}
