Good evening !
I'm trying to establish a Shopify inventory export to import into a Magento 2 application. Magento has an API that allows multiple records to be sent in a single call to be processed in a batch process. I'm trying to understand now can I aggregate multiple rows of inventory spanning over multiple records into a single call.
As an example, let's assume that Shopify returns 2 products that each have 5 variants. The inventory resides at the variant level.
So far, I've established an individual API call for each product. Easy as it seems that natively, Celigo makes an API request per record. The API request body contains the inventory of its 5 variants.
What if I want to execute a single call for my 2 products (hence, having a request body including all 10 variants inventories)
Thanks in advance
You need to use the universal HTTP connector to submit batches of records. See pic below for context. It it not trivial to rebuild the Magento 2 connection and import bubbles using raw HTTP, but it is doable, and then you will have total control over the HTTP request payloads.
Thx @scotthenderson for this insight
Does this connector support any notion of pagination? The total number of records will vary from time to time as the Shopify Merchand might add/remove products. Hypothetically, If I have 39 products, including 10 records per request, will the connector automatically proceed to 4 requests?
Regards
Yeah, the connector will automatically convert 39 records into 4 requests.
Oh ! That is most excellent ! Ok, will try that out ! Thx again @scotthenderson :)
Good afternoon @scotthenderson, can you provide assistance in debugging this "issue" ? Whenever I set the field "Number of records per HTTP request" to a value other than 1 (ex : 2 or 10) and try to save the import, this error pops in.
If I revert the field value to 1, everything is saved alright
Thanks in advance
This looks like an annoying UI bug, but with a simple work around. See pic below. If you set this field, and click save, and then unset it, and click save again, then it should work. You might actually need to use this field BTW. I am not sure what the response structures look like for Magento 2, but this is a pretty commonly used field for when the results are wrapped by a variable.
That little workaround worked ! What a way to end a day ! Thx @scotthenderson