Hi,
Based on
developer.squareup.com/docs/orders-api/what-it-does
the Square API provides a way to update/read "catalog objects" . And when the Square plugin sends the data of the order to Square's API, it could potentially provide a reference to a catalog object for each product in the order. And then, Square would update the stock of the catalog object after the payment accordingly.
So for this to happen, it would require:
- that the Square plugin adds an input field for each product, so that you could provide the corresponding catalog object id. Or, if you can't easily get the catalog object id in your Square system, it would require implementing some extra endpoints of the Square API to get it, based on the product code (SKU) for example:
stackoverflow.com/questions/62849375/how...ory-by-sku-using-php
- Once you have a way to link products in HikaShop with products in Square, you would have to edit each product to fill the catalog object id, unless it's possible to match them automatically (based on the product code, as I was saying).
Then, the plugin would have to add that information to the order when initiating the payment.
So, basically, with the current version of the Square plugin, this is not possible. But there is a way to do it with extra development in the Square plugin. If that's something you need, I would recommend checking with the developer of the plugin, TsukiDev, first to see what's possible:
tsukidev.com/