{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/subotiz-com/json-schema/subotiz-com-update-customer-request-schema.json",
  "title": "UpdateCustomerRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/subotiz-com-customer-api-openapi.yml#/components/schemas/UpdateCustomerRequest",
  "required": [
    "email"
  ],
  "type": "object",
  "properties": {
    "customer_id": {
      "type": "string",
      "description": "Subotiz platform `customer_id`, either `customer_id` or `payer_id` must exist to identify the customer to update, `customer_id` has higher priority"
    },
    "email": {
      "type": "string",
      "description": "Customer email"
    },
    "phone": {
      "type": "string",
      "description": "Customer phone number"
    },
    "name": {
      "type": "string",
      "description": "Customer name"
    },
    "address": {
      "allOf": [
        {
          "$ref": "#/$defs/CustomerAddress"
        }
      ],
      "description": "Customer address"
    },
    "metadata": {
      "type": "object",
      "description": "A set of key-value pairs that can be attached to an object, allowing you to store additional information in a structured format."
    },
    "payer_id": {
      "type": "string",
      "description": "Third-party customer ID"
    },
    "email_subscription": {
      "type": "integer",
      "description": "Whether to subscribe to marketing email notifications\n - 1: Do not subscribe\n - 2: Subscribe",
      "format": "int32"
    }
  },
  "$defs": {
    "CustomerAddress": {
      "type": "object",
      "properties": {
        "line1": {
          "type": "string",
          "description": "Line 1"
        },
        "line2": {
          "type": "string",
          "description": "Line 2"
        },
        "city": {
          "type": "string",
          "description": "City"
        },
        "province": {
          "type": "string",
          "description": "Province/State Code"
        },
        "postal_code": {
          "type": "string",
          "description": "Postal code"
        },
        "country": {
          "type": "string",
          "description": "Country/Region Code"
        }
      }
    }
  }
}