Questions tagged [woocommerce-rest-api]

WooCommerce REST API is fully integrated with the WordPress REST API since WC version 2.6+, allows WC data to be created, read, updated, and deleted using requests in JSON format and using **WordPress REST API** Authentication methods and standard HTTP verbs…

WooCommerce (WC) 2.6+ is fully integrated with the WordPress REST API. This allows WC data to be created, read, updated, and deleted using requests in JSON format and using WordPress REST API Authentication methods and standard HTTP verbs which are understood by most HTTP clients.

Requirements: It’s required turn on the WordPress permalinks on Settings > Permalinks.

WooCommerce REST API Documentation

WooCommerce REST API

Prior to 2.6, WooCommerce had it’s own REST API separate from WordPress which is now known as the legacy API. You can find the documentation for the legacy API separately.

The default response format is . Requests with a message-body use plain to set or update resource attributes. Successful requests will return a 200 OK HTTP status...

957 questions
7
votes
2 answers

Using Woocommerce as backend & ReactJS as frontend?

Is it possible to use woocommerce as backend & ReactJS as frontend? I am new to creating online shops, and would like to write a frontend with ReactJS, but I am not sure what options there are for the backend. I do know I can use Wordpress as a…
7
votes
2 answers

How to see WooCommerce API Log

I'm using the WooCommerce API and getting some errors with no information on what's causing the error. How would I view the logs to see what's happening?
Jordash
  • 2,926
  • 8
  • 38
  • 77
6
votes
1 answer

Error: Unable to resolve module stream from C:\**\node_modules\cipher-base\index.js: stream could not be found within the project

The following error showed in my metro bundler when I run react-native with npm plugin @woocommerce/api library. It's currently active plugin for woocommerce rest api. I've searched many solutions about the stream dealing with cipher-base. It…
Felix Htoo
  • 874
  • 12
  • 15
6
votes
2 answers

Woocommerce Rest API: woocommerce_product_invalid_image_id

Woocommerce version: 4.1.0 I am trying to create a product with categories and images via the API but I get this error : {"code":"woocommerce_product_invalid_image_id","message":"#0 is an invalid image ID.","data":{"status":400}} I have checked…
thelaw
  • 385
  • 5
  • 12
6
votes
1 answer

REST API woocommerce - Not showing all customers on GET/customers

Problem summary I am trying to fetch all customers with POSTMAN using the latest woocommerce API (v3): GET/customers Yet only a small segment is returned. The number of customers returned is 28 (X-WP-Total) which is much less than the 150+…
6
votes
1 answer

WooCommerce can't see product variations

I'm trying to manage WooCommerce entirely by its REST API but with no luck, i'm trying to insert a product with variations I can succesfully create a product with a POST to {{url}}/wp-json/wc/v3/products/ After product creation, i have to create…
Tizio Fittizio
  • 520
  • 5
  • 16
6
votes
1 answer

How to get the product sku from order items in Woocommerce

For Api on page "woocommerce_thankyou" need get sku. I have: $order = wc_get_order( $order_id ); foreach ($order->get_items() as $item_key => $item_values): $product = new WC_Product($item_id); $item_sku[] =…
6
votes
9 answers

Get all products from Woocommerce using REST API

I am trying to retrieve all products using rest api. I have read this question. I am using postman to make calls. Here is my query https://squatwolf.com/wp-json/wc/v2/products?filter[posts_per_page] =-1 The query shows only 10 results.
user379888
6
votes
1 answer

How to authenticate existing customer via WooCommerce rest API

I am creating a mobile app for a WooCommerce website and have gotten to a stage where I want the user to login or signup to the WooCommerce website before they continue with a purchase. I can create a new customer no problem but I am having trouble…
Win
  • 2,593
  • 3
  • 25
  • 35
6
votes
1 answer

Woocommerce Cash On Delivery Add Custom Field

How can I add a custom textarea field right below cah on delivery so when you click on the cash on delivery radio button a textarea appears to enter details that get saved into the order?
sebas
  • 722
  • 1
  • 6
  • 21
6
votes
1 answer

WooCommerce API: Create order with meta data on line item

I'm using this API to create orders in WooCommerce: https://github.com/kloon/WooCommerce-REST-API-Client-Library When I'm adding an order: $orderData = array( "order" => array( "line_items" => array( array( …
user482954
5
votes
1 answer

How to get shipping rates in woocommerce rest api?

I am using woocommerce-rest-api to create an app of woocommerce site. To create an order in store we have to use create-order api, which requires basic all the order params. So there is a one params called shipping_lines, in which we have to pass…
Kishan Bharda
  • 5,446
  • 3
  • 30
  • 57
5
votes
2 answers

Is it possible to extend the woocommerce products rest endpoint?

Is there a way to extend the products-object in the woocommerce rest api /wp-json/wc/v3/products, in a non-destructive way, so plugins that uses that endpoint, doesn't break. I've currently tried create my own rest endpoint to replicate the object,…
Timm Jensen
  • 180
  • 12
5
votes
3 answers

How to fetch a product from woocommerce api based on the sku?

I found difficulty in fetching a product from my woocommerce website to my django app based on the sku. In the official documentation here: http://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-a-product i found a solution only for…
gtopal
  • 544
  • 1
  • 9
  • 35
5
votes
0 answers

WooCommerce calculate shipping via REST API

My implementation in app is just like my WooCommerce website. I want to achieve following points for calculating shipping: Check if address is required or not for calculating shipping address? If address is entered by user, how to check if this…
AndiM
  • 2,196
  • 2
  • 21
  • 38
1
2
3
63 64