Zoey REST API reference ยท Interactive version: apidocs.zoey.com

Customers

Get

GET https://container-url.zoeysite.com/api/rest/customers2/customer?id=1

Query parameters:

NameExampleNotes
id1ID of customer to fetch info. ( Required )

Example response (Get), HTTP 200:

{
    "customer_id": "1",
    "created_at": "2016-08-24T09:26:52-04:00",
    "updated_at": "2020-12-10 13:40:18",
    "increment_id": null,
    "store_id": "1",
    "website_id": "1",
    "is_active": "1",
    "sales_rep_user_id": "13058631632732613440,10932762742589794610,3",
    "is_login_disabled": "0",
    "quickbooks_customer_id": null,
    "adyen_customer_ref": null,
    "affirm_customer_mfp": null,
    "avatax_customer_code": null,
    "block_fraud_customer": null,
    "braintree_customer_id": null,
    "can_create_addresses": "0",
    "can_delete_addresses": "0",
    "can_edit_addresses": "0",
    "company_customer_created_by": null,
    "confirmation": null,
    "created_in": null,
    "customer_tokenpan": null,
    "cybersource_subscription_id": null,
    "cybersource_verif_address": null,
    "default_billing": "9",
    "default_shipping": "9",
    "deprecated_tokens": null,
    "disable_auto_group_change": "0",
    "dob": null,
    "ebizmarts_reviews_cntr_total": null,
    "ebizmarts_reviews_coupon_total": null,
    "email": "test@zoey.com",
    "facorder_id": "no",
    "firstname": "Zoey's test",
    "gender": null,
    "group_id": "1",
    "is_tokenized": "no",
    "lastname": "customer",
    "lightspeed_id": null,
    "mark_fraud": null,
    "middlename": null,
    "net_term": null,
    "net_term_credit": "1000.0000",
    "net_term_detail": "[store_name] has offered you payment terms of [term_name]. Payment is due within [term_period] days for this order, after-which interest may be due. Invoices may be paid via Check, Wire Transfer, Cash or Credit Card by calling customer support at [store_phone].",
    "net_term_disable_past_due": null,
    "net_term_disable_past_due_day": null,
    "net_term_enabled": "1",
    "old_customer_id": null,
    "order_notification_emails": "test@gmail.com,additionaltest@gmail.com,anotherTest@gmail.com",
    "password_created_at": "1596489576",
    "password_hash": "e0f96453d5766026595724af90cf7838:8WtCmikvOr7YOs6tw0b1X7AazkPRoR6c",
    "prefix": null,
    "reference_number": null,
    "rp_customer_id": null,
    "rp_token": null,
    "rp_token_created_at": null,
    "suffix": null,
    "taxvat": "123445",
    "xp_buffer": null,
    "zoey_agreement": null,
    "custom_attributes": [
        {
            "attribute_id": "234",
            "attribute_code": "affirm_customer_mfp",
            "value": null,
            "value_string": ""
        },
        {
            "attribute_id": "279",
            "attribut
... (truncated)

Get All

GET https://container-url.zoeysite.com/api/rest/customers2/full?limit=1&page=2&filters[email]=test@zoey.com&filters[zb2b_pending_status]=1

Filtering this collection requires an attribute and a value.

Action Data Type Description
eq string Is Equal To
neq string Is NOT Equal To
like string Is Like
nlike string Is Not Like
in array Is In
nin array Is NOT In
null boolean Is NULL
notnull boolean Is NOT NULL
gt string Is Greater Than
gte string Is Greater Than OR Equal To
lt string Is Less Than
lte string Is Less Than OR Equal To

How To Filter A Data Type in Query

DataType Query Description
string ?filters[email]=test@zoey.com Filter this collection where email is equal to test@zoey.com (Default)
string ?filters[firstname][neq]=test firstname does not equal test
array ?filters[email][in][0]=test@example.com&email[in][1]=test@zoey.com Filter this collection where the email is either test@example.com or test@zoey.com
array ?filters[email][][eq]=test@example.com&email[][eq]=test@zoey.com Is another way of OR filtering. The result is the same as the above.
boolean ?filters[email][null]=1 Filter this collection where the email is null.

Query parameters:

NameExampleNotes
limit1Limit the response.
page2Paginate the response.
filters[email]test@zoey.com
filters[zb2b_pending_status]1zb2b_pending_status is the filter used for Pending. A value of 1 means approved.

Example response (Updated At), HTTP 200:

[
    {
        "customer_id": "1",
        "created_at": "2016-08-24 13:26:52",
        "updated_at": "2021-06-02 11:16:05",
        "store_id": "1",
        "website_id": "1",
        "is_active": "1",
        "is_login_disabled": "0",
        "can_create_addresses": "0",
        "can_delete_addresses": "0",
        "can_edit_addresses": "0",
        "default_billing": "1",
        "disable_auto_group_change": "0",
        "email": "test@zoey.com",
        "facorder_id": "no",
        "firstname": "Zoey's test",
        "group_id": "1",
        "is_tokenized": "no",
        "lastname": "customer",
        "net_term": "net10",
        "net_term_credit": "10000.0000",
        "net_term_detail": "[store_name] has offered you payment terms of [term_name]. Payment is due within [term_period] days for this order, after-which interest may be due. Invoices may be paid via Check, Wire Transfer, Cash or Credit Card by calling customer support at [store_phone].",
        "net_term_disable_past_due": "0",
        "net_term_enabled": "1",
        "order_notification_emails": "",
        "password_created_at": "1550872437",
        "password_hash": "e0f96453d5766026595724af90cf7838:8WtCmikvOr7YOs6tw0b1X7AazkPRoR6c",
        "wysiwyg": "",
        "yes_no": "0",
        "zoey_has_placed_order": "1",
        "custom_attributes": [
            {
                "attribute_id": "234",
                "attribute_code": "affirm_customer_mfp",
                "value": null,
                "value_string": ""
            },
            {
                "attribute_id": "279",
                "attribute_code": "avatax_customer_code",
                "value": null,
                "value_string": ""
            },
            {
                "attribute_id": "248",
                "attribute_code": "braintree_customer_id",
                "value": null,
                "value_string": ""
            },
            {
                "attribute_id": "347",
                "attribute_code": "date",
                "value": null,
                "value_string": ""
            },
            {
                "attribute_id": "346",
                "attribute_code": "drop_down",
                "value": null,
                "value_string": false
            },
            {
                "attribute_id": "139",
                "attribute_code": "ebizmarts_reviews_cntr_total",
                "value": null,
                "value_string": ""
            },
            {
           
... (truncated)

Count

GET https://container-url.zoeysite.com/api/rest/customers2/count

Used to count the customers.

See Get All for filtering options.

Create

POST https://container-url.zoeysite.com/api/rest/customers2/customer

Required

Name Description Type
customerData The data for the customer being created. customerDataType

Required customerDataType

This data is required when creating a new customer. All other customer data is either optional/required based on the attribute values.

Name Description Type
email The customers email address. string

Common customerDataType Attributes

These are common attributes that are typically assigned to customers. This list may change depending on the attributes settings in Customers > Attributes > Manage Customer Attributes page in Admin Panel. For example, a required status of the middlename attribute (Middle Name/Initial) may be changed to 'YES".

Attribute Code Description Type
firstname The customers first name. string
lastname The customers last name. string
password The customers password. The password must contain minimum 8 characters. string
group_id Customer Group ID. int
prefix Customer prefix. string
middlename Customer middlename. string
suffix Customer suffix. string
taxvat Customer Tax or VAT number. string

Other customerDataType Data

This is non-attribute data or actions that are associated with creating the customer.

Name Description Type
disable_auto_group_change Defines whether the automatic group change for the customer will be disabled. int
zoey_customer_confirmation Confirmation Login --- 1 = Bypass Confirmation, 2 = Send Confirmation Email ( Confirmation or Welcome email will be sent depending on store settings ) string
storecredit Will add a store credit balance to the customer. storeCreditConfig (defined below)

storeCreditConfig

Attribute Code Description Type
balance The amount of credit given to the customer. number
comment A comment added to the store credit balance history. string

Example request body:

{
    "customerData": {
        "firstname": "Earl",
        "lastname": "Hickey",
        "password": "12345678",
        "email": "earl@example.com",
        "group_id": 1,
        "zoey_customer_confirmation": 2
    }
}

Example response (Create):

"5"

Update

PUT https://container-url.zoeysite.com/api/rest/customers2/customer

Required

Name Description Type
customerId The ID of the customer being updated. string
customerData The customer data being updated. customerDataType

Common customerDataType Attributes

These are common attributes that are typically assigned to customers. This list may change depending on the attributes settings in Customers > Attributes > Manage Customer Attributes page in Admin Panel. For example, a required status of the middlename attribute (Middle Name/Initial) may be changed to 'YES".

Attribute Code Description Type
firstname The customers first name. string
lastname The customers last name. string
password The customers password. The password must contain minimum 7 characters. string
group_id Customer Group ID. int
prefix Customer prefix. string
middlename Customer middlename. string
suffix Customer suffix. string
taxvat Customer Tax or VAT number. string
tax_class_id Customer Tax Class ID. Use null to set the same as the Customer Group. int

Other customerDataType Data

This is non-attribute data or actions that are associated with creating the customer.

Name Description Type
storecredit Will add a store credit balance to the customer. storeCreditConfig (defined below)

storeCreditConfig

Attribute Code Description Type
balance The amount of credit given to the customer. number
comment A comment added to the store credit balance history. string
send_email A flag to send an email to the customer letting them know the balance has been updated. string (1,0)

Example request body:

{
    "customerId": 6,
    "customerData": {
        "firstname": "Earl",
        "lastname": "Hickey",
        "password": "123123q",
        "email": "earl@example.com",
        "group_id": 2
    }
}

Orderd Items

GET https://container-url.zoeysite.com/api/rest/customers/:id/ordered-items?limit=10&page=1&order=item_id&dir=ASC

Query parameters:

NameExampleNotes
limit10Limit the response.
page1Paginate the response.
orderitem_idOrder the response by attribute.
dirASCOrder direction. (ASC, DESC)

Example response (Orderd Items), HTTP 200:

[
    {
        "item_id": "1",
        "order_id": "1",
        "created_at": "2019-08-07 14:55:15",
        "product_id": "115",
        "product_options": {
            "info_buyRequest": {
                "qty": 1,
                "product_id": 115,
                "id": "13",
                "reset_count": true
            }
        },
        "sku": "Simple",
        "name": "Simple",
        "qty_ordered": "1.0000"
    }
]