Customer Data - RMUCapstone-MIS590/Team-A GitHub Wiki
In an effort to unify CLI, API, and WP Admin, new CRUD classes are being implemented to form a new 'data manipulation API'.
Each CRUD class contains a representation of the data in array format which can be used by endpoints. This representation may differ from the actual stored 'meta keys' mainly due to legacy, but should represent the objects more clearly.
This document explains the Customer CRUD class: WC_Customer
Customer
Name | Type | Description | Example |
---|---|---|---|
id |
int |
Customer ID. | 1 |
email |
string |
Customer email address. | [email protected] |
first_name |
string |
First name of customer. | Justin |
last_name |
string |
Last name of customer. | Shreve |
role |
string |
User role (customer for normal customers). | customer |
last_order_id |
integer |
ID for the last order placed by the customer. Read only. | 517 |
last_order_date |
integer |
Date for the last order placed by the customer. Read only. | 1457550095 |
orders_count |
integer |
Total number of orders placed by the customer. Read only. | 87 |
total_spent |
float |
Amount of money spent by the customer. Read only. | 1080.63 |
username |
string |
Username for account login. | justin |
password |
string |
Password for account login. Write only. | `` |
date_created |
integer |
The date the customer was created. Read only. | 1450186657 |
date_modified |
integer |
The date the customer was last updated. Read only. | 1457549521 |
billing_postcode |
string |
Billing postcode. Run through wc_format_postcode. | 10001 |
billing_city |
string |
Billing city. | New York |
billing_address |
string |
Billing address. | 1 Main Street |
billing_address_2 |
string |
Billing address 2. | Apt 3 |
billing_state |
string |
Billing state. | NY |
billing_country |
string |
Billing country. | US |
shipping_postcode |
string |
Shipping postcode. Run through wc_format_postcode. | 10001 |
shipping_city |
string |
Shipping city. | New York |
shipping_address |
string |
Shipping address. | 1 Main Street |
shipping_address_2 |
string |
Shipping address 2. | Apt 3 |
shipping_state |
string |
Shipping state. | NY |
shipping_country |
string |
Shipping country. | US |
is_paying_customer |
boolean |
Flag saying if this customer has bought something. | true |
downloadable_products |
array |
Downloadable products the customer has access to. Read only. | @todo |