Integrations & API
ProSmart: connect and environments
Connect ProSmart in Test or Production: the fields, the login check, switching environment, Kustom test orders and disconnecting.
Here you connect ProSmart and choose Test or Production.
Where: Stack › ProSmart › Settings.
Connect ProSmart
- Get Client ID and Client Secret from ProSmart. Test and Production each have their own client secret.
- Open Stack › ProSmart › Settings.
- Choose Test or Production.
- Fill in the fields in the table below.
- Press Connect ProSmart.
The status becomes CONNECTED when ProSmart gives BunStack a token. Otherwise it becomes ERROR, with the reason.
| Field | What you enter |
|---|---|
| ProSmart tenant | The tenant name in ProSmart, for example FORETAGET. |
| Customer number (kundnr) | The customer BunStack books the orders on in the environment. A whole number. See Customer number per country. |
| Customer per country | Optional. A customer of its own per recipient country. |
| API base URL | Prefilled per environment. Change it only if ProSmart gives you another address. |
| Freight article number | Optional. The article BunStack books the shipping on. An empty field gives no freight line. |
| Client ID, Client Secret | From ProSmart, one set per environment. The client ID can be the same in both. |
- Production uses
https://prosmartapi.se/prosmartapi/api. - Test uses
https://prosmartadc.se/prosmartapi/api, which is ProSmart's practice company. - BunStack accepts only https addresses on prosmartapi.se and prosmartadc.se.
- You do not need the username and password for ProSmart's web app.
- The button reads Update connection when the environment is already connected. Leave the secret fields empty when you change other fields.
Test and Production
Each environment has its own address, tenant, customer number and keys. The environment you save is the one in use. BunStack sends orders there and reads stock from there.
- The button reads Save and switch to Test or Save and switch to Production when you save the environment that is not in use.
- The integration page shows TEST when Test is in use.
- Switch back by choosing the environment and saving. The keys stay, so leave the fields empty.
- Test and Production each have their own customer register and article register. An article in Production can be missing in Test.
- A push to Test is not a push to Production. The same order can be sent to both. The block against duplicates applies within one environment.
- Test pushes are marked TEST on the order and on the Activity tab.
- Switching environment changes no order. The flags on the orders stay.
Warning: Test cannot have the same address and the same tenant as Production. Test orders would then reach the real stock.
Warning: Sync stock now in Test writes the test environment's stock to your products, in every storefront that sells them. The integration page asks Sync stock from ProSmart Test? before the sync starts.
Kustom test orders
BunStack does not send an order Kustom took payment for in the playground to ProSmart Production. BunStack saves on the order which Kustom environment took the payment. For older orders it reads the checkout session. Switching Kustom to Live does not turn old test orders into real ones. Switch ProSmart to Test if you want to try the flow.
The login check
The environment buttons show how ProSmart last answered the login, for example Login refused (HTTP 401) for Production while Test is in use.
Check stored Production login and Check stored Test login try the saved login in the chosen environment. The environment does not switch, and what you have typed stays. When you have typed new keys without saving, the button is off. Save first, because the check uses the saved keys.
Test connection tries the environment in use and shows ProSmart's answer.
| Answer | Cause | What to do |
|---|---|---|
| 401 | The client secret or tenant is wrong. | Check Client Secret and ProSmart tenant. |
| 403 | The account has no access to the API. | Ask ProSmart to open the API for the account. |
| 404 | The address is wrong. | Let API base URL end at the API's root, without /token. |
| 5xx | ProSmart is down. | Try again later. |
| No answer within 15 seconds | BunStack cannot reach the API. | Try again later. |
The Activity tab
The Activity tab lists the 20 latest stock syncs and the 25 latest order pushes. Each push shows the environment, sent and skipped lines and the delivery.
Disconnect
Disconnect deletes the client ID and client secret for both environments and turns the integration off. Stock sync and order push stop. Tenant, customer number, addresses and the order settings stay. To reconnect, enter the keys again.
Rate limits
BunStack runs one stock sync per workspace at a time. Each call to ProSmart gets 15 seconds.