946 questions
Tooling
0
votes
0
replies
18
views
i want to utilize woocommerce CSV importer to import metafields into pages, not just products
is it possible?
the thing is that I have created my theme using only metafields.
So i just fill out the fields in my csv file, run importer and it imports the data from csv to product page and this ...
2
votes
1
answer
92
views
Woocommerce set custom field value from API
I have setup a custom field in the Admin Orders section of my Woocommerce site
add_action('woocommerce_admin_order_data_after_order_details', function($order){
$pdf_url = get_post_meta($order->...
0
votes
0
answers
104
views
Woocommerce products batch update limitation: How to update more
I am creating a plugin to update products stock and regular price for now. I am using the batch update API endpoint as follow. I use a csv file with 3 columns product sku, stock and regular price to ...
-1
votes
1
answer
160
views
How to exclude specific REST API endpoints from being cached by WP Rocket?
I'm using WP Rocket along with their helper plugin WP Rocket | Cache WP Rest API which allows caching of WordPress REST API endpoints.
I’ve added the following filter to allow REST API caching:
...
0
votes
0
answers
29
views
What am I supposed to do with these REST API keys that I have created?
I have been getting a White Screen of Death when trying to edit products (any product) in WooCommerce. Logs have brought me to an Error 401, for which Woo says I need to create REST API keys. but ...
1
vote
1
answer
115
views
Filter WooCommerce Orders by country with REST API V3
I'm trying to filter the response from /wp-json/wc/v3/orders for a specific API key. The filtering should be that orders from a specific country should not be included. The store still uses the ...
1
vote
0
answers
51
views
woocommerce rest api - unable to successfully apply tax to order
I'm building an integration between Zoho.Inventory and woocommerce that will sync Sales Orders manually entered into Zoho.Inventory up to woocommerce as an order. I am able to create the order in ...
0
votes
0
answers
42
views
Add-To-Cart REST API integration with woocommerce
this is my code for integrate product throught rest API.
Custom REST API endpoint for adding products to the WooCommerce cart.
Register the REST API route for adding to cart.
add_action('rest_api_init'...
3
votes
1
answer
170
views
how customize usage of jwt authentication for woocommerce and wordpress api?
i want create a nextjs via headless woocommerce
how can i add jwt auth to some methods and endpoints and allow others publicly
for example i want restrict POST,DELETE,PUT methods for product and ...
1
vote
1
answer
65
views
How to Get Attribute Term IDs for Filtering Products in WooCommerce API with Angular?
I’m using WooCommerce as a headless CMS with Angular. Currently, I’m working on implementing a product filter sidebar. The goal is to collect the attributes and their options (terms) for the products ...
0
votes
0
answers
48
views
WooCommerceNET Selecting a product variation attribute
I can add product attributes and product variations. How do you select the default attributes for a variation? The top row of the image below shows what I'd like to achieve. The options for the drop ...
0
votes
0
answers
70
views
Woocommerce Rest API - Get Order Items With Float Quantity
In Woocommerce Rest API, I need to get the quantity of items from orders (Get) in float format and on the frontend (what the clients see) should remain in integer format.
For ex:
If the client orders ...
1
vote
1
answer
109
views
How to Show Order Totals with Decimals in WooCommerce REST API Response
I'm working on a WooCommerce store with a multi-currency setup. My store's default currency is Japanese Yen, and I have the price decimal setting in the WooCommerce dashboard set to 0 to avoid showing ...
0
votes
0
answers
17
views
Adding Fields to Order API Call on WooCommerce
I am making a Rest Api call to my WooCommerce to retrieve all orders
/wp-json/wc/v3/orders
The call is perfect and I can get all the data to process on my management system.
I would like to be able to ...
0
votes
0
answers
38
views
How to Retrieve Active Subscriptions for a Customer in WooCommerce? REST API
I'm looking for an endpoint in the latest version of WooCommerce that allows me to retrieve a customer's active subscriptions.
I’ve tried using the following endpoint,
https://store_url.com/wp-json/wc/...
0
votes
0
answers
97
views
WooCommerce REST API does not show all the products
I have a webshop with products in 4 languages. When I try to receive the full list of products, I do not see all the products. Only the products in the Dutch language (the 'main' language) and not the ...
0
votes
0
answers
182
views
Woocommerce Update Cart Validation (Blocks / AJAX)
I need to display a message to a customer when the quantity exceeds a certain calculation. I would like to make this fail validation and post a message. I can do so with add to cart validation, but I ...
1
vote
0
answers
59
views
woocommerce api error JSON ERROR: Invalid JSON returned
I'm loading product information automatically through the woocommerce V3 product api. It works fine for the most part, but the odd time I will get a "411" "Invalid JSON Returned" ...
0
votes
1
answer
66
views
WooCommerce Rest Api How To Delete Coupon
I USE METHOD DELETE ON THIS ENDPOINT https://mypetstoryapp.com/wp-json/wc/v3/coupons/3601?consumer_key=X&consumer_secret=X BUT I GET AN ERROR 400 -
<!DOCTYPE html>
<html lang="en&...
0
votes
1
answer
107
views
Also delete images when deleting products via WooComerce REST API v3
I have a daily process that creates and deletes products from WooCommerce via API. However, when products are deleted, their associated images are not removed, resulting in a large number of unused ...
2
votes
0
answers
83
views
How can I automatically save WooCommerce API key details as user meta when an API key is created?
Whenever I create an API key on this WooCommerce page: /wp-admin/admin.php?page=wc-settings&tab=advanced§ion=keys
I want to automatically save the API key details (such as Consumer Key and ...
0
votes
0
answers
111
views
Disable to use Woocommerce API for users
I have created a custom checkbox for users to block them from using the Woocommerce API if the box is checked. However, if the box is checked the user can still use the API. The filter and code I'm ...
0
votes
1
answer
169
views
Get Product Data Using Woocommerce API Returns Duplicates - Node Js
I am trying to fetch product data from my website using woocommerce-api library in node js.
I've tested that code is working as expected with other websites. However in my case I get a lot of product ...
0
votes
0
answers
292
views
Woocommerce REST API: enable basic auth through HTTP for local development
I'm running a Wordpress instance (Docker) in my local Dev machine and I would like to perform HTTP requests to the Woocommerce API like in the production server (that runs on HTTPS). If I just create ...
1
vote
1
answer
159
views
How to send large amount of products via WooCommerce Rest API
I am developing a plugin for WordPress. I am receiving products from a third-party API, but when I send requests to the WooCommerce REST API, I get an internal server error or a WooCommerce HTTP ...
1
vote
0
answers
41
views
How to get order id from customer billing email with a Python script - WooCommerce API
I would like to create a Python script that returns the orders of a customer, knowing only his billing email.
I tried doing this but returns all recent orders:
from woocommerce import API
wcapi = API(...
0
votes
0
answers
44
views
getting empty list while trying to get reviews from woo rest Api
I am trying to use https://<url>/wp-json/wc/v3/products/reviews to get all reviews in Postman which must work fine based on the document but I get an empty list . I am using basic Auth and note ...
0
votes
1
answer
38
views
What if user closes his browser before woocommerce_payment_complete action is performed?
I created an action that is performed after the user's payment is complete and it's working fine. But in a situation where my client exits his browser right after payment this action will not be ...
0
votes
1
answer
169
views
PHP Fatal error: Uncaught Error: Class "WC_Legacy_API" not found
Wordpress error after upgrading woocommerce plugin version to 9.0.0, see error details below
PHP Fatal error: Uncaught Error: Class "WC_Legacy_API" not found in /home/dettrart/public_html/...
1
vote
1
answer
161
views
Change Order Number when Imported via WooCommerce Rest API
I am currently importing orders from a marketplace to WooCommerce using the WooCommerce Rest API v3. The Marketplace Order ID is added in the Customer Note Field in the WooCommerce order upon import. ...
0
votes
0
answers
149
views
Woocommerce Rest Api get product by barcode custom meta field
I am using woocommerce rest api to get all the product data by making a query by sku. I want to do the same with the user field '_barcode'.
For a quick query, this works for me
$data=['sku'=>$sku];
...
1
vote
0
answers
179
views
How to correctly include and use WooCommerce Block Store API Schemas to modify "All reviews" block rest api to filter by author
I'm developing a custom WooCommerce plugin that needs to extend the WooCommerce Store API. Specifically, I want to filter product reviews by the current author when viewing the author page. This is ...
0
votes
0
answers
36
views
Taxes are not being applied on line items when created from rest api
I am posting following data on rest api url "https://example.com/wp-json/wc/v3/orders"
{
"payment_method": "cod",
"payment_method_title": "Cash on ...
1
vote
0
answers
46
views
How to connect woocommerce with React using Auth1.0?
I am trying to integrate my e-commerce platform into my React application. But I am not able to connect. I am always getting errors.
This time CORS error is coming. I am not able to understand how to ...
0
votes
1
answer
473
views
How to add a line item to an existing Woocommerce order via REST API?
I am looking to add a line item to an order. I am POSTing to this endpoint:
/wp-json/wc/v3/orders/7691
with some pretty basic json:
{
"name": "Product Name",
"...
0
votes
1
answer
260
views
How to reload page after product removal from Cart - Woocommerce
I have this code snippet:
add_action( 'template_redirect', 'empty_cart_redirection' );
function empty_cart_redirection(){
if(is_cart() && WC()->cart->get_cart_contents_count() == 0 ) ...
0
votes
1
answer
45
views
API Data is being passed but not being rendered
I am using nextjs and woocommerce rest api to build a ecommerce site. But I have been facing issues with rendering products/data from woocommerce to nextjs frontend. I have setup the endpoint for ...
0
votes
0
answers
118
views
WooCommerce Rest API. Add review without auth
I am trying to create a product review using woocommerce REST API /wp-json/wc/v3/products/reviews. Unfortunately only authorized user with higher role can leave review. Normally anyone can leave a ...
1
vote
2
answers
56
views
Extend function execution on product update via a Cron Job or REST_API
Is it possible to execute this php function when product is updated via Cron Job or REST_API?
Cron JOB is updating _stock2 meta field, and rest_api is updating basic stock quantity of woocommerce ...
-1
votes
1
answer
446
views
Import product categories parent / child relation in another way than ID in WooCommerce Rest API
I'm loading a quite extensive feed through the rest API.
The importation runs well, but I only have one problem.
The supplier defines the relation between parent and child by id provided in the feed.
...
0
votes
1
answer
343
views
Duplicate Orders Issue When Syncing WooCommerce Sites through REST API
I have been wrestling with a duplication problem with regard to syncing orders between a source and destination site via WooCommerce orders rest API endpoint:
/wp-json/wc/v3/orders
I have come up ...
0
votes
0
answers
62
views
500 Internal Server Error in WooCommerce gateway: Undefined variable: Transaction_ID
I got 500 Internal Server Error after payment is successful or failed.
This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact ...
0
votes
0
answers
634
views
Woocommerce Orders API returning "woocommerce_rest_shop_order_exists"
I can't figure out how to get SITE B to accept the order from SITE A
I essentially need SITE A to be a proxy of SITE B, sending all orders processed to site Bs orders API
using my current code, I get ...
0
votes
1
answer
255
views
Woocommerce products/batch update has no response []
I am missing something. For days I have been working on a python script to update products in woocommerce, but it fails to update and has no error or response. I have the REST API Log plugin to check ...
1
vote
2
answers
229
views
How can I create woocommerce coupon with an expiration date using the rest api?
I'm trying to create a coupon via the woocommerce rest api:
https://woocommerce.github.io/woocommerce-rest-api-docs/#create-a-coupon
I can create coupons fine, but it seems the expiration date is ...
0
votes
0
answers
129
views
Woocommerce Rest API data returns string format
I have an issue with the WooCommerce Rest API, just to clarify, I've worked with the API multiple times on many sites, but I've never encountered this "error".
My issue is that the response ...
0
votes
0
answers
253
views
Send data via API after a WooCommerce sale
I am pretty new to API's and can't figure this out! I have courses on Moodle which I sell via Wordpress / Woocommerce. Upon a successful sale I need to automatically enrol the user to Moodle. To do ...
0
votes
0
answers
241
views
WooCommerce REST API - 403 "This order is still being processed."
I try to get past orders (December) from WooCommerce. From 80.000 transaction I have about a 200 transactions that are not included in the /orders response, but show up in the Admin Dashboard. When I ...
1
vote
0
answers
167
views
Faulty error response from WooCommerce Rest API Coupon Delete
Steps to Reproduce:
Create a new coupon (or use the id of an existing one).
Delete it with an http request to DELETE /wp-json/wc/v3/coupons/<id> as per the WooCommerce Rest Api Documentation.
...
2
votes
1
answer
719
views
Filter Customers by Date Created in WooCommerce REST API
I'm attempting to retrieve customer data from WooCommerce using the REST API, filtered by the date of creation. I've tried two different approaches, but neither seems to work. Here's what I've tried:
...