With the Magento connection, Stockhub fetches the orders from your Magento 2 webshop. Stockhub sends the stock and the track & trace back to Magento. In this article you first create an integration in Magento and then the connection in Stockhub.
What you need
- Access to the Magento Admin with an account that is allowed to create integrations.
- The base address of your webshop, for example https://www.yourwebshop.com.
Creating an integration in Magento
- Log in to the Magento Admin.
- Go to System > Extensions > Integrations.
- Click Add New Integration.
- Under Name, enter a recognisable name, for example Stockhub. Under Your Password, enter the password of your own admin account.
- Click API on the left and set Resource Access to All.
- Click Save.
- In the overview, click Activate next to the new integration and then Allow.
- Copy the Access Token and click Done.
If you prefer Custom under Resource Access, select at least these resources:
- Sales > Operations > Orders, with Actions > View, Ship, Comment and Credit Memos under it.
- Catalog > Inventory > Products.
- Customers > Customer Groups.
- Stores > Attributes > Product, if you use the Supplier field.
- Stores > Inventory > Sources, if you use Sync stock in bulk.
Allowing the Access Token as a bearer token
From Magento 2.4.4 onwards, Magento by default no longer accepts the Access Token of an integration in the way Stockhub uses it. Turn this on:
- Go to Stores > Settings > Configuration > Services > OAuth.
- Open Consumer Settings.
- Set Allow OAuth Access Tokens to be used as standalone Bearer tokens to Yes.
- Click Save Config.
If this is off, Test connection in Stockhub shows Connection failed.
More information is in the Adobe Commerce documentation: https://experienceleague.adobe.com/en/docs/commerce-admin/systems/integrations
Creating the connection in Stockhub
- In the menu, go to Integrations > Sales channels.
- On the Sales channels tab, click New sales channel. The Add sales channel window opens.
- Choose Magento.
- Fill in the fields:
- Description: a recognisable name for the connection, for example the name of your webshop.
- Shipping name: the name on the shipping label. If you leave it empty, Stockhub uses your company name.
- Shop: the base address of your webshop with https://, for example https://www.yourwebshop.com. Do not add /rest; Stockhub adds that itself.
- Access token: the Access Token from Magento.
- Click Test connection. If you see Connected, Stockhub can reach your webshop. If you see Connection failed, check the address, the token and the bearer token setting.
- Click Next.
- Choose which data Stockhub exchanges. Set each setting to Active or Inactive:
- Import orders: fetch orders from Magento.
- Update existing product info and Import new products: you only see these if the fulfilment company has turned them on.
- Update stock to channel: send the stock from Stockhub to Magento.
- Sync a virtual stock amount: Stockhub adds this amount to the stock it sends to Magento.
- Send track & trace email: you only see this if the fulfilment company has turned it on.
- Click Save.
You then see the message Pending sales channel approval. The channel stays in draft status until the fulfilment company activates it. Only then do the synchronisations start.
How the Magento connection works
- Stockhub fetches orders with the status Processing.
- Stockhub recognises products by their SKU.
- If Process orders (with tracking) is on, Stockhub creates a shipment with the track & trace in Magento. The order then gets the status Complete. With Send tracking emails from webshop, Magento itself sends the shipping email to your customer.
- If your webshop uses Multi-Source Inventory (MSI), turn on Sync stock in bulk.
Settings that belong to Magento
Open the channel via Integrations > Sales channels. Besides the general settings, you find:
- On the Details tab: Shop and Access token. Enter a new token here if you have created a new integration in Magento.
- On the Sync tab: Date planned attribute, Sync stock in bulk and Send tracking emails from webshop.
- Under Custom product fields: for HS code, Country of origin, Barcode, Reject on return, Cost price and Supplier, enter the attribute of your products from which Stockhub takes that value.
- Under Orders: Ignore prefix, Import prefix, Prefix B2B orders, Fields for remark and Fields for customer reference. Separate several texts with a comma.
- On the Shipping options tab: shipping options in the checkout of your webshop. You only see this tab if the fulfilment company has turned on shipping options.
See also Verkoopkanalen beheren for all settings, the orders of the channel and deleting a channel.
Comments
0 comments
Please sign in to leave a comment.