Customer Data
Claudio Sanches edited this page Mar 14, 2017
·
4 revisions
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 WC_Customer
and WC_Customer_Download
classes.
Name | Type | Description | Example |
---|---|---|---|
id |
int |
Customer ID. | 1 |
date_created |
`WC_DateTime | null` |
WC_DateTime object for when customer was created or null if not set. Read only. |
date_modified |
`WC_DateTime | null` |
WC_DateTime object for when customer was last modified or null if not set. Read only. |
email |
string |
Customer email address. | test@woo.local |
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 |
username |
string |
Username for account login. | justin |
password |
string |
Password for account login. Write only. | `` |
billing |
array |
Array of billing address data. | See address data below. |
shipping |
array |
Array of shipping address data. | See address data below. |
is_paying_customer |
boolean |
Flag saying if this customer has bought something. | true |
Name | Type | Description | Example |
---|---|---|---|
first_name |
string |
Billing first name | Michael |
last_name |
string |
Billing last name | Jolley |
company |
string |
Billing company name | Automattic |
address_1 |
string |
Billing address line 1 | 32 Wiggely Point |
address_2 |
string |
Billing address line 2 | Some street |
city |
string |
Billing address city | Cambridge |
state |
string |
Billing address state/county | Cambridgeshire |
postcode |
string |
Billing address postcode/zip | CB23 1PO |
country |
string |
Billing address country code in ISO 3166-1 alpha-2 format | GB |
email |
string |
Billing email | mike@test.com |
phone |
string |
Billing phone number | 123456789 |
Name | Type | Description | Example |
---|---|---|---|
first_name |
string |
Shipping first name | Michael |
last_name |
string |
Shipping last name | Jolley |
company |
string |
Shipping company name | Automattic |
address_1 |
string |
Shipping address line 1 | 32 Wiggely Point |
address_2 |
string |
Shipping address line 2 | Some street |
city |
string |
Shipping address city | Cambridge |
state |
string |
Shipping address state/county | Cambridgeshire |
postcode |
string |
Shipping address postcode/zip | CB23 1PO |
country |
string |
Shipping address country code in ISO 3166-1 alpha-2 format | GB |
Name | Type | Description | Example |
---|---|---|---|
download_id |
string |
Download ID. | 91447fd1849316bbc89dfb7e986a6006 |
product_id |
integer |
Product ID. | 87 |
user_id |
integer |
User ID. | 1 |
user_email |
integer |
User email. | john.doe@example.com |
order_id |
integer |
Order ID. | 703 |
order_key |
string |
Order key. | wc_order_58c737bcc7b |
downloads_remaining |
string |
Empty string if unlimited, or numeric indicating how many downloads are available. | wc_order_58c737bcc7b |
access_granted |
`WC_DateTime | null` |
WC_DateTime object for when access has been granted or null if not set. |
access_expires |
`WC_DateTime | null` |
WC_DateTime object for when access expires or null if do not expires. |
download_count |
integer |
Download count | wc_order_58c737bcc7b |
WooCommerce is an open source commerce platform built for WordPress and lovingly crafted by Automattic and the WooCommerce community 💜. Come and work with us!
Contribution
- Set up development environment
- Our Git Flow
- SCSS and JS minification
- Naming conventions
- CSS SASS coding guidelines and naming conventions
- Critical Flows
- API Critical Flows
- String localisation guidelines
- Translating WooCommerce
- Deprecation in core
- Adding Actions and Filters
- Common Issues
- Writing high-quality testing instructions
Release Notes
- Release Testing Instructions
- 3.6.x notes/FAQ
- 2.6.x to 3.0.0 Developer Migration Notes
- Select2 fields not working in 3.0.x
- Thumbnail Image Regeneration in 3.3+
- Customizing image sizes in 3.3+
REST API and CLI
CRUD & Data Descriptions
- Database Description
- CRUD Objects in 3.0
- Order and Order Line Item Data
- Coupon Data
- Customer Data
- Product Data
- Data Stores
Internal APIs
Theming
- Enabling product gallery features (zoom, swipe, lightbox)
- Template File Guidelines for Devs and Theme Authors
Examples / Guides