Used Newie, our AI search tool in the docs? Take a 2-minute survey to rate your experience!

Tutorial: Setting up a store

Prev Next

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_TOKEN variable. 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 timezone property only allows timezone values that comply with the tz database. For example, specify America/New_York instead of EST.

  • The catalog property is the name of the catalog that contains products, categories and price books used in the store.

  • The pricebook property 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 the catalog property. 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 pricebook property.

Run:

curl -X POST \
     -H 'Content-Type: application/json' \
     -H "Authorization: Bearer $AUTH\_TOKEN" \
     -d @data.json

Important

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.

  1. Create the stock location using the create stock location method.

    A stock location has a name to identify it and a salable property that defines whether the stock in that location is considered salable.

    Set the salable property for this stock location as false to exclude the items it contains from the stock on hand.For example, name the location damaged to indicate that it holds unsellable inventory.

    Use the following as the body of the request:

    {
      "name": "damaged",
      "salable": false
    }
  2. 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_body

    Note

    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