I have no problem updating the custom fields of wocommerce products. The response json also returns all the acf fields of the product.
The problem is when I try to update the custom fields of the woocommerce product categories with REST API.
The response json does not return the acf fields of the category as it happens for the products .. why? … WordPress gives me the following error:
{“code”: “cant_update_item”, “message”: “Cannot update item”, “data”: {“status”: 500}}
I added these custom fields to the woocommerce categories: title_01 and text_01
This is the url I call from my script to update with the REST API:
https://mysite.com/wp-json/acf/v3/categories/MYCATID
… the end point is correct one to modify che custom fields?
I send these parameters in the call:
{“fields”: {“title_01”: “My title”, “text_01”: “My text”}}
can someone help me?
it seems that this end point is not editable:
/wp-json/acf/v3/{taxonomy}/{id}
The end point I tried to use is:
https://mysite.com/wp-json/acf/v3/categories/123
(Is there a specific end-point for woocommerce categories for example like: https://mysite.com/wp-json/acf/v3/product/categories/123 ???)
If I make a GET call of the url (https://mysite.com/wp-json/acf/v3/categories/123), the response is:
{“acf”:{“title_01″:”My title”,”text_01″:”My text”,}}
With POST or PUT call the response is:
{“code”:”cant_update_item”,”message”:”Cannot update item”,”data”:{“status”:500}}
My WP version is: 5.3.2
My Advanced Custom Fields PRO version is 5.8.8
Please help…..
Hello,
I need to update Woocommerce Product Category Acf fields using REST API.
I tried with:
endpoint:
https://domain.com/2020/wp-json/wc/v3/products/categories/123
json string:
{“name”:”My Category”,”slug”:”my-category”,”meta_data”:[{“key”:”my_acffieldname”,”value”:”my value”}]}
this works for woocommerce products but not for woocommerce categories!!
How can I do?
There is a way to update via REST API a Woocommerce product category acf field?
I saw that in the endpoint list (https://domain.com/2020/wp-json/acf/v3/) … there is not an endpoint for Woocommerce product Categories!!!
but if possible I want to update the acf field by using the Woocommerce endpoint:
https://domain.com/2020/wp-json/wc/v3/products/categories/123
please can you help me?
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
🚀 This week’s session of ACF Chat Fridays dips into the preliminary results of our first ever user survey. Don’t miss it! https://t.co/3UtvQbDwNm pic.twitter.com/kMwhaJTkZc
— Advanced Custom Fields (@wp_acf) May 9, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.