{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/grainfinance-co/json-schema/grainfinance-co-update-customer-request-body-schema.json",
  "title": "UpdateCustomerRequestBody",
  "description": "The payload for updating an existing customer. Only the fields provided will be updated.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/grainfinance-co-customers-api-openapi.yml#/components/schemas/UpdateCustomerRequestBody",
  "$ref": "#/$defs/Partial_CreateUpdateCustomerRequestBody_",
  "$defs": {
    "ContactEmail": {
      "type": "string",
      "description": "The email address of the company's primary contact"
    },
    "CountryCode": {
      "type": "string",
      "description": "The alpha-2 ISO 3166 country code of the entity's country.",
      "pattern": "^[A-Za-z]{2}$"
    },
    "CustomersExtraFieldsParam": {
      "properties": {},
      "additionalProperties": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number",
            "format": "double"
          },
          {
            "type": "boolean"
          }
        ]
      },
      "type": "object",
      "description": "Additional fields that provide further details about the company.\nThese fields should be specified as a valid JSON object."
    },
    "Partial_CreateUpdateCustomerRequestBody_": {
      "properties": {
        "contactEmail": {
          "$ref": "#/$defs/ContactEmail",
          "description": "The email for the company's primary contact"
        },
        "contactFullName": {
          "type": "string",
          "description": "The name of the company's primary contact"
        },
        "contactPhoneNumber": {
          "type": "string",
          "description": "The phone number of the company's primary contact"
        },
        "companyName": {
          "type": "string",
          "description": "The legal name of the customer's company"
        },
        "companyAddress": {
          "type": "string",
          "description": "The address of the company"
        },
        "companyCity": {
          "type": "string",
          "description": "The city of the company"
        },
        "companyState": {
          "type": "string",
          "description": "The state the company is in (US based)"
        },
        "companyCountry": {
          "$ref": "#/$defs/CountryCode"
        },
        "companyTaxId": {
          "type": "string",
          "description": "The tax identification or registration number of the company"
        },
        "externalCustomerId": {
          "type": "string",
          "description": "The id used to identify the customer within your platform"
        },
        "extraFields": {
          "$ref": "#/$defs/CustomersExtraFieldsParam",
          "description": "Additional fields that provide further details about the customer.\nThese fields should be specified as a valid JSON object."
        }
      },
      "type": "object",
      "description": "Make all properties in T optional"
    }
  }
}