How can I pull InfusionSoft product data into MySQL database using PHP with PHP 7.x ?
Years ago I set up a PHP script that pulls the following data from the following InfusionSoft (IS) tables via queries using the PHP isdk and the API “Encrypted Key” found in the IS Admin Application Settings:
-
Product table (‘Id’, ‘ProductName’, ‘ProductPrice’, ‘Sku’, ‘ShortDescription’,‘Taxable’,‘CountryTaxable’,‘StateTaxable’,‘CityTaxable’,‘Weight’,‘IsPackage’, ‘NeedsDigitalDelivery’,‘Description’, ‘HideInStore’,‘Status’, ‘TopHTML’,‘BottomHTML’,‘ShippingTime’,‘InventoryNotifiee’,‘InventoryLimit’,‘Shippable’)
-
ProductCategory table (‘Id’, ‘CategoryDisplayName’, ‘CategoryOrder’, ‘ParentId’)
-
ProductOption table (‘Id’, ‘ProductId’, ‘Label’, ‘IsRequired’,‘Order’,‘Name’,‘MaxChars’,‘CanEndWith’,‘MinChars’,‘AllowSpaces’,‘TextMessage’,‘OptionType’,‘CanContain’,‘CanStartWith’)
-
ProductOptValue table (‘Id’, ‘ProductOptionId’, ‘Label’, ‘Sku’,‘IsDefault’,‘OptionIndex’,‘PriceAdjustment’)
-
ProductCategoryAssign table (‘Id’, ‘ProductCategoryId’, ‘ProductId’)
-
SubscriptionPlan table (‘Id’, ‘Active’, ‘Cycle’, ‘Frequency’, ‘PlanPrice’, ‘PreAuthorizeAmount’, ‘ProductId’, ‘Prorate’)
Then I put/update the selected data in/to a MySQL database on the website. The code still works if you have a compatible PHP version. That isdk is apparently legacy now, as is the table schema.
We would like to use a more current PHP version (7+), which has deleted and deprecated some of the PHP code used in the isdk and related files. I have no problem updating the code I’ve created for using the website’s database etc with the new PHP version, I do need help with the IS API code it seems, as I seem to be striking out using Keap/IS API documentation.
I’m thinking it would be best to use what the current IS API uses instead of updating the “legacy” isdk code. The thing is, I’m not seeing how to do these sort of product queries with the current IS PHP SDK… or any way to retrieve or query product data of all products.
It seems the only API code that isn’t legacy is the REST API … but that doesn’t seem to be able to get anywhere near the amount of data as what I have been getting with the legacy API. Please tell me I’m wrong, and how to get that data.
All I need to do is get the InfusionSoft data into the website database, and don’t want to send or change any of the IS data from the website.
We just want to use IS UI to update the products in IS, then manually run the PHP script I made (and can adjust for new API once I understand how) on the website server to update the website’s database with the current IS data. We only run that script when we have changed something with one of the products. We don’t track inventory, so it’s fairly infrequent, and calls to the IS API are rare. The website’s database is used for all the visits to the store by customers, etc and the IS product links are used to place purchases and/or order in the IS cart, which is used for checkout.
Thanks!