API PUT-Request results in Error 500
-
Hi,
i’m creating a new website which uses WooCommerceto present some hundred articles in ~250 categories. The articles are managed on an external application which sends all article-data via API to WordPress. The categories are managed in WooCommerce.
This basically works very well. Creating article, updating etc.
But: if i send a PUT-request to update an article including one or more categoryallocations it ends in an error 500. In this case only some of the article-data in WooCommerce get updated – but not the categories. In wc-logs I see in this moment an “allowed memory”-error which I cannot resolve with higher memory_limit.
Example request:
array(13) { ["name"]=> string(18) "testarticle" ["sku"]=> string(6) "010325" ["type"]=> string(6) "simple" ["status"]=> string(7) "private" ["description"]=> string(0) "" ["short_description"]=> string(39) "" ["price"]=> string(4) "1.29" ["regular_price"]=> string(4) "1.99" ["sale_price"]=> string(4) "1.29" ["categories"]=> array(1) { [0]=> array(1) { ["id"]=> int(201) } } ["images"]=> array(0) { } ["attributes"]=> array(1) { [0]=> array(2) { ["id"]=> int(1) ["options"]=> array(1) { [0]=> string(1) "0" } } } }The category with the id 201 exists in WooCommerce.
If it remove the categories-array the request ends with 201 – ok.Wordpress 5.6
WooCommerce 4.9.2
PHP 7.3Can anyone please help with this issue?
The topic ‘API PUT-Request results in Error 500’ is closed to new replies.