# Setup

Audience: Logistics Manager

Installing the Shopify app and connecting your first Pyck tenant

Setting up is one step: connect one Pyck tenant. Before any store data reaches Pyck, you also choose how the warehouse gets its schemas and switch it on, as described in [Switch the warehouse on](#switch-the-warehouse-on). Everything else on this page is optional and can wait.

## 1. Install the app

Install the Pyck app into your Shopify store the way you install any Shopify app. Shopify will ask you to approve the permissions it needs: reading and writing products, customers, orders, draft orders, inventory and fulfilments, and reading locations.

After the install, the app opens on its **Setup** page, headed "Connect your store to Pyck". Connecting is the only thing needed to finish setup, and it takes about two minutes. Until you finish it, nothing syncs. Finishing it does not start the sync either: the warehouse starts switched off until you switch it on.

When you sign in, a row at the top of the page counts the three steps of connecting: **Sign in**, **Pick warehouse** and **Done**. It moves to **Pick warehouse** while you choose a tenant. If you paste an API key because your Pyck system has no sign-in, the row is not shown. The remaining setup steps are in the setup guide on **Overview** once the store is connected.

Under the card, **Setup guide** opens this page in a new tab and **Contact support** starts an email to <support@pyck.io>.

## 2. Connect your first tenant

The Setup page asks for one Pyck tenant. There are two ways to give it one.

### Sign in with Pyck

Choose **Sign in with Pyck**. You sign in to Pyck in a new tab, come back, pick which of your Pyck tenants this store belongs to and choose **Connect** with that tenant's name. A second tab opens to confirm. The app creates the credentials for you.

The app connects to Pyck's production system unless you choose otherwise. To use a test or demo system instead, open **Use a test or demo system** below the divider first and pick it under **Pyck system**. The sign-in button then names the system it will use, for example **Sign in with Pyck (Demo)**.

This is the easier route and the one to use when your Pyck system offers it.

### Paste an API key

If your Pyck system has no sign-in registered, the app asks for an API key straight away. If it has one but the sign-in is not cooperating, choose **Connect with an API key instead**. You then give the app two things:

* the Pyck system, chosen under **Use a test or demo system**. If yours is self-hosted, choose **Other address…** and enter its full GraphQL address under **Address**.
* your Pyck **API key**

Then choose **Connect with this key**.

Either way you end up with the same thing: one warehouse.

## 3. Setup is now complete

The warehouse you just made is called **production**. It is your live warehouse: the only warehouse that fulfils orders and the only one allowed to change your Shopify stock.

The name `production` is permanent: a warehouse's label cannot be changed once it is added.

The moment it is saved:

* Setup is complete and the app's menu changes to **Overview**, **Warehouses**, **Stock sync**, **Activity** and **Settings**.
* **Products, customers and orders are all switched on** under **Settings**, in the **Sync scope** card.
* **The warehouse itself starts switched off.** It receives nothing yet, so no store data reaches Pyck before you have set it up.

Saving the warehouse gives Pyck only what it needs to call back into your store: your callback details and the `shopify_config_v1` schema (a Pyck `DataType`) they are stored in. It also creates `shopify_file_v1`, the schema every product image and file is written as. It does **not** create the schemas the app writes products, customers and orders into. Whether your tenant gets those is your decision, so the warehouse is badged **Choose schema** under **Warehouses** at first.

To create them, open **Warehouses**, open the warehouse and answer **Choose how this warehouse gets its schemas** with **Create the standard schemas** (see [Choose how the warehouse gets its schemas](#choose-how-the-warehouse-gets-its-schemas)). **Check connection** is greyed out while the warehouse is switched off, so it only becomes available once you have switched the warehouse on. Until the schemas exist, records sent to a warehouse in Auto mode fail in **Activity** with `DataType … not found`.

You can turn any of the three off under **Settings**, in the **Sync scope** card. Products, customers and orders each sync as you would expect.

### Only send orders from some locations

If your store ships from several Shopify locations but only some of them are run through Pyck, you can limit which orders Pyck gets. Under **Settings**, in the **Sync scope** card, the **Orders** switch has two choices below it:

* **Orders from every location**: every order is sent. This is the default and how the app has always worked.
* **Only orders for these locations**: tick the Shopify locations whose orders Pyck should get. An order is sent when any of its items is assigned to one of these locations. Then choose **Save**.

When an order matches, **the whole order is sent**, with every line, including items assigned to locations you did not tick. The order in Pyck stays the order the customer placed.

**Orders already in Pyck keep updating**, whatever location they are at now. If Shopify moves an order to another location, or you untick its location later, its cancellation or edit still reaches the warehouse. The choice decides which orders start reaching Pyck, never which ones stop.

A few things to know about the list:

* Every Shopify location is listed, including inactive ones, marked "(inactive)", so a location you chose never drops out of the list.
* A location you chose that Shopify no longer has is shown as "Unknown location (no longer in Shopify)". Untick it and save to remove it.
* **Save** stays greyed out while **Only orders for these locations** is chosen with nothing ticked: "Choose at least one location."
* While **Orders** is switched off, the choice is kept but cannot be changed: "Applies once Orders is switched on."
* If Shopify does not return your locations, the page says "Shopify did not return your locations. The current choice is kept; try again later." The choice is shown but cannot be changed, and you can still save the **Products**, **Customers** and **Orders** switches.

Changing the choice does not send anything by itself. An order that was left out reaches Pyck the next time it changes in Shopify, or straight away with **Sync now** on the **Overview** page.

An order left out by this choice appears in **Activity** as skipped, under the **All** filter. A **Sync now** run does not list them one by one; it counts them instead, for example "12 orders left out: not at a location this store syncs." See [An order is not appearing in Pyck](https://docs.pyck.cloud/shopify/troubleshooting.md#an-order-is-not-appearing-in-pyck).

### Choose how the warehouse gets its schemas

Open **Warehouses** and open `production`. Until it has an answer, its page starts with a card, **Choose how this warehouse gets its schemas**, with two answers:

* **Create the standard schemas**: the app creates its standard Shopify schemas in your Pyck tenant and fills them. Schemas that already exist there are left as they are. Choose this unless your Pyck tenant uses schemas of its own.
* **I'll map my own**: nothing is created in Pyck. Set up the [data mapping](https://docs.pyck.cloud/shopify/data-mapping.md) next, before you send everything: the first send writes into whatever mapping is active. Until then, the **Data mapping** section of a switched-off warehouse reminds you to map your schemas before switching it on.

You answer once per warehouse. The card then goes away, and any later change goes through **Data mapping**. If the standard schemas cannot be created, the card shows why and stays, so you can try again. A warehouse without an API key is told to save one first, because the schemas are created in Pyck.

### Switch the warehouse on

Switching on waits for the answer: while the question is open, the **Switch on** button under **Danger zone** is greyed out and says "Choose how this warehouse gets its schemas first." Once it is given, choose **Switch on and go live…** under **Danger zone** and confirm. From then on products, customers and orders flow to Pyck as they change in Shopify.

You can answer the same question, and switch the warehouse on, without leaving **Overview**: the **Get your warehouse ready** step of the setup guide offers both. See [The setup guide on Overview](#the-setup-guide-on-overview).

Until a warehouse is switched on, the app says so:

* **Overview.** The setup guide opens on **Get your warehouse ready**, which says the warehouse "is switched off and receives nothing yet". The guide speaks for that warehouse, so the box at the top of the page does not repeat that it is switched off or waiting for its schema choice. The box appears only for what the guide does not cover, for example another warehouse whose question is still open: "*label* is switched off until you choose how it gets its schemas.", with **Choose** to open that warehouse. **Sync now** is greyed out while every warehouse is switched off, because it would send nothing. In the **Warehouses** tile, a warehouse whose question is still open is badged **Choose schema**.
* **Warehouses.** Each warehouse whose question is still open is badged **Choose schema**: "Switched off until you choose how this warehouse gets its schemas." While no warehouse is switched on, the banner says that production is switched off, "so nothing is sent to Pyck and nothing comes back." If production's question is still open, it asks you to open production, choose how it gets its schemas, then switch it on.

Running setup again, or giving the warehouse a new key later, does not switch it on or off and does not ask the schema question again.

Product variants without a SKU are never sent. Pyck finds stock by SKU, so a variant without one has nothing to match against.

### The setup guide on overview

Once you have connected, the app opens on **Overview**. A short message says "Connected to *name*", with your Pyck tenant's name, or "Connected to Pyck". It appears once: reloading the page does not show it again.

At the top of the page sits the setup guide, **Finish setting up Pyck**. Under the title it says what is left, for example "Your store is connected. Three steps are left, one of them optional.", and a progress bar counts the steps, for example "1 of 4 done". One step is open at a time. When you finish a step, the next one opens by itself, and you can open or close a step with the arrow on its right.

1. **Connect your warehouse** is ticked already, with "*name* · connected".
2. **Get your warehouse ready** asks how the warehouse gets its schemas, the same question as on the warehouse's page:
   * **Standard Shopify schemas** (badged **Recommended**). Choose **Create the standard schemas**. The app creates them in Pyck.
   * **My own schemas**, for a Pyck tenant that already has schemas. Choose **Use my own schemas**. Nothing is created in Pyck.

   Answering does not switch the warehouse on. The step then offers **Switch on**. For production, it opens the same go-live confirmation as **Switch on and go live…** on the warehouse's page, and nothing is switched on until you confirm there. With your own schemas, **Switch on** stays greyed out until the [data mapping](https://docs.pyck.cloud/shopify/data-mapping.md) names a schema for items, customers and picking orders. Switched on without one, the warehouse would have nowhere to write. Choose **Open data mapping** to set it up. Only the guide waits for the mapping: the warehouse's own page asks only for the schema choice. Once the warehouse is switched on, the step is ticked with "Standard schemas · switched on" or "Your own schemas · switched on".

   With several warehouses and none of them set as production, the step says "None of your warehouses is set as production." and offers **Open Warehouses**. Any warehouse that is switched on, with its schema question answered, then ticks the step.
3. **Send your catalog to Pyck** waits for the warehouse and reads "Once the warehouse is on" until then. It says what will be sent, for example "Send the 1,210 product variants, 3,402 customers and 812 orders you already have, once.", offers **Check Shopify metafields** (see below) and **Send everything now**. That opens the same confirmation as **Sync now**. The step is ticked once a run over everything has sent something. A run limited to the last few days does not tick it, because it leaves older records out. Neither **Check connection** nor **Clear log** under **Activity** changes the tick. If you already sent everything with an earlier version of the app, the step is ticked from the start.
4. **Sync stock from Pyck** (badged **Optional**) covers pairing your Shopify locations and choosing how Pyck updates the counts, because both happen on the **Stock sync** page. Its line says how far you are, for example "1 of 2 locations paired · stock sync off", or "waiting for the first stock sync" once the mode is chosen. Choose **Open Stock sync** to get there. The step is ticked once a location is paired and stock sync is on and has run. See [Warehouse stock](https://docs.pyck.cloud/shopify/stock.md).

The **…** menu at the top right of the guide has two entries:

* **Skip stock sync** marks the last step **Skipped**, which counts toward the steps done. Choose it if you keep your stock counts in Shopify. If you pair a location later, the step comes back.
* **Dismiss guide** removes the guide for good.

The guide also goes away by itself once every step is ticked or skipped. Once the catalog has been sent, switching the warehouse off later does not bring the guide back.

While the guide is on the page:

* The box at the top of the page appears only for what the guide does not cover. See [The Overview page](https://docs.pyck.cloud/shopify.md#the-overview-page).
* The **In Pyck** tile reads "Nothing sent yet. Your catalog arrives after "Send everything now"." until the catalog has been sent. Before that, the tenant's totals could be another store's data, or data from an earlier setup. The tile keeps saying this if you dismiss the guide before sending, then naming **Sync now** instead.
* **Activity** appears once the catalog has been sent. Until then it would list only setup itself.

## 4. Bring your existing catalog over

New and changed records flow automatically, but records that already existed before you installed the app have never been sent. To send them once, choose **Sync now** on the **Overview** page, or **Send everything now** in the setup guide's **Send your catalog to Pyck** step.

Switch the warehouse on and create its schemas first (see above), or the records have no schema to go into.

This walks your whole store and sends everything currently switched on. **Activity** then lists what did not land. To see every attempt, including the successful ones, choose **Record every attempt** there.

### Check what will be sent

Neither button sends anything straight away. Each opens a dialog, **Send everything to Pyck?**, which first reads "Counting what will be sent…" while the app counts your store live in Shopify. It then shows what the run will do:

* **Products**, **Customers** and **Orders**, each marked **On** or **Off**. A type that is off reads, for example, "Switched off in Settings, so no customers are sent."
  * **Products** says how many items will be sent, one for each variant with a SKU, and how many variants have no SKU and are skipped.
  * **Customers** says how many customers will be sent.
  * **Orders** says how many orders will be sent, with three details:
    * **Time window.** Usually "Last 60 days": Shopify only lets the app read orders from the last 60 days, so older orders are not sent. If Shopify has given the app access to all orders, it reads "Every order in your store".
    * **Older than 14 days.** How many of those orders are more than 14 days old, for example "12 of 40". This is for your information only. These orders are still sent.
    * **Locations.** "Every location", or the locations your order location filter under **Settings** allows. With a filter, orders at other locations are left out. Shopify cannot count orders by location in advance, so the number still includes them and reads "Up to 40 orders will be sent." Orders already in Pyck are sent either way.
* **Sent to** lists each warehouse that is switched on, with its role, **Production** or **Test copy**. A test copy gets anonymised customer data. It also receives test orders, but can never mark an order as fulfilled.
* **Good to know** reminds you that everything is sent again, not only what changed since the last sync, and that sync stays switched on afterwards for the types that are on.

Only **Send now** starts the run. **Cancel**, or closing the dialog, sends nothing.

If nothing would be sent, the dialog is titled **Nothing to send** and only offers **Close**. It says why: "Products, customers and orders are all switched off. Switch on what should be sent in Settings." or "No warehouse is switched on. Switch one on in Warehouses."

If the count fails, the dialog shows "Could not count what would be sent" with Shopify's reason, or "Could not reach the app. Check your connection and try again." when the request never reached the app. Nothing has been sent. Choose **Try again** to count again, or **Cancel**.

### Check your Shopify metafields first

The first send fills only the metafields your production warehouse's schemas already carry. A metafield added afterwards gets its values only when the record next changes, or on the next full send. So before you send, the setup guide's **Send your catalog to Pyck** step offers **Check Shopify metafields**. It lists the metafields of your store that would not reach Pyck (file metafields are uploaded anyway and are not listed). Products, customers or orders that use a custom mapping are left out, since there a metafield reaches Pyck only through the mapping. For each one, choose:

* **Add** to add it to Pyck's schemas, or **Add all** to add every listed field at once. Each add publishes a new version of the schema.
* **Keep out** for a field Pyck should not receive, for example an internal or personal one. It is no longer offered or counted, and is listed under "Kept out of Pyck" with **Bring back** to undo that. Keeping a field out changes nothing in Pyck.

Nothing is added without you choosing it. The check is only offered when the production warehouse is switched on and has a key.

Run the send once after setup. After that, ordinary changes keep Pyck up to date on their own.

## What is optional from here

Nothing below is required, and none of it is switched on by default.

| If you want to | Go to |
| --- | --- |
| Fill fields of your own Pyck schemas from Shopify, or keep them under Pyck's control | [What a sync overwrites in Pyck](https://docs.pyck.cloud/shopify/data-mapping.md) |
| Send only the orders of the Shopify locations Pyck runs | [Only send orders from some locations](#only-send-orders-from-some-locations) |
| Sync to more than one Pyck tenant | [Sending data to several Pyck tenants](https://docs.pyck.cloud/shopify/routing.md) |
| Let Pyck own your Shopify stock counts | [Warehouse stock](https://docs.pyck.cloud/shopify/stock.md) |
| Check a warehouse is healthy | **Warehouses**, open the warehouse, then **Check connection** |

Deleting your last warehouse reopens setup, and syncing stops until you connect one again.
