Setting up a store consists of creating a store and adding employees to it.
Important
We assume that you have an authentication token stored in the
AUTH_TOKENvariable. Retrieve one with the following call:export AUTH_TOKEN=$(curl -s <url>/v0/token -d \ "grant_type=password&username=<myusername>&password=<mypassword>" | jq -r.access_token)
Note
To set up a warehouse for your business, see this tutorial.
Creating a store
This store is based in NYC. It's open all days of the week except Monday.
To create a store, use the create store method.
Important
Once you create a store for your business in NewStore, you cannot delete it from the platform. However, if needed, you can use NewStore Omnichannel Manager to disable a store from fulfilling orders in your business.
Save the following sample as data.json.
{
"active_status": true,
"label": "001_US_ABC_Street",
"store_id": "store1_NYC",
"business_hours": [
{
"from_time": "09:00",
"to_time": "20:00",
"weekday": 0
},
{
"from_time": "09:00",
"to_time": "20:00",
"weekday": 2
},
{
"from_time": "09:00",
"to_time": "20:00",
"weekday": 3
},
{
"from_time": "09:00",
"to_time": "20:00",
"weekday": 4
},
{
"from_time": "09:00",
"to_time": "20:00",
"weekday": 5
},
{
"from_time": "09:00",
"to_time": "20:00",
"weekday": 6
}
],
"catalog": "storefront-catalog-en",
"division_name": "US",
"gift_wrapping": false,
"locale": "en-us",
"tax_included": true,
"phone_number": "202-555-0138",
"physical_address": {
"address_line_1": "12 ABC Street",
"city": "New York",
"country_code": "US",
"latitude": 40.7256956,
"longitude": -74.0023217,
"state": "NY",
"zip_code": "10001"
},
"pricebook": "default",
"shipping_address": {
"address_line_1": "12 ABC Street",
"city": "New York",
"country_code": "US",
"state": "NY",
"zip_code": "10002"
},
"timezone": "America/New_York",
"delivery_zip_codes": [],
"display_price_unit_type": "net"
}Note
The
timezoneproperty only allows timezone values that comply with the tz database. For example, specifyAmerica/New_Yorkinstead ofEST.The
catalogproperty is the name of the catalog that contains products, categories and price books used in the store.The
pricebookproperty is the identifier of the price book that will be used in the store. The price book you specify here must be included in the catalog that is configured in thecatalogproperty. See how to create products, categories and price books in Tutorial: Importing products.The currency of the store is that of the price book defined in the
pricebookproperty.
Run:
curl -X POST \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $AUTH\_TOKEN" \
-d @data.jsonImportant
The store is created but there is no stock data for it yet, which prevents any routing to be fulfilled by the store. Please see Creating stock data to enable routing.
Import products, price books, and stock information for the store. See Tutorial: Importing products.
Configure order ID parameters to enable unique IDs to be assigned to orders in NewStore Omnichannel Cloud.
The geo coordinates of the store set in the request will be used to calculate distances from a reference address to retrieve the in-store pickup options. See Tutorial: Setting up an in-store pickup configuration.
Adding employees to the store
This step is done by the NewStore team. After employees are created and assigned to a store, you're ready to import stock into the store. See Creating stock data.
The store is created but it must have at least one active associate to enable it to fulfill orders.
A following optional step consists in creating one or more stock locations for the store to manage inventory.
Fiscal activation of the store
In countries where software fiscal regulations apply, a store must be fiscally activated before orders can be created via NewStore Associate app. For more details, see Fiscal activations.
In countries where hardware fiscal regulations apply, a fiscal printer must be set up in the store. For more information, see (Optional) Setting up a fiscal printer.
(Optional) Creating stock locations
A stock location allows us to manage which items should be sold, and which should not. To see an overview of stock locations, see Stock locations.
You need to have at least one salable location per store. Currently, the only one that supports it is main so you need to create it.
Now, create a new stock location for damaged items that are unsalable.
Create the stock location using the create stock location method.
A stock location has a name to identify it and a
salableproperty that defines whether the stock in that location is considered salable.Set the
salableproperty for this stock location asfalseto exclude the items it contains from the stock on hand.For example, name the locationdamagedto indicate that it holds unsellable inventory.Use the following as the body of the request:
{ "name": "damaged", "salable": false }Call the create stock location method:
curl -X POST "https://dodici.x.newstore.net/v0/stock_locations" \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer {string}" \ -d @request_bodyNote
You can get a token using the call at the top of the page.
The damaged stock location is now set up for the store. You can move damaged items from the main stock location to this stock location to remove them from stock on hand calculations by contacting the support team.
Related topics