{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/altoviz-com/json-schema/altoviz-com-receipt-schema.json",
  "title": "Receipt",
  "description": "Receipt",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/altoviz-com-receipts-api-openapi.yml#/components/schemas/Receipt",
  "type": "object",
  "properties": {
    "amount": {
      "type": "number",
      "description": "Amount",
      "format": "double"
    },
    "customerId": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Customer ID",
      "format": "int32"
    },
    "customerInternalId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Customer number"
    },
    "customerName": {
      "type": [
        "string",
        "null"
      ],
      "description": "Customer name",
      "readOnly": true
    },
    "customerNumber": {
      "type": [
        "string",
        "null"
      ],
      "description": "Customer number"
    },
    "date": {
      "type": "string",
      "description": "Date",
      "format": "date"
    },
    "id": {
      "type": "integer",
      "description": "ID",
      "format": "int32",
      "readOnly": true
    },
    "internalId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Internal ID"
    },
    "links": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ReceiptLink"
      },
      "description": "Links used to mark documents as paid"
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "Metadata: free-form key/value pairs carried with the receipt, for an integration to keep\nits own identifiers and flags against it.\n\nSent as a PATCH, not a replacement: keys you send are added or updated, keys you leave out\nkeep whatever they held, and a key is removed only when you send it as `null`. Omitting\nthe property entirely leaves the whole bag untouched, and `\"\"` stores an empty value\nrather than removing the key."
    },
    "notes": {
      "type": [
        "string",
        "null"
      ],
      "description": "Notes"
    },
    "paymentMethod": {
      "$ref": "#/$defs/PaymentMethod"
    },
    "reference": {
      "type": [
        "string",
        "null"
      ],
      "description": "Reference"
    },
    "status": {
      "$ref": "#/$defs/PaymentStatus"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "PaymentMethod": {
      "enum": [
        "Transfer",
        "Order",
        "Check",
        "Cash",
        "Card",
        "Bill",
        "Usec",
        "Other"
      ],
      "type": "string"
    },
    "PaymentStatus": {
      "enum": [
        "Success",
        "Pending",
        "Failed"
      ],
      "type": "string",
      "description": "Receipt Status"
    },
    "ReceiptLink": {
      "type": "object",
      "properties": {
        "amount": {
          "type": [
            "number",
            "null"
          ],
          "description": "Amount",
          "format": "double"
        },
        "id": {
          "type": "integer",
          "description": "Linked document ID",
          "format": "int32"
        },
        "type": {
          "$ref": "#/$defs/ReceiptLinkType"
        }
      },
      "additionalProperties": false,
      "description": "ReceiptLink"
    },
    "ReceiptLinkType": {
      "enum": [
        "Commitment",
        "Invoice",
        "Credit"
      ],
      "type": "string",
      "description": "Receipt Link type"
    }
  }
}