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
38
votes
15 answers

WooCommerce - woocommerce_rest_cannot_view - Status 401

I have generated a consumer key and consumer secret. The website has SSL installed. I have also installed plugins required for JSON and REST services. This is how the url looks like: https:///wp-json/wc/v1/products When I am trying to get(GET)…
21
votes
3 answers

"cannot list resources" error from WooCommerce REST API

I am very new to WordPres` and using the WooCommerce plugin for the first time and want to use the WooCommerce REST API in my Android app. I have enabled the REST API and created a Consumer Key as well as a Consumer secret. Now, when am using this…
DD77
  • 776
  • 2
  • 8
  • 25
19
votes
2 answers

Applying coupons using woocommerce rest api

I am developing an application using WooCommerce rest API v3. Now I'm trying to integrate coupons from my WooCommerce website to my application. I'm creating order and applying coupons like this "coupon_lines":[{ 'code'=>'coupon1', …
SatheeshCK17
  • 523
  • 6
  • 17
14
votes
3 answers

WooCommerce REST API Custom Fields

Is it possible to access custom fields for orders, products, customers via WooCommerce REST API? If not natively, then what plugins or workarounds or hacks are out there that work? Thanks!
Amjad
  • 1,627
  • 5
  • 21
  • 41
13
votes
4 answers

Can't POST/PUT/DELETE any products into WooCommerce by REST API

I'm using Wordpress 4.7.1 with Woocommerce 2.6.13 plugin with enabled REST API. I was created user credentials from console plugin UI with read_write permissions. Now I'm trying GET products using OAuth1: service return 200 OK, credentials are…
Sergey Nikitin
  • 807
  • 8
  • 23
9
votes
1 answer

How to implement OAuth 1.0a using retrofit for woocommerce Api in Android

I am currently working on a woocommerce api, I need to integrate the api using retrofit. The web site is in HTTP so HTTP Basic authentication cannot be used over plain HTTP as the keys are susceptible to interception. The API uses OAuth 1.0a…
Ramz
  • 7,116
  • 6
  • 63
  • 88
8
votes
1 answer

Creating coupon through API and ruby returns error: woocommerce_api_missing_coupon_data

I am trying to create a coupon though the rest api from my rails 4 app using the sample code from the documentation on this page: https://woocommerce.github.io/woocommerce-rest-api-docs/?ruby#create-a-coupon Here is the code I am using: data = { …
8
votes
1 answer

WooCommerce Order API always creates empty orders

Im playing around with Woo Commerce API (v3.4.4). I can get a product with: curl -X GET \ …
Mark
  • 4,428
  • 14
  • 60
  • 116
8
votes
3 answers

WooCommerce REST API - Get all products with variations without too many requests

I'm using the WooCommerce REST API to e.g. get all products with variations, but I encounter a fairly large problem regarding the number of fired requests. I need help optimizing the situation below. Situation: A webshop with 50 products and 5…
Christian Gerdes
  • 279
  • 1
  • 2
  • 16
8
votes
7 answers

WooCommerce REST API - Filter Orders By Date Modified

I'm using the WooCommerce REST API (http://woocommerce.github.io/woocommerce-rest-api-docs/#introduction) and can download Customers, Orders, etc successfully. I'm now trying to get a filtered list of Orders where the Date Modified for the Order is…
8
votes
2 answers

List all enabled payment methods in Woocommerce

I'm working on mimicking the Orders Page in the Admin side to the UI of the site. It's like a complete rip off of what's on the backend. I'm stucked with listing all the enabled Payment Methods. Does anyone know how can I achieve it? Here's my…
elimariaaa
  • 796
  • 4
  • 10
  • 30
8
votes
1 answer

Python unable to make connection with woocommerce rest api

I am working on a woocommerce rest api in which I am passing the product data from mongodb using python. I wrote a script for the same. First time the script ran successfully and passed two products but when I tried to pass more products it is…
User0706
  • 1,067
  • 1
  • 18
  • 34
7
votes
1 answer

WooCommerce get_cart() on null

Before I updated to WC at 4.3.1 ,I had this code and it worked well add_action( 'rest_api_init', function () { register_rest_route( 'px-module-woocommerce', '/px/cart', array( 'methods' => 'POST', …
riccardo tocco
  • 167
  • 1
  • 6
7
votes
2 answers

wc_get_products returns empty array?

I have made a plugin so I can have custom endpoints. Ultimately I want to pull data about my bookable products (woocommerce bookings). Here is my plugin: if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', …
kadddeee
  • 498
  • 8
  • 20
7
votes
2 answers

WooCommerce REST API GET multiple products by ID

I need to display all related products by eah product I have in my list. Eg, In my app I have 3 products with id 1, 2, 3 product id 1 has 5,6,7 as related, product id 2 with related 8 and 9 etc.. Now I have an array with all the related…
1
2 3
63 64