List Listings
List all listings available on current store
GET
/b2b/list_listing.json
To use this api your shop need to have the B2B module enabled
List all listings available on current store
GET
/b2b/list_listing.json
$storeden = new Storeden\Storeden($config);
$result = $storeden->get('/b2b/list_listing.json');
[
{
"id": "62cc44ffd4029d4f1c7bbd91",
"customers_group": "62cc44ffd4029d4f1c7bbd92",
"description": "",
"name": "EntepriseB2B"
},
{
"id": "62cd232dd4029d3d1c7bbd8c",
"customers_group": "62cd232dd4029d3d1c7bbd8d",
"description": "",
"name": "VIP Customers"
},
...
]
List all orders updated in a defined time-span
Please note that create a new listing create a new custom produtct attribute suffixed with " - price" and a new customer group
POST
/b2b/listing.json
name required(string) | Specify the customer group name |
description (string) |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['name'] = 'Vip Customer',
$payload['description'] = 'Vip customer, based on company rules';
$result = $storeden->post('/b2b/listing.json', $payload);
{
"id": "62cd3144d4029ddc1e7bbd8a",
"customers_group": "62cd3144d4029ddc1e7bbd8b",
"description": "Vip customer, based on company rules",
"name": "VIP Customers"
}
Remove listing
Please note that removing a listing will preserve the customer group ( without listing associate ) and the product attribute will be removed
DELETE
/b2b/listing.json
id required(Storeden ID) |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['id'] = '62cd3144d4029ddc1e7bbd8a',
$result = $storeden->delete('/b2b/listing.json', $payload);
{
"customers_group": {
"id": "62cd1e7ed4029d3c1c7bbe41",
"listing": {
"removed": true
}
},
"listing": {
"id": "62cd3144d4029ddc1e7bbd8a",
"attribute": {
"removed": true
}
}
}
Create a new b2b access
POST
/b2b/user.json
email required(string) | |
fullname required(string) | |
customer_group_id required(string) | |
send_email (string) | Set this field to "yes" to send welcome email to user |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['email'] = 'test@domain.tld',
$payload['fullname'] = 'Mario Rossi',
$payload['customer_group_id'] = '62cd232dd4029d3d1c7bbd8d',
$result = $storeden->post('/b2b/user.json', $payload);
{
"user": {
"created": true,
},
"customer_group":{
"associated": true
}
}
List all account
GET
/b2b/users_list.json
$storeden = new Storeden\Storeden($config);
$payload = array();
$result = $storeden->get('/b2b/users_list.json', $payload);
{
"count": 37,
"users": [
{
"id": 1309180,
"email": "test-email1@email.tld",
"registration_date": "2019-04-03T16:41:57+02:00",
"registration_status": "ask-for-removal"
},
{
"id": 1325570,
"email": "test-email2@email.tld",
"registration_date": "2019-04-15T11:58:26+02:00",
"registration_status": "active"
},
...
}
Remove a specific account
DELETE
/b2b/user.json
email required *(string) | * one of email or uid is required |
uid required *(int) | |
customer (string) | Specify "delete" to complete remove the Customer profile, if not specified the customer will be moved into "guest" state |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['uid'] = 1309180,
//$payload['email'] = 'test@domain.tld',
$payload['customer'] = 'delete',
$result = $storeden->delete('/b2b/user.json', $payload);
{
"ok": 1,
"n": 1,
"err": null,
"errmsg": null,
"customer": {
"action": "deleted",
"customer_id": "6481c472d4029d560a7b23d3"
}
}