Storeden Developers

Customers API

Current version: v1.1 beta
Last Update: 2019/09/25

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

Customers List

GET
/clients/list.json
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"
    }
}
					

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,
}