Storeden Developers

Customers API

Current version: v1.1 beta
Last Update: 2020/11/02

Customers are users (registered or not) who have interacted with your store, making orders or registering.

Customers List

GET
/clients/list.json
PARAMETERS LIST
created_at_from (unix timestamp) Return all customers where customer creation date is greater than {timestamp}. Must be used with created_at_to
created_at_to (unix timestamp) Return all customers where customer creation date is lower than {timestamp}.Must be used with created_at_from
updated_at_from (unix timestamp) Return all customers where customer update date is greater than {timestamp}.Must be used with updated_at_to
updated_at_to (unix timestamp) Return all customers where customer update date is lower than {timestamp}.Must be used with updated_at_from
nodes (string) Return available entity node, separated by ',': eg: nodes=custom_fields,fullname
List customers Request

$storeden = new Storeden\Storeden($config);
$customers_list = $storeden->get('/clients/list.json');
					
List customers Response

[
	{
		"fullname": "John Smith",
		"email": "john-smith@domain.tld",
		"last_name": "Smith",
		"first_name": "John",
		"created_at": "2018-07-14T09:28:52+02:00",
		"id": "5b49a6a4deddac755c8cee7a",
		"userUID": 0,
		"accept_marketing": false
	},
	...
]
						

Get Customer Details

View all information about a specified customer

GET
/clients/client.json?id={customer-id}
PARAMETERS LIST
id required* (StoredenId) Unique id of customer.
email required* (string) Email of your customer.
* one of this fields required
Get customers Request

$storeden = new Storeden\Storeden($config);
$customer_data = $storeden->get('/clients/client.json?id=5b49a6a4deddac755c8cee7a');

/** OR **/

$storeden = new Storeden\Storeden($config);
$customer_data = $storeden->get('/clients/client.json?email=john.smith@domain.tld');
					
Get customers Response

{
    "fullname": "John Smith",
    "website": "https://domain.com",
    "email": "john.smith@domain.tld",
    "phone": "+1 007 007 007",
    "mobile": "+10 07 007 007",
    "address": "3411 Las Vegas Blvd. South",
    "city": "Las Vegas",
    "zip": "NV89109",
    "state": "Nevada",
    "country": "254",
    "code": "",
    "userUID": 120007,
    "id": "5b49a6a4deddac755c8cee7a"
}
					

Add a new customer

POST
/clients/client.json
PARAMETERS LIST
fullname required (string)
email required (string) If already exists in your customer database will throw an error
website (string)
phone (string)
mobile (string)
address (string) Full address included apt number
city (string)
zip (string) Specify a valid postal code. Will be validated against country postal code rules
country (uid) A valid country uid
state (uid) Specified state must be a state of specified country. Otherways an error will be thrown
tax_number (string)
metadata (associative array) Sub values:
sdi: Italia Digitial Invoice code
pec: Italian Certified Email address
note (string) April 24th, 2019 Custom Text for customer's data
Create customer Request

$storeden = new Storeden\Storeden($config);

$customer_data = array();
$customer_data['fullname'] = 'John Smith';
$customer_data['email'] = 'john.smith@domain.tld';
// etc..

$result = $storeden->post('/clients/client.json', $customer_data);
					
Create customer Response

{
    "client": {
        "id": "569d08bb16f46ac71e7b23c6"
    }
}
					

Update customer data

PUT
/clients/client.json
PARAMETERS LIST
id required (StoredenID)
fullname (string)
phone (string)
address (string) Full address included apt number
city (string)
zip (string) Specify a valid postal code. Will be validated against country postal code rules
region (string) State/Region
state (string) Country name
tax_number (string)
note (string) April 24th, 2019 Custom Text for customer's data
Update Customer Request

$storeden = new Storeden\Storeden($config);

$customer_data = array();
$customer_data['id'] = '569d08bb16f46ac71e7b23c6';
$customer_data['note'] = 'Customer description';
$customer_data['fullname'] = 'John Smith';
// etc..

$result = $storeden->put('/clients/client.json', $customer_data);
					
Update Customer Response

{
    "ok": 1,
    "nModified": 1,
    "n": 1,
    "err": null,
    "updatedExisting": true
}
					

Remove customer from list

Permanently delete customer from your customers list.

DELETE
/clients/client.json
PARAMETERS LIST
id required (string)
Remove customer Request

$storeden = new Storeden\Storeden($config);
$result = $storeden->delete('/clients/client.json', ['id' => '569d08bb16f46ac71e7b23c6']);
					
Remove customer Response

{
    "ok": 1,
    "err": null,
}