Storeden Developers

B2B API

Current version: v1.1

To use this api your shop need to have the B2B module enabled

List Listings

List all listings available on current store

GET
/b2b/list_listing.json
List Listings Request

$storeden = new Storeden\Storeden($config);
$result = $storeden->get('/b2b/list_listing.json');
					
List Listings Response

					[
    {
        "id": "62cc44ffd4029d4f1c7bbd91",
        "customers_group": "62cc44ffd4029d4f1c7bbd92",
        "description": "",
        "name": "EntepriseB2B"
    },
    {
        "id": "62cd232dd4029d3d1c7bbd8c",
        "customers_group": "62cd232dd4029d3d1c7bbd8d",
        "description": "",
        "name": "VIP Customers"
    },
	...
]
					

Create Listing

List all orders updated in a defined time-span

Notice !

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)
Create Listing Request

$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);
					
Create Listing Response

					{
    "id": "62cd3144d4029ddc1e7bbd8a",
    "customers_group": "62cd3144d4029ddc1e7bbd8b",
    "description": "Vip customer, based on company rules",
    "name": "VIP Customers"
}
					

Remove Listing

Remove listing

Notice !

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)
Remove Listing Request

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

$payload = array();
$payload['id'] = '62cd3144d4029ddc1e7bbd8a',

$result = $storeden->delete('/b2b/listing.json', $payload);
					
Remove Listing Response

{
    "customers_group": {
        "id": "62cd1e7ed4029d3c1c7bbe41",
        "listing": {
            "removed": true
        }
    },
    "listing": {
        "id": "62cd3144d4029ddc1e7bbd8a",
        "attribute": {
            "removed": true
        }
    }
}
					

Create B2B Access

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
Create b2b access Request

$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);
					
Create b2b access Response

{
    "user": {
        "created": true,
	},
	"customer_group":{
		"associated": true
	}
}