{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/blackbaud/main/json-schema/blackbaud-purchase-order-detail-schema.json",
  "title": "PurchaseOrderDetail",
  "description": "Purchase order detail",
  "x-generated": "2026-10-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/blackbaud-accounts-payable-api-openapi.yml#/components/schemas/PurchaseOrderDetail",
  "type": "object",
  "properties": {
    "ship_to_address": {
      "type": [
        "string",
        "null"
      ],
      "description": "The ship to address of the purchase order."
    },
    "department": {
      "type": [
        "string",
        "null"
      ],
      "description": "The department of the purchase order."
    },
    "buyer": {
      "type": [
        "string",
        "null"
      ],
      "description": "The buyer of the purchase order."
    },
    "ship_via": {
      "type": [
        "string",
        "null"
      ],
      "description": "The shipping method of the purchase order."
    },
    "fob": {
      "type": [
        "string",
        "null"
      ],
      "description": "The freight on board of the purchase order."
    },
    "ordered_by": {
      "type": [
        "string",
        "null"
      ],
      "description": "The orderer of the purchase order."
    },
    "ordered_from_contact_id": {
      "type": "integer",
      "description": "The contact identifier for the orderer of the purchase order.",
      "format": "int32"
    },
    "attention": {
      "type": [
        "string",
        "null"
      ],
      "description": "The staff member for attention of the purchase order."
    },
    "comments": {
      "type": [
        "string",
        "null"
      ],
      "description": "The comments of the purchase order."
    },
    "custom_fields": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/CustomField"
      },
      "description": "The custom fields of the purchase order."
    },
    "purchase_order_id": {
      "type": "integer",
      "description": "The purchase order's identifier.",
      "format": "int32"
    },
    "order_number": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The order number of the purchase order.",
      "format": "int64"
    },
    "order_date": {
      "type": [
        "string",
        "null"
      ],
      "description": "The date of the purchase order.",
      "format": "date-time"
    },
    "type": {
      "$ref": "#/$defs/PurchaseOrderType"
    },
    "order_total": {
      "type": "number",
      "description": "The total of the purchase order.",
      "format": "decimal"
    },
    "receipted_total": {
      "type": "number",
      "description": "The receipted total of the purchase order.",
      "format": "decimal"
    },
    "order_status": {
      "$ref": "#/$defs/PurchaseOrderStatus"
    },
    "vendor_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "The vendor name assocaited with the purchase order."
    },
    "vendor_id": {
      "type": "integer",
      "description": "The vendor id of the purchase order.",
      "format": "int32"
    },
    "terms": {
      "type": [
        "string",
        "null"
      ],
      "description": "The term of the purchase order."
    },
    "date_added": {
      "type": [
        "string",
        "null"
      ],
      "description": "The created date of the purchase order.",
      "format": "date-time"
    },
    "added_by": {
      "type": [
        "string",
        "null"
      ],
      "description": "The creator of the purchase order."
    },
    "date_modified": {
      "type": [
        "string",
        "null"
      ],
      "description": "The modified date of the purchase order.",
      "format": "date-time"
    },
    "modified_by": {
      "type": [
        "string",
        "null"
      ],
      "description": "The modifier of the purchase order."
    }
  },
  "additionalProperties": false,
  "$defs": {
    "CustomField": {
      "type": "object",
      "properties": {
        "field_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The name of the custom field."
        },
        "value": {
          "type": [
            "string",
            "null"
          ],
          "description": "The value of the custom field."
        },
        "comments": {
          "type": [
            "string",
            "null"
          ],
          "description": "The description of the custom field."
        },
        "type": {
          "$ref": "#/$defs/CustomFieldDataType"
        },
        "is_required": {
          "type": "boolean",
          "description": "Required status of the custom field."
        },
        "date": {
          "type": [
            "string",
            "null"
          ],
          "description": "The date on this custom field.",
          "format": "date-time"
        }
      },
      "additionalProperties": false,
      "description": "Custom field definition."
    },
    "CustomFieldDataType": {
      "title": "CustomFieldDataType",
      "enum": [
        "Text",
        "Number",
        "DateTime",
        "Currency",
        "Boolean",
        "Table",
        "FuzzyDate"
      ],
      "type": "string"
    },
    "PurchaseOrderStatus": {
      "title": "PurchaseOrderStatus",
      "enum": [
        "UnprintedPurchaseOrder",
        "OpenPurchaseOrder",
        "UprintedChangeOrder",
        "ReprintOrder",
        "CanceledOrder",
        "UnprintedCancellationNotice",
        "ClosedOrder",
        "DeletedOrder"
      ],
      "type": "string",
      "description": "A collection of possible enum values for a purchase order's status."
    },
    "PurchaseOrderType": {
      "title": "PurchaseOrderType",
      "enum": [
        "Template",
        "Blanket",
        "Regular"
      ],
      "type": "string",
      "description": "A collection of enum values possible for a purchase order's type."
    }
  }
}