{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/blackbaud/main/json-schema/blackbaud-vendor-detail-schema.json",
  "title": "VendorDetail",
  "description": "Detailed vendor information.",
  "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/VendorDetail",
  "required": [
    "vendor_name",
    "vendor_type"
  ],
  "type": "object",
  "properties": {
    "vendor_id": {
      "type": "integer",
      "description": "Vendor identifier.",
      "format": "int32"
    },
    "vendor_name": {
      "minLength": 1,
      "type": "string",
      "description": "The name of the vendor."
    },
    "vendor_type": {
      "$ref": "#/$defs/VendorType"
    },
    "balance_due": {
      "type": [
        "number",
        "null"
      ],
      "description": "The balance due on this vendor.",
      "format": "decimal"
    },
    "ui_defined_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The user-defined identifier for this vendor."
    },
    "tax_id_number": {
      "type": [
        "string",
        "null"
      ],
      "description": "The tax id number for this vendor"
    },
    "psb_activity_code": {
      "type": [
        "string",
        "null"
      ],
      "description": "The Psb activity code for this vendor (CANADA only)."
    },
    "psb_activity_code_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The Psb activity code id for this vendor (CANADA only).",
      "format": "int32"
    },
    "psb_activity_code_desc": {
      "type": [
        "string",
        "null"
      ],
      "description": "The Psb activity code description for this vendor (CANADA only)."
    },
    "gst_tax_type": {
      "type": [
        "string",
        "null"
      ],
      "description": "The tax type for this vendor (CANADA and AUSTRALIA only)."
    },
    "gst_tax_type_desc": {
      "type": [
        "string",
        "null"
      ],
      "description": "The tax type description for this vendor (CANADA and AUSTRALIA only)."
    },
    "gst_branch": {
      "type": [
        "string",
        "null"
      ],
      "description": "The branch for this vendor (AUSTRALIA only)."
    },
    "customer_number": {
      "type": [
        "string",
        "null"
      ],
      "description": "The customer number."
    },
    "vendor_status": {
      "$ref": "#/$defs/VendorStatus"
    },
    "issue_1099s": {
      "type": "boolean",
      "description": "If to issue 1099s to this vendor."
    },
    "addresses": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/VendorAddress"
      },
      "description": "The address(es) of the vendor."
    },
    "vendor_payment_default": {
      "$ref": "#/$defs/VendorPaymentDefault"
    },
    "custom_fields": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/CustomField"
      },
      "description": "The custom fields on this vendor."
    },
    "date_added": {
      "type": [
        "string",
        "null"
      ],
      "description": "The created date of the vendor.",
      "format": "date-time"
    },
    "date_modified": {
      "type": [
        "string",
        "null"
      ],
      "description": "The modified date of the vendor.",
      "format": "date-time"
    },
    "added_by": {
      "type": [
        "string",
        "null"
      ],
      "description": "The creator of the vendor."
    },
    "modified_by": {
      "type": [
        "string",
        "null"
      ],
      "description": "The modifier of the vendor."
    }
  },
  "additionalProperties": false,
  "$defs": {
    "AddressContactMethod": {
      "required": [
        "contact_info",
        "contact_type"
      ],
      "type": "object",
      "properties": {
        "contact_method_id": {
          "type": "integer",
          "description": "The address contact method identifier.",
          "format": "int32"
        },
        "contact_type": {
          "minLength": 1,
          "type": "string",
          "description": "The type of contact (email, phone, etc)."
        },
        "contact_info": {
          "minLength": 1,
          "type": "string",
          "description": "The contact information (email address, phone number, etc) for this method."
        }
      },
      "additionalProperties": false,
      "description": "Address information"
    },
    "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"
    },
    "PaymentMethod": {
      "title": "PaymentMethod",
      "enum": [
        "Check",
        "EFT",
        "BankDraft",
        "CreditCard"
      ],
      "type": "string"
    },
    "VendorAddress": {
      "required": [
        "description"
      ],
      "type": "object",
      "properties": {
        "address_id": {
          "type": "integer",
          "description": "The address identifier.",
          "format": "int32"
        },
        "description": {
          "minLength": 1,
          "type": "string",
          "description": "The description for this address."
        },
        "country": {
          "type": [
            "string",
            "null"
          ],
          "description": "The country for the address."
        },
        "city": {
          "type": [
            "string",
            "null"
          ],
          "description": "The city for the address."
        },
        "county": {
          "type": [
            "string",
            "null"
          ],
          "description": "The county for the address."
        },
        "state": {
          "type": [
            "string",
            "null"
          ],
          "description": "The state or province (or suburb in NZ) for the address."
        },
        "postal": {
          "type": [
            "string",
            "null"
          ],
          "description": "Refers to the Postal Code or ZIP of the address."
        },
        "address_line": {
          "type": [
            "string",
            "null"
          ],
          "description": "The street/address line for this address."
        },
        "is_primary": {
          "type": "boolean",
          "description": "If this address is the primary address."
        },
        "is_invoices": {
          "type": "boolean",
          "description": "If invoices are sent to this address."
        },
        "is_pos": {
          "type": "boolean",
          "description": "If purchase orders are sent to this address."
        },
        "is_1099": {
          "type": "boolean",
          "description": "If 1099s are sent to this address."
        },
        "title": {
          "type": [
            "string",
            "null"
          ],
          "description": "The title for the primary contact."
        },
        "first_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The first name of the primary contact."
        },
        "middle_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The middle initial or name of the primary contact."
        },
        "last_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The last name of the primary contact."
        },
        "suffix": {
          "type": [
            "string",
            "null"
          ],
          "description": "The suffix of the primary contact."
        },
        "position": {
          "type": [
            "string",
            "null"
          ],
          "description": "The position of the primary contact."
        },
        "address_contact_methods": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/AddressContactMethod"
          },
          "description": "The list of contact methods for this address."
        },
        "payee_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The payee name"
        }
      },
      "additionalProperties": false,
      "description": "Address information"
    },
    "VendorPaymentDefault": {
      "required": [
        "payment_method",
        "payment_option"
      ],
      "type": "object",
      "properties": {
        "has_credit_limit": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "If or not this vendor has as credit limit."
        },
        "credit_limit": {
          "type": [
            "number",
            "null"
          ],
          "description": "The credit limit, if any.",
          "format": "decimal"
        },
        "payment_terms": {
          "type": [
            "string",
            "null"
          ],
          "description": "The terms of the payment (NET)."
        },
        "account_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The account from which to pay invoices."
        },
        "payment_method": {
          "$ref": "#/$defs/PaymentMethod"
        },
        "payment_option": {
          "$ref": "#/$defs/VendorPaymentOption"
        }
      },
      "additionalProperties": false,
      "description": "Vendor Information."
    },
    "VendorPaymentOption": {
      "title": "VendorPaymentOption",
      "enum": [
        "OnePerInvoice",
        "OneForAll"
      ],
      "type": "string"
    },
    "VendorStatus": {
      "title": "VendorStatus",
      "enum": [
        "Active",
        "Inactive",
        "OnHold"
      ],
      "type": "string"
    },
    "VendorType": {
      "title": "VendorType",
      "enum": [
        "Organization",
        "Individual"
      ],
      "type": "string"
    }
  }
}