{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/optimizely/main/json-schema/optimizely-insite-customers-web-api-v1-api-models-bill-to-collection-model-schema.json",
  "title": "Insite.Customers.WebApi.V1.ApiModels.BillToCollectionModel",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/optimizely-billtos-api-openapi.yml#/components/schemas/Insite.Customers.WebApi.V1.ApiModels.BillToCollectionModel",
  "type": "object",
  "properties": {
    "uri": {
      "type": "string"
    },
    "pagination": {
      "$ref": "#/$defs/Insite.Core.WebApi.PaginationModel"
    },
    "billTos": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Insite.Customers.WebApi.V1.ApiModels.BillToModel"
      }
    },
    "properties": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "Insite.Core.WebApi.PaginationModel": {
      "type": "object",
      "properties": {
        "currentPage": {
          "format": "int32",
          "type": "integer"
        },
        "page": {
          "format": "int32",
          "type": "integer"
        },
        "pageSize": {
          "format": "int32",
          "type": "integer"
        },
        "defaultPageSize": {
          "format": "int32",
          "type": "integer"
        },
        "totalItemCount": {
          "format": "int32",
          "type": "integer"
        },
        "numberOfPages": {
          "format": "int32",
          "type": "integer"
        },
        "pageSizeOptions": {
          "type": "array",
          "items": {
            "format": "int32",
            "type": "integer"
          }
        },
        "sortOptions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Insite.Core.WebApi.SortOptionModel"
          }
        },
        "sortType": {
          "type": "string"
        },
        "nextPageUri": {
          "type": "string"
        },
        "prevPageUri": {
          "type": "string"
        },
        "nextPageToken": {
          "type": "string"
        }
      }
    },
    "Insite.Core.WebApi.SortOptionModel": {
      "type": "object",
      "properties": {
        "displayName": {
          "type": "string"
        },
        "sortType": {
          "type": "string"
        }
      }
    },
    "Insite.Customers.Services.Dtos.AccountsReceivableDto": {
      "type": "object",
      "properties": {
        "agingBuckets": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Insite.Customers.Services.Dtos.AgingBucketDto"
          }
        },
        "agingBucketTotal": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.AgingBucketDto"
        },
        "agingBucketFuture": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.AgingBucketDto"
        }
      }
    },
    "Insite.Customers.Services.Dtos.AgingBucketDto": {
      "type": "object",
      "properties": {
        "amount": {
          "format": "decimal",
          "type": "number"
        },
        "amountDisplay": {
          "type": "string"
        },
        "label": {
          "type": "string"
        }
      }
    },
    "Insite.Customers.Services.Dtos.CustomerValidationDto": {
      "type": "object",
      "properties": {
        "firstName": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.FieldValidationDto"
        },
        "lastName": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.FieldValidationDto"
        },
        "companyName": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.FieldValidationDto"
        },
        "attention": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.FieldValidationDto"
        },
        "address1": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.FieldValidationDto"
        },
        "address2": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.FieldValidationDto"
        },
        "address3": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.FieldValidationDto"
        },
        "address4": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.FieldValidationDto"
        },
        "country": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.FieldValidationDto"
        },
        "state": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.FieldValidationDto"
        },
        "city": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.FieldValidationDto"
        },
        "postalCode": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.FieldValidationDto"
        },
        "phone": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.FieldValidationDto"
        },
        "email": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.FieldValidationDto"
        },
        "fax": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.FieldValidationDto"
        }
      }
    },
    "Insite.Customers.Services.Dtos.FieldValidationDto": {
      "type": "object",
      "properties": {
        "isRequired": {
          "type": "boolean"
        },
        "isDisabled": {
          "type": "boolean"
        },
        "maxLength": {
          "format": "int32",
          "type": "integer"
        }
      }
    },
    "Insite.Customers.WebApi.V1.ApiModels.BillToModel": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string"
        },
        "shipTosUri": {
          "type": "string"
        },
        "isGuest": {
          "type": "boolean"
        },
        "label": {
          "type": "string"
        },
        "budgetEnforcementLevel": {
          "type": "string"
        },
        "costCodeTitle": {
          "type": "string"
        },
        "customerCurrencySymbol": {
          "type": "string"
        },
        "costCodes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Insite.Customers.WebApi.V1.ApiModels.CostCodeModel"
          }
        },
        "shipTos": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Insite.Customers.WebApi.V1.ApiModels.ShipToModel"
          }
        },
        "validation": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.CustomerValidationDto"
        },
        "isDefault": {
          "type": "boolean"
        },
        "accountsReceivable": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.AccountsReceivableDto"
        },
        "id": {
          "type": "string"
        },
        "customerNumber": {
          "type": "string"
        },
        "customerSequence": {
          "type": "string"
        },
        "customerName": {
          "type": "string"
        },
        "firstName": {
          "type": "string"
        },
        "lastName": {
          "type": "string"
        },
        "contactFullName": {
          "type": "string"
        },
        "companyName": {
          "type": "string"
        },
        "attention": {
          "type": "string"
        },
        "address1": {
          "type": "string"
        },
        "address2": {
          "type": "string"
        },
        "address3": {
          "type": "string"
        },
        "address4": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "state": {
          "$ref": "#/$defs/Insite.Websites.WebApi.V1.ApiModels.StateModel"
        },
        "country": {
          "$ref": "#/$defs/Insite.Websites.WebApi.V1.ApiModels.CountryModel"
        },
        "phone": {
          "type": "string"
        },
        "fullAddress": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "fax": {
          "type": "string"
        },
        "isVmiLocation": {
          "type": "boolean"
        },
        "properties": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "Insite.Customers.WebApi.V1.ApiModels.CostCodeModel": {
      "type": "object",
      "properties": {
        "id": {
          "format": "uuid",
          "type": "string"
        },
        "costCode": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "isActive": {
          "type": "boolean"
        }
      }
    },
    "Insite.Customers.WebApi.V1.ApiModels.ShipToModel": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string"
        },
        "isNew": {
          "type": "boolean"
        },
        "oneTimeAddress": {
          "type": "boolean"
        },
        "label": {
          "type": "string"
        },
        "validation": {
          "$ref": "#/$defs/Insite.Customers.Services.Dtos.CustomerValidationDto"
        },
        "isDefault": {
          "type": "boolean"
        },
        "id": {
          "type": "string"
        },
        "customerNumber": {
          "type": "string"
        },
        "customerSequence": {
          "type": "string"
        },
        "customerName": {
          "type": "string"
        },
        "firstName": {
          "type": "string"
        },
        "lastName": {
          "type": "string"
        },
        "contactFullName": {
          "type": "string"
        },
        "companyName": {
          "type": "string"
        },
        "attention": {
          "type": "string"
        },
        "address1": {
          "type": "string"
        },
        "address2": {
          "type": "string"
        },
        "address3": {
          "type": "string"
        },
        "address4": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "state": {
          "$ref": "#/$defs/Insite.Websites.WebApi.V1.ApiModels.StateModel"
        },
        "country": {
          "$ref": "#/$defs/Insite.Websites.WebApi.V1.ApiModels.CountryModel"
        },
        "phone": {
          "type": "string"
        },
        "fullAddress": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "fax": {
          "type": "string"
        },
        "isVmiLocation": {
          "type": "boolean"
        },
        "properties": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "Insite.Websites.WebApi.V1.ApiModels.CountryModel": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "abbreviation": {
          "type": "string"
        },
        "states": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Insite.Websites.WebApi.V1.ApiModels.StateModel"
          }
        },
        "properties": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "Insite.Websites.WebApi.V1.ApiModels.StateModel": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "abbreviation": {
          "type": "string"
        },
        "properties": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    }
  }
}