{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/xipfax-com/json-schema/xipfax-com-fax-schema.json",
  "title": "Fax",
  "description": "A fax of your log: one you sent, or one sent to your number.",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/xipfax-com-openapi.json#/components/schemas/Fax",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The fax."
    },
    "direction": {
      "type": "string",
      "enum": [
        "sent",
        "received"
      ],
      "description": "`sent` for a fax you sent, `received` for one sent to your number."
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "sending",
        "delivered",
        "failed",
        "received"
      ],
      "description": "Where it stands: `draft` for your draft, read by its id until it is sent; `sending` until it is delivered or fails for good, then `delivered` or `failed`; `received` for a fax sent to your number. An open set: read what you know."
    },
    "step": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "queued",
            "preparing",
            "sending"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "Where a fax being sent has got to: `queued`, `preparing` its pages, then `sending`; null for a draft, once it has ended, and for a fax received. An open set."
    },
    "office_id": {
      "description": "The office it went to, by its id on XipFax’s list (`GET /offices`); null for a number typed, and for a fax received.",
      "type": [
        "string",
        "null"
      ]
    },
    "to_number": {
      "description": "The number it went to, in E.164; for a fax received, your number it came to.",
      "type": [
        "string",
        "null"
      ]
    },
    "from_number": {
      "description": "For a fax you sent, the number it went from: your XipFax number, or XipFax’s where you have none; for your draft, null; for a fax received, the caller’s number in E.164, null where the caller’s line gave none.",
      "type": [
        "string",
        "null"
      ]
    },
    "pages": {
      "description": "Its pages, the cover page among them.",
      "type": [
        "integer",
        "null"
      ]
    },
    "price": {
      "anyOf": [
        {
          "$ref": "#/$defs/Money"
        },
        {
          "type": "null"
        }
      ],
      "description": "What it costs: what its payment holds while it sends, and what was taken once it was delivered. Null for a fax sent on the plan or with a promo code, for one that failed, which costs nothing, and for a fax received."
    },
    "sent_at": {
      "description": "When you sent it; for a fax received, when it came.",
      "type": [
        "string",
        "null"
      ]
    },
    "finished_at": {
      "description": "When it was delivered or failed for good; null until then.",
      "type": [
        "string",
        "null"
      ]
    },
    "retry_at": {
      "description": "When it is tried again, while a failed try waits for the next; null otherwise.",
      "type": [
        "string",
        "null"
      ]
    },
    "failure": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "no_answer",
            "busy",
            "call_dropped",
            "declined",
            "not_a_fax_number",
            "account_sending_stopped",
            "ours"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "Why its last try failed: `no_answer`, `busy`, `call_dropped`, `declined`, `not_a_fax_number`, `account_sending_stopped` once your account can’t send faxes, or `ours` for a failure on XipFax’s side. Null where none failed. An open set."
    },
    "time_zone": {
      "description": "The time zone its confirmation tells its times in, as the IANA database names it; null for a fax received.",
      "type": [
        "string",
        "null"
      ]
    },
    "sender_name": {
      "description": "For a fax you sent, the sender’s name its header line gave.",
      "type": [
        "string",
        "null"
      ]
    },
    "cover_confidential": {
      "type": "boolean",
      "description": "Whether its cover page was marked Confidential; false for a fax received."
    }
  },
  "required": [
    "id",
    "direction",
    "status",
    "step",
    "office_id",
    "to_number",
    "from_number",
    "pages",
    "price",
    "sent_at",
    "finished_at",
    "retry_at",
    "failure",
    "time_zone",
    "sender_name",
    "cover_confidential"
  ],
  "$defs": {
    "Money": {
      "type": "object",
      "properties": {
        "amount_minor": {
          "type": "integer",
          "description": "In the currency’s smallest unit: cents."
        },
        "currency": {
          "type": "string",
          "description": "Its ISO 4217 code: `USD`."
        }
      },
      "required": [
        "amount_minor",
        "currency"
      ],
      "description": "An amount of money."
    }
  }
}