WooCommerce · Schema

CustomerInput

Input for creating or updating a customer.

eCommerceOpen SourceOrdersProductsWordPress

Properties

Name Type Description
email string Customer email address.
first_name string Customer first name.
last_name string Customer last name.
username string Customer login username.
password string Customer account password (write only, not returned).
billing object Billing or shipping address associated with a customer or order.
shipping object Billing or shipping address associated with a customer or order.
meta_data array Custom metadata.
View JSON Schema on GitHub

JSON Schema

woocommerce-rest-api-customer-input-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/woocommerce/refs/heads/main/json-schema/woocommerce-rest-api-customer-input-schema.json",
  "title": "CustomerInput",
  "description": "Input for creating or updating a customer.",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "description": "Customer email address.",
      "example": "[email protected]"
    },
    "first_name": {
      "type": "string",
      "description": "Customer first name.",
      "example": "Example Name"
    },
    "last_name": {
      "type": "string",
      "description": "Customer last name.",
      "example": "Example Name"
    },
    "username": {
      "type": "string",
      "description": "Customer login username.",
      "example": "Example Name"
    },
    "password": {
      "type": "string",
      "description": "Customer account password (write only, not returned).",
      "example": "string-value"
    },
    "billing": {
      "type": "object",
      "description": "Billing or shipping address associated with a customer or order.",
      "properties": {
        "first_name": {
          "type": "string",
          "description": "First name.",
          "example": "Example Name"
        },
        "last_name": {
          "type": "string",
          "description": "Last name.",
          "example": "Example Name"
        },
        "company": {
          "type": "string",
          "description": "Company name.",
          "example": "string-value"
        },
        "address_1": {
          "type": "string",
          "description": "Address line 1.",
          "example": "string-value"
        },
        "address_2": {
          "type": "string",
          "description": "Address line 2.",
          "example": "string-value"
        },
        "city": {
          "type": "string",
          "description": "City name.",
          "example": "string-value"
        },
        "state": {
          "type": "string",
          "description": "ISO code or name of the state, province, or district.",
          "example": "string-value"
        },
        "postcode": {
          "type": "string",
          "description": "Postal code.",
          "example": "string-value"
        },
        "country": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2 country code.",
          "example": "string-value"
        },
        "email": {
          "type": "string",
          "format": "email",
          "description": "Email address (billing only).",
          "example": "[email protected]"
        },
        "phone": {
          "type": "string",
          "description": "Phone number (billing only).",
          "example": "string-value"
        }
      }
    },
    "shipping": {
      "type": "object",
      "description": "Billing or shipping address associated with a customer or order.",
      "properties": {
        "first_name": {
          "type": "string",
          "description": "First name.",
          "example": "Example Name"
        },
        "last_name": {
          "type": "string",
          "description": "Last name.",
          "example": "Example Name"
        },
        "company": {
          "type": "string",
          "description": "Company name.",
          "example": "string-value"
        },
        "address_1": {
          "type": "string",
          "description": "Address line 1.",
          "example": "string-value"
        },
        "address_2": {
          "type": "string",
          "description": "Address line 2.",
          "example": "string-value"
        },
        "city": {
          "type": "string",
          "description": "City name.",
          "example": "string-value"
        },
        "state": {
          "type": "string",
          "description": "ISO code or name of the state, province, or district.",
          "example": "string-value"
        },
        "postcode": {
          "type": "string",
          "description": "Postal code.",
          "example": "string-value"
        },
        "country": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2 country code.",
          "example": "string-value"
        },
        "email": {
          "type": "string",
          "format": "email",
          "description": "Email address (billing only).",
          "example": "[email protected]"
        },
        "phone": {
          "type": "string",
          "description": "Phone number (billing only).",
          "example": "string-value"
        }
      }
    },
    "meta_data": {
      "type": "array",
      "description": "Custom metadata.",
      "items": {
        "type": "object",
        "description": "Custom metadata key-value entry.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Metadata unique identifier.",
            "example": 1
          },
          "key": {
            "type": "string",
            "description": "Metadata key.",
            "example": "string-value"
          },
          "value": {
            "type": "string",
            "description": "Metadata value.",
            "example": "string-value"
          }
        }
      },
      "example": [
        "string-value"
      ]
    }
  }
}