Integrations & API
ProSmart: stock sync
How BunStack reads stock from ProSmart: the formula, a sync by hand, the automatic sync every 15 minutes in Production and what overwrites your stock.
The stock sync writes ProSmart's stock and weight to the variants in BunStack.
Where: Stack › ProSmart (Sync stock now) and the inventory page (Sync from ProSmart).
Run a sync
- Open Stack › ProSmart or the inventory page.
- Press Sync stock now or Sync from ProSmart.
Both buttons run the same sync. The integration page and the inventory page show the progress. Last sync on the integration page shows when the last sync ran.
How the stock is counted
For every variant with a SKU, BunStack reads the article in ProSmart and writes two values:
| Value in BunStack | From ProSmart |
|---|---|
| Stock | ProSmart's available quantity minus the units on paid orders that have not been sent to ProSmart. Never below 0. |
| Weight | The article's weight, when ProSmart has one. |
ProSmart's available quantity is the stock minus what open customer orders in ProSmart reserve, from every sales channel.
- The units on a paid order left BunStack's stock when the order was placed. ProSmart does not know about them until the order has been sent there.
- An order that has been sent to ProSmart reserves there. It is already in the available quantity.
- A paid order counts as open until the whole order is marked as shipped. A partly shipped order that has not been pushed subtracts all its lines.
- A line counts as sent when a push in the same environment lists it. A push without an answer from ProSmart does not count until you have checked it.
Warning: The next sync overwrites stock you type on the inventory page for a variant with a SKU. Change the stock in ProSmart.
The sync writes only the stock. The stock mode and the stock threshold stay: a variant in the mode Out of stock is not sold even when the sync gives it stock, and the storefront sells only the stock above the threshold. See Stock.
Limits
| Limit | Value |
|---|---|
| SKUs per batch | 200 |
| New attempts on 429 or 5xx for an article | 2 |
| Errors in a row that stop the sync | 15 |
| Syncs per workspace at the same time | 1 |
| Sync that counts as stuck | 30 minutes after start. The next start closes it as failed. |
- A sync reads from the same environment the whole time: the one in use when it started.
- BunStack reads each SKU's stock and writes only if it has not changed meanwhile. When an order comes in between, BunStack reads the SKU again, at most 3 times. After that it counts as an error and the next sync corrects it.
The result
The inventory page and the integration page show the result with counters:
| Counter | Means |
|---|---|
| Updated stock | The stock changed. |
| Updated weights | The weight changed. |
| Unchanged | Nothing changed, including articles without stock in ProSmart. |
| Missing in ProSmart | The SKU is not an article number in ProSmart. |
| Errors | ProSmart did not answer or gave an error. |
A sync that failed shows the reason and how far it got. The Activity tab lists the 20 latest syncs.
Automatic stock sync
Sync stock automatically runs the stock sync every 15 minutes. The box is in the Stock · Production only part under Stack › ProSmart › Settings. It is off until you turn it on and save.
- Open Stack › ProSmart › Settings with Production chosen.
- Tick Sync stock automatically.
- Press Update connection.
BunStack now reads the stock from Production every 15 minutes.
- The automatic sync counts like Sync stock now, but always reads Production.
- It runs only when Production is in use and ProSmart has accepted the saved login for Production.
- When Test is in use, the box is greyed out and the reason is below it. The practice company's stock must never overwrite the storefront's. The setting stays until Production is in use again.
- When ProSmart does not accept the login for Production, Paused shows below the box. Nothing runs until ProSmart accepts the login, for example after Check stored Production login or new keys.
- When a sync is running, automatic or by hand, the automatic sync skips its turn. When you press Sync stock now during an automatic sync, the integration page shows its progress.
- After a failed automatic sync the next one waits 1 hour instead of 15 minutes. The bell gets the Automatic stock sync failed notification with the reason, at most one per workspace and day.
- Below the box is the last automatic sync: when it ran and how it ended. The overview shows Stock sync as every 15 min, on demand or paused with the reason. The Activity tab shows the automatic syncs with trigger scheduled.
Warning: With Sync stock automatically on, the sync overwrites the stock on the inventory page within 15 minutes for variants with a SKU. Change the stock in ProSmart.