customer
Description
A customer is the person who completes a transaction. Whenever a transaction takes place, a customer must be involved. If using a guest_checkout, an anonymous customer will be created with each transaction.
If you create custom attributes for a customer, they will automatically be included in the response as embedded resources without having to zoom in on them.
Interact with this resource
To interact with this resource and see it in the context of the API, you can utilise Postman or your Terminal/Console to perform requests. If you have a Foxy store, you can also use the API browser in the admin to interact with resources connected to your store.
Actions
- GET
- View a customer
- PATCH
- Update a customer (send only the properties you want to modify)
- PUT
- Replace a customer (send the entire representation)
- DELETE
- Delete a customer
- HEAD
- Get just the header response
- OPTIONS
- Get a response explaining which HTTP methods are supported
Properties
Property | Description | Type | Constraints |
---|---|---|---|
id | The FoxyCart customer id, useful for Single Sign On integrations. | Integer | Read only |
last_login_date | The date of the last time this customer authenticated with the FoxyCart checkout. | Date | Read only |
first_name | The customer's given name. | String | Optional. 50 characters or less. |
last_name | The customer's surname. | String | Optional. 50 characters or less. |
The customer's email address. This is used as the login to the FoxyCart checkout for this customer. | Required. 100 characters or less. | ||
tax_id | A tax identification number for this customer. | String | Optional. 50 characters or less. |
password | Your customer's clear text password. This value is never stored, not displayed for this resource, and is not available in our system. You can, however, pass it via clear text when creating or modifying a customer. When creating a customer, if you leave this blank, a random value will be generated for you which you can modify later as needed. | String | 50 characters or less. |
password_salt | The salt for this customer's login password. If your integration syncs passwords, you will need to keep this value in sync as well. | String | 100 characters or less. |
password_hash | The hash of this customer's login password. If your integration syncs passwords, you will need to keep this value in sync as well. | String | 200 characters or less. |
password_hash_type | This will be a copy of your store's current password_hash_type at the time of creation or modificaiton. This way, if you change your store's settings, your customer will still be able to login. It will be updated automatically to match that of the store the next time the customer logs in. | String | customer_password_hash_type |
password_hash_config | This will be a copy of your store's current password_hash_config at the time of creation or modification. This way, if you change your store's settings, your customer will still be able to login. It will be updated automatically to match that of the store the next time the customer logs in. | String | See the documentation for customer_password_hash_type you are using. |
forgot_password | If your customer forgot their password and requested a forgotten password, it will be set here. | String | 50 characters or less. |
forgot_password_timestamp | The exact time the forgot password was set. | Date | Read only |
is_anonymous | If this customer checks out as a guest, this will be set to true. Once it is set, it can not be changed. | Boolean | Read only after creation |
date_created | The date this resource was created. | Date | Read only |
date_modified | The date this resource was last modified. | Date | Read only |
Example Representation
{ "_links": { "curies": [ { "name": "fx", "href": "https://api.foxycart.com/rels/{rel}", "templated": true } ], "self": { "href": "https://api.foxycart.com/customers/115", "title": "This Customer" }, "fx:attributes": { "href": "https://api.foxycart.com/customers/115/attributes", "title": "Attributes for this Customer" }, "fx:store": { "href": "https://api.foxycart.com/stores/66", "title": "This Store" }, "fx:default_billing_address": { "href": "https://api.foxycart.com/customers/115/default_billing_address", "title": "Default Billing Address for this Customer" }, "fx:default_shipping_address": { "href": "https://api.foxycart.com/customers/115/default_shipping_address", "title": "Default Shipping Address for this Customer" }, "fx:default_payment_method": { "href": "https://api.foxycart.com/customers/115/default_payment_method", "title": "Default Payment Method for this Customer" }, "fx:transactions": { "href": "https://api.foxycart.com/stores/66/transactions?customer_id=115", "title": "Transactions for this Customer" }, "fx:subscriptions": { "href": "https://api.foxycart.com/stores/66/subscriptions?customer_id=115", "title": "Subscriptions for this Customer" }, "fx:send_webhooks": { "href": "https://api.foxycart.com/customers/66/send_webhooks", "title": "Refeed webhooks v2 for this Customer" }, "fx:customer_addresses": { "href": "https://api.foxycart.com/customers/115/addresses", "title": "Addresses for this Customer" } }, "last_login_date": null, "first_name": "Test", "last_name": "User", "email": "luke.stokes+apitest998@example.com", "password_salt": null, "password_hash": "4443fe50df6b177ba84b78dd91f0958a", "password_hash_type": "md5", "password_hash_config": null, "forgot_password": "blah", "forgot_password_timestamp": "2013-08-16T14:13:54-0700", "is_anonymous": false, "date_created": null, "date_modified": "2013-08-16T14:13:54-0700" }
<?xml version="1.0" encoding="UTF-8"?> <resource href="https://api.foxycart.com/customers/115" rel="https://api.foxycart.com/rels/customer"> <link rel="self" href="https://api.foxycart.com/customers/115" title="This Customer"/> <link rel="https://api.foxycart.com/rels/attributes" href="https://api.foxycart.com/customers/115/attributes" title="Attributes for this Customer"/> <link rel="https://api.foxycart.com/rels/store" href="https://api.foxycart.com/stores/66" title="This Store"/> <link rel="https://api.foxycart.com/rels/default_billing_address" href="https://api.foxycart.com/customers/115/default_billing_address" title="Default Billing Address for this Customer"/> <link rel="https://api.foxycart.com/rels/default_shipping_address" href="https://api.foxycart.com/customers/115/default_shipping_address" title="Default Shipping Address for this Customer"/> <link rel="https://api.foxycart.com/rels/default_payment_method" href="https://api.foxycart.com/customers/115/default_payment_method" title="Default Payment Method for this Customer"/> <link rel="https://api.foxycart.com/rels/transactions" href="https://api.foxycart.com/stores/66/transactions?customer_id=115" title="Transactions for this Customer"/> <link rel="https://api.foxycart.com/rels/subscriptions" href="https://api.foxycart.com/stores/66/subscriptions?customer_id=115" title="Subscriptions for this Customer"/> <link rel="https://api.foxycart.com/rels/send_webhooks" href="https://api.foxycart.com/customers/115/send_webhooks" title="Refeed webhooks v2 for this Customer"/> <link rel="https://api.foxycart.com/rels/customer_addresses" href="https://api.foxycart.com/customers/115/addresses" title="Addresses for this Customer"/> <last_login_date></last_login_date> <first_name>Test</first_name> <last_name>User</last_name> <email>luke.stokes+apitest998@example.com</email> <password_salt></password_salt> <password_hash>4443fe50df6b177ba84b78dd91f0958a</password_hash> <password_hash_type>md5</password_hash_type> <password_hash_config></password_hash_config> <forgot_password>blah</forgot_password> <forgot_password_timestamp>2013-08-16T14:13:54-0700</forgot_password_timestamp> <is_anonymous>false</is_anonymous> <date_created></date_created> <date_modified>2013-08-16T14:13:54-0700</date_modified> </resource>
{ "class": [ "customer" ], "properties": { "last_login_date": null, "first_name": "Test", "last_name": "User", "email": "luke.stokes+apitest998@example.com", "password_salt": null, "password_hash": "4443fe50df6b177ba84b78dd91f0958a", "password_hash_type": "md5", "password_hash_config": null, "forgot_password": "blah", "forgot_password_timestamp": "2013-08-16T14:13:54-0700", "is_anonymous": false, "date_created": null, "date_modified": "2013-08-16T14:13:54-0700" }, "links": [ { "rel": [ "self" ], "href": "https://api.foxycart.com/customers/115" }, { "rel": [ "https://api.foxycart.com/rels/attributes" ], "href": "https://api.foxycart.com/customers/115/attributes" }, { "rel": [ "https://api.foxycart.com/rels/store" ], "href": "https://api.foxycart.com/stores/66" }, { "rel": [ "https://api.foxycart.com/rels/default_billing_address" ], "href": "https://api.foxycart.com/customers/115/default_billing_address" }, { "rel": [ "https://api.foxycart.com/rels/default_shipping_address" ], "href": "https://api.foxycart.com/customers/115/default_shipping_address" }, { "rel": [ "https://api.foxycart.com/rels/default_payment_method" ], "href": "https://api.foxycart.com/customers/115/default_payment_method" }, { "rel": [ "https://api.foxycart.com/rels/transactions" ], "href": "https://api.foxycart.com/stores/66/transactions?customer_id=115" }, { "rel": [ "https://api.foxycart.com/rels/subscriptions" ], "href": "https://api.foxycart.com/stores/66/subscriptions?customer_id=115" }, { "rel": [ "https://api.foxycart.com/rels/send_webhooks" ], "href": "https://api.foxycart.com/customers/115/send_webhooks" }, { "rel": [ "https://api.foxycart.com/rels/customer_addresses" ], "href": "https://api.foxycart.com/customers/115/addresses" } ] }
Zoomable Resources
The following related resources can be embedded within this resource by including a ?zoom=<child_resource>
parameter. You can also filter by child resources by ?child_resource:property=<property_value>
attributes
default_billing_address
default_shipping_address
default_payment_method
customer_addresses