Giter Club home page Giter Club logo

wc-api-ruby's Introduction

WooCommerce API - Ruby Client

A Ruby wrapper for the WooCommerce REST API. Easily interact with the WooCommerce REST API using this library.

build status gem version

Installation

gem install woocommerce_api

Getting started

Generate API credentials (Consumer Key & Consumer Secret) following this instructions http://docs.woocommerce.com/document/woocommerce-rest-api/ .

Check out the WooCommerce API endpoints and data that can be manipulated in https://woocommerce.github.io/woocommerce-rest-api-docs/.

Setup

Setup for the new WP REST API integration (WooCommerce 2.6 or later):

require "woocommerce_api"

woocommerce = WooCommerce::API.new(
  "http://example.com",
  "ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  {
    wp_api: true,
    version: "wc/v1"
  }
)

Setup for the WooCommerce legacy API:

require "woocommerce_api"

woocommerce = WooCommerce::API.new(
  "http://example.com",
  "ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  {
    version: "v3"
  }
)

Options

Option Type Required Description
url String yes Your Store URL, example: http://woo.dev/
consumer_key String yes Your API consumer key
consumer_secret String yes Your API consumer secret
args Hash no Extra arguments (see Args options table)

Args options

Option Type Required Description
wp_api Bool no Allow requests to the WP REST API (WooCommerce 2.6 or later)
version String no API version, default is v3
verify_ssl Bool no Verify SSL when connect, use this option as false when need to test with self-signed certificates
signature_method String no Signature method used for oAuth requests, works with HMAC-SHA1 and HMAC-SHA256, default is HMAC-SHA256
query_string_auth Bool no Force Basic Authentication as query string when true and using under HTTPS, default is false
debug_mode Bool no Enables HTTParty debug mode
httparty_args Hash no Allows extra HTTParty args

Methods

Params Type Description
endpoint String WooCommerce API endpoint, example: customers or order/12
data Hash Only for POST and PUT, data that will be converted to JSON
query Hash Only for GET and DELETE, request query string

GET

  • .get(endpoint, query)

POST

  • .post(endpoint, data)

PUT

  • .put(endpoint, data)

DELETE

  • .delete(endpoint, query)

OPTIONS

  • .options(endpoint)

Response

All methods will return HTTParty::Response object.

response = api.get "customers"

puts response.parsed_response # A Hash of the parsed JSON response
# Example: {"customers"=>[{"id"=>8, "created_at"=>"2015-05-06T17:43:51Z", "email"=>

puts response.code # A Integer of the HTTP code response
# Example: 200

puts response.headers["x-wc-total"] # Total of items
# Example: 2

puts response.headers["x-wc-totalpages"] # Total of pages
# Example: 1

Release History

  • 2016-12-14 - 1.4.0 - Introduces httparty_args arg and fixed compatibility with WordPress 4.7.
  • 2016-09-15 - 1.3.0 - Added the query_string_auth and debug_mode options.
  • 2016-06-26 - 1.2.1 - Fixed oAuth signature for WP REST API.
  • 2016-05-09 - 1.2.0 - Added support for WP REST API and added method to do HTTP OPTIONS requests.
  • 2015-12-07 - 1.1.2 - Stop send body in GET and DELETE requests.
  • 2015-12-07 - 1.1.1 - Fixed the encode when have spaces in the URL parameters.
  • 2015-08-27 - 1.1.0 - Added query argument for GET and DELETE methods, reduced chance of nonce collisions and added support for urls including ports
  • 2015-08-27 - 1.0.3 - Encode all % characters in query string for OAuth 1.0a.
  • 2015-08-12 - 1.0.2 - Fixed the release date.
  • 2015-08-12 - 1.0.1 - Escaped oauth_signature in url query string.
  • 2015-07-15 - 1.0.0 - Stable release.
  • 2015-07-15 - 0.0.1 - Beta release.

wc-api-ruby's People

Contributors

achadee avatar choubacha avatar claudiosanches avatar crm114 avatar danielhoey avatar ianblenke avatar kirkbowers avatar mtmail avatar nikgoy avatar olimart avatar ryanzhou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wc-api-ruby's Issues

400 bad request

hi guys,
i have some troubles with this gem, it return error 400, sometimes 401 and 403.
someone have this little piece of code who work ?
or know where is my error ?

require "woocommerce_api"

api = WooCommerce::API.new(
  "https://xxx.co",
  "ck_",
  "cs_",

  {
    version: "v3",
  }
)

p api.get("").parsed_response

thanks guys
i give roses for my hero

Trouble creating coupon, provided signature does not match

Trying to create a coupon on a wordpress site through my api but getting this issue:
{"errors"=>[{"code"=>"woocommerce_api_authentication_error", "message"=>"Invalid Signature - provided signature does not match"}]}
The wordpress site is still being built and does not have https, and I can't even find where the "pretty permalinks" option is.
wp version: 4.3.1
woocomm version: 2.4.10
server is apache
php version is
initializing with the same as explained in setup section of the readme with no args.
I have tried revoking Api consumer secrete and key and placing new ones in to no change.

This was all working a month ago or so but it hasn't been used since..not sure what the difference is now.
Any thoughts? pretty terrible with wordpress so apologies in advance if this is a basic config problem.

400 Bad Request using Oauth

Having a really strange issue but I'm not sure how to recreate the issue. My client has a woocommerce site using 2.5.5. When connecting using oauth, any request that I attempt to make from my server will get a 400 bad request.

After investigation into what causes this issue it seems like the culprit is:

    def do_request method, endpoint, data = {}
      url = get_url(endpoint, method)
      options = {
        format: :json,
        verify: @verify_ssl,
        headers: {
          "User-Agent" => "WooCommerce API Client-Ruby/#{WooCommerce::VERSION}",
          "Content-Type" => "application/json;charset=utf-8",
          "Accept" => "application/json"
        }
      }
      if @is_ssl
        options.merge!(basic_auth: {
          username: @consumer_key,
          password: @consumer_secret
        })
      end
      options.merge!(body: data.to_json) if data
      HTTParty.send(method, url, options)
    end

When it merges the data.to_json it seems to encode the body as "{}"

perhaps modifying the line to be
options.merge!(body: data.to_json) if data.present
will be a better approach since "{}" will always be truthy

EOFError

Getting an EOFError on products with over 100 variations. It appears to partially create the listing in woo but then breaks on the gem side. Any ideas what it might be from?

JSON Parse Error on GET

Hi,

I am getting a JSON Error for any type of request that I'm making. I have tested the same on C9 as well as my local dev machine. I also tried more than one woocommerce installation yet the issue still persists?

/Users/nikhilgoyal/.rvm/gems/ruby-2.3.3@nik/gems/json-2.0.2/lib/json/common.rb:156:in `parse': 743: unexpected token at '{"code":"woocommerce_rest_authentication_error","message":"Invalid timestamp.","data":{"status":401}}' (JSON::ParserError)
	from /Users/nikhilgoyal/.rvm/gems/ruby-2.3.3@nik/gems/json-2.0.2/lib/json/common.rb:156:in `parse'
	from /Users/nikhilgoyal/.rvm/gems/ruby-2.3.3@nik/gems/httparty-0.14.0/lib/httparty/parser.rb:118:in `json'
	from /Users/nikhilgoyal/.rvm/gems/ruby-2.3.3@nik/gems/httparty-0.14.0/lib/httparty/parser.rb:138:in `parse_supported_format'
	from /Users/nikhilgoyal/.rvm/gems/ruby-2.3.3@nik/gems/httparty-0.14.0/lib/httparty/parser.rb:105:in `parse'
	from /Users/nikhilgoyal/.rvm/gems/ruby-2.3.3@nik/gems/httparty-0.14.0/lib/httparty/parser.rb:67:in `call'
	from /Users/nikhilgoyal/.rvm/gems/ruby-2.3.3@nik/gems/httparty-0.14.0/lib/httparty/request.rb:345:in `parse_response'
	from /Users/nikhilgoyal/.rvm/gems/ruby-2.3.3@nik/gems/httparty-0.14.0/lib/httparty/request.rb:297:in `block in handle_response'
	from /Users/nikhilgoyal/.rvm/gems/ruby-2.3.3@nik/gems/httparty-0.14.0/lib/httparty/response.rb:25:in `parsed_response'
	from /Users/nikhilgoyal/.rvm/gems/ruby-2.3.3@nik/gems/httparty-0.14.0/lib/httparty/response.rb:74:in `respond_to?'
	from test.rb:20:in `puts'
	from test.rb:20:in `puts'
	from test.rb:20:in `<main>'

UPDATE:

After testing continuously I found that this issue is being caused by the SMART COUPONS (https://woocommerce.com/products/smart-coupons/) plugin.
Also I would like to add that Woocommerce API is working fine in a REST client like POSTMAN.
Also I would like to add that Woocommerce API when working with Ruby REST Client like https://github.com/rest-client/rest-client
The main problem appears to be how HTTParty is using JSON to parse. I think thats the issue. I am working on a way around this to make this work. In the meantime I would request the plugin author to shed some light, as I am not a very well versed programmer.

how to make update requests

store = OpenStruct.new(woocommerce_url: "https://alforriamoveis.com.br//wp-json/wc/v3/products/13409", token: "ck_6203256344errhello44", consumer_secret: "cs_d0203256344errhello44")
@prod = WooCommerce::API.new(
    store.woocommerce_url,
    store.token,
    store.consumer_secret,
      {
        wp_api: true,
        version: "wc/v3"
      }
    )

prod.post("//wp-json/wc/v3/products/13409", '{"name": "hello"}')

but this not worked

error code: rest_no_route

List all customers filter parameters are not working

Hello,
I'm using version 1.4.0 and trying to filter customers using exclude, include, email and role parameters.

Ex:

store = OpenStruct.new(woocommerce_url: "http://emojiskaitiniai.lt/wootest", token: "ck_8640cd6ad69dd8a2a0fc16b3b4eef73cd82d8e1b", consumer_secret: "cs_0f7cb647a1caeb9d8dd6ef786fcec16ca563c453")

@client = WooCommerce::API.new(
  store.woocommerce_url,
  store.token,
  store.consumer_secret
)

@client.get('customers', exclude: [4])
# or
@client.get('customers', include: [4])
# or
@client.get('customers', email: marcos@smartrmail.com)

I always get all the records. Same for the orders endpoints.

Thanks

How could I use proxy to call an APIs

Description:
I have a condition where I wanted to use proxy to call woo commerce APIs. I went thru the open/closed issues but I could not get anything related to it so raising a new one.

Any help would be appreciated.

Thank you.

Can't update a products tags or attributes via API

I've been trying to add tags to products via:
data = {
product: {
tags: [
"mirrored"
]
}
}
woocommerce.put("products/#{product_id}", data).parsed_response

Firstly, I needed the extra "product" json in there because otherwise I get:
{"errors"=>[{"code"=>"woocommerce_api_missing_product_data", "message"=>"No product data specified to edit product"}]}

I can verify the code works for non-array updates, for example:
data = {
product: {
"weight": "12345",
}
}
works well.

I have tried a number of variations to "data" to see if any would successfully add a tag. For example, I attempted to do it like this:
data = {
product: {
"tags": [
{
"id": "2",
"slug": "mirrored"
},
]
}
}

Each time the tags field does not change. I have tried similar approaches with the "attributes" field and had the same problem - they would not update.

The documentation speaks about Product Tag updating, but to my understanding this refers to creating/changing/deleting the tags themselves?
How can I successfully edit the tags that a product has?

404 on authentication

I was using legacy v2, but on a recent update to woocommerce 2.6.1 I can't connect to the API.

this was the configuration before:

  woocommerce = WooCommerce::API.new(
  self.url, #Url do site
  self.consumer_key, #Consumer Key
  self.consumer_secret, #Consumer Secret
    {
      version: "v2" #Versão da API
    }
  )

now:

  woocommerce = WooCommerce::API.new(
  self.url, #Url do site
  self.consumer_key, #Consumer Key
  self.consumer_secret, #Consumer Secret
    {
      wp_api: true,
      version: "wc/v1"
    }
  )

but I get this:

JSON::ParserError: 795: unexpected token at '

<title>404 Not Found</title>

Not Found

The requested URL /wp-json/wc/v1/ was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I tried to access the url but get a 404 too, I didn't find any similar issue, any idea what could it be?
My permalinks is custom and default for products. I also tried using wp_json as stated on the documentation, but same results

cannot update products/categories

irb(main):038:0> tmp.parsed_response["product_categories"].map{|x| "#{x["id"]} #{x["description"]}" }
=> ["15 ", "34 ", "31 ", "33 ", "32 ", "35 ", "36 ", "37 All kinds of clothes.", "38 "]
irb(main):039:0> tmp = woocommerce.put("products/categories/37", {id: 37, description: "xxx All kinds of clothes.xxxx" }).parsed_response
=> {"errors"=>[{"code"=>"woocommerce_api_missing_product_category", "message"=>"No product_category data specified to edit product_category"}]}

also tried with tmp = woocommerce.put("products/categories/37", { description: "xxx All kinds of clothes.xxxx" }).parsed_response resulted no success.

the documentation says it should be:
image

please advice

Update an order line_items meta

Is there a way to update or add new meta to line_items in an order?

shop_client.put("orders/117", {:line_items => [{"product_id" => 73, "meta" => {"key" => "serial_number", "label" => "SN", "value" => "23423234"}, "quantity" => 1}]})

This does now give any errors but the meta is not affected...

Using webhook with legacy V2

I am trying to use webhook to listen to to webhook action and update product stock amount/price, delete product and create new product accordingly on my app. The woocommerce store is using Version 2.2.4, which webhook can not be created on the wordpress portal (correct me if I am wrong, I can't find it anyway) So I try to create webhooks via API.

I tried the example on documentation, the get actions work and the webhook count is zero. That's correct because I haven't any so far. Then I try on the post action to create my own:
data = {webhook: {name: "Add to cart webhook", secret: "randomsecrectstring", topic: "action.woocommerce_add_to_cart",delivery_url: "http://requestb.in/1exdwip1" } } woo_store.post("webhooks", data)
The response is code 500 as below:
{"errors"=>[{"code"=>"woocommerce_api_cannot_create_webhook", "message"=>"Cannot create webhook: 0"}]}

I know the delivery url won't work, but this should at least create a webhook. Any idea which part goes wrong? Thanks!

URI.encode is obsoleted and not available in the latest Ruby versions

The obsolete method URI.encode is used in the code which is throwing the error while using the gem with the latest Ruby versions e.g. ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux].

endpoint + URI.encode(flatten_hash(data).join("&"))

The method was marked as obsolete many years back in 2009 with ruby/ruby@238b979

It can be replaced with the CGI.escape method.

More details: https://bugs.ruby-lang.org/issues/17309

There are many more discussions around the topic on https://bugs.ruby-lang.org/

I have monkeypatched the method in my Rails app until the patch is available on this gem.

# config/initalizers/woo_commerce.rb

module WooCommerce
  class API
    # URI.encode (alias of URI.escape) method used in the gem's implementation
    # is obsolete since 10 years and removed in Ruby 3.
    # https://github.com/ruby/ruby/commit/238b979f1789f95262a267d8df6239806f2859cc
    def add_query_params endpoint, data
      return endpoint if data.nil? || data.empty?

      endpoint += "?" unless endpoint.include? "?"
      endpoint += "&" unless endpoint.end_with? "?"
      endpoint + CGI.escape(flatten_hash(data).join("&"))
    end
  end
end

API v1 - Unable to get current store details in Ruby

I am trying to fetch the currenct store details like currency and weight_unit but not getting in response. I am trying with below code. Please help to fetch the current store detail.

default_options = {
    query_string_auth: true,
    wp_api: true,
    version:  'wc/v1'
}
options.merge!(default_options)
WooCommerce::API.new(detail.url,
                     detail.consumer_key,
                     detail.consumer_secret,
                     options
                     )

Thanks.

JSON Parse error

I'm getting error when issuing a get product
p = woocommerce.get("products", sku: barcode)

logs:

Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Notice: Use of undefined constant WP_CACHE_KEY_SALT - assumed 'WP_CACHE_
KEY_SALT' in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/ob
ject-cache.php
on line 1294



Warning: Cannot modify header information - headers already sent by (out
put started at /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/obj
ect-cache.php:1294) in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-
includes/rest-api/class-wp-rest-server.php
on line 1244



Warning: Cannot modify header information - headers already sent by (out
put started at /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/obj
ect-cache.php:1294) in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-
includes/rest-api/class-wp-rest-server.php
on line 1244



Warning: Cannot modify header information - headers already sent by (out
put started at /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-content/obj
ect-cache.php:1294) in /home/content/p3pnexwpnas16_data03/70/3665770/html/wp-
includes/rest-api/class-wp-rest-server.php
on line 1244

    from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/json-2.0.3/lib

/json/common.rb:156:in parse' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/json-2.0.3/lib /json/common.rb:156:in parse'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14.
0/lib/httparty/parser.rb:118:in json' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14. 0/lib/httparty/parser.rb:138:in parse_supported_format'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14.
0/lib/httparty/parser.rb:105:in parse' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14. 0/lib/httparty/parser.rb:67:in call'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14.
0/lib/httparty/request.rb:345:in parse_response' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14. 0/lib/httparty/request.rb:297:in block in handle_response'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14.
0/lib/httparty/response.rb:25:in call' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14. 0/lib/httparty/response.rb:25:in parsed_response'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14.
0/lib/httparty/response.rb:80:in method_missing' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/httparty-0.14. 0/lib/httparty/response.rb:48:in inspect'
from C:/RailsInstaller/Ruby2.2.0/bin/irb:11:in `

'
irb(main):012:0>

Getting products with variation details in bulk?

Hi all,

Adding an integration for WooCommerce to our app, sellers are using our system to manage all their inventory.

I'm using the REST API as documented here: https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-products

We need to retrieve the list of products + variations (including details) for our sellers. I can get the products with minimal API calls by using the total_number to enumerate:

while current_position < total_products_count
  get("products", :per_page => 100, :offset => current_position).parsed_response
  current_position += 100
end

However the variations array for each product object is just showing the ID: "variations"=>[5993]

I tried using the include param for get products again to minimise calls:

get("products", :include => variation_ids, :per_page => 100, :offset => current_position).parsed_response

But variations are not retrieved with this endpoint so the results are empty.

To be clear, if id=5993 is a variation, then:

get("products/5993").parsed_response

works and retrieves the data, but

get("products", :include => [5993]).parsed_response

does not.

How can I get the full list of variations with details without pinging the server for each product? The only relevant call I can see is woocommerce.get("products/22/variations").parsed_response but that is impractical to cycle through hundreds if not thousands of products to get details for each variant separately.

Any options for this? We don't have access to modify anything on the server, we have to use the vanilla API.

REST API Documentation refers to "wp_json" option instead of "wp_api", yielding confusing results.

In the REST API Documentation under Authentication over HTTPS, the sample code given for ruby is:

require "woocommerce_api"

woocommerce = WooCommerce::API.new(
  "https://example.com",
  "consumer_key",
  "consumer_secret",
  {
    wp_json: true,
    version: "wc/v3"
  }
)

When using this sample code, my attempts to access the index with woocommerce.get("") returned -1.

The problem seems to be that this code shows a non-existent wp_json option. The correct name of this option is wp_api.

Filtering order notes

Should the filter for order notes be possible?
I would like to get the order notes that are only private or public.

shop_client.get "orders/112/notes", :customer_note => true
shop_client.get "orders/112/notes",{'filter' => {'customer_note' => true}}
shop_client.get "orders/112/notes?filter[customer_note]=true"

All of those always return all the notes for the order, regardless of the customer_note value.
Or then my queries are wrong.

update customer role

i try this api with status update and get orders and customers and its work well.
but when i come to update customer role its not updating !! i use next code:

data={
"customer" => {
"role" => "Editor"
}
}
puts woocommerce.put("customers/3", data)

Deleting a webhook, ruby doc incorrect?

Really enjoying developing integration with the WC api right now. Very clean coded and documented API.

Not sure why, but the Ruby method you suggest running to delete a webhook will not work unless you add force: true to the call like so:

woocommerce.delete("webhooks/123", {force: true}).parsed_response

This is due to the very clear requirement you added to your delete method.

Cannot pass through 'Invalid Signature' error. Problem with signature.

Hello, I've been trying to use this gem to get access to my wordpress site, but I'm always ending up with this error: "errors":[{"code":"woocommerce_api_authentication_error","message":"Invalid Signature - provided signature does not match"}]
Tried everything. Re-generated customers secret and key a few times and still got nothing. Built my own query based on this topic: https://gist.github.com/cheenu/1469815 and still getting the same error. I'm not sure if the problem is with the gem itself, or my wordpress part, or something else. Please, can you help me understand what's the issue here?

My code is pretty straightforward:

woocommerce = WooCommerce::API.new(
   "http://www.mywebsite.com/",
   "ck_bla",
   "cs_bla",
    {
       debug_mode: true,
       version: "v3"
    }
 )
woocommerce.get('orders')

Woocommerce plugin version 2.5

My WP site is on London Time
and My local computer is on UTC +2
can this cause the issue with signature not being valid?

v3 API still sometimes errors on authentication over SSL

I suspect that this is a conflicting plug-in issue as passing the query params resolves it.

The error I get is:

[32] pry(main)> api.get('products')
=> {"errors"=>[{"code"=>"woocommerce_api_authentication_error", "message"=>"Consumer Secret is invalid"}]}

The odd part is that the get index route works (I've tried this on the client before pull request #10 was merged). I think that the basic auth might be getting scrubbed from the request before woo even is able to process it but to that end I don't know.

It does work if I include the secret and key in the query params.

Error when passing filters

The following request...
response = woocommerce.get("products", {'filter' => {'category' => 'String With Spaces'}})
Generates the following error...
woocommerce_api_authentication_error
Submitting the same request without spaces does not generate the error...I'm assuming this has to do with how the URL is built?

Params are not encoded in OAuth url

The params in the url returned by OAuth::get_oauth_url are not encoded. This causes a problem (in particular) if the generated signature contains characters such as '+'. In this case the authentication with wooCommerce will fail as it expects '+' to be encoded as '%2B'.

I think that line 40 in woocommerce_api/oauth.rb should be something like this:

query_string = URI::encode(params.map{|key, value| "#{key}=#{CGI::escape(value.to_s)}"}.join("&"))

Probably the keys should be encoded also.

Can't authenticate

I tried many GET requests, but I received 400 code. My configuration is

woocommerce = WooCommerce::API.new(  
'http://127.0.0.1:8888/',
'ck_xxxxx',      
'cs_xxxxx',      
{
wp_api: true,
version: "wc/v1"
}        
)

I tried using query_string_auth: true, but doesn't works. Im using WooCommerce 2.6.9 and WP 4.7

API v1 for 2.6.x authentication error

Hello,

thanks for this wrapper gem. I tried it and it works for the legacy API. I am using Version 2.6.1 Woocommerce and I get following error:

It says authentication error when using the new v1 method.

<HTTParty::Response:0x7fdbed3da4e8 parsed_response={"code"=>"woocommerce_rest_authentication_error", "message"=>"Invalid Signature - provided signature does not match.", "data"=>{"status"=>401}}, @response=#<Net::HTTPUnauthorized 401 Unauthorized readbody=true>, @headers={"date"=>["Sun, 26 Jun 2016 11:58:44 GMT"], "server"=>["Apache/2.4.20 (Unix) PHP/5.5.35 mod_wsgi/3.5 Python/3.5.1 OpenSSL/1.0.1p"], "x-powered-by"=>["PHP/5.5.35"], "x-content-type-options"=>["nosniff"], "access-control-expose-headers"=>["X-WP-Total, X-WP-TotalPages"], "access-control-allow-headers"=>["Authorization"], "content-length"=>["137"], "connection"=>["close"], "content-type"=>["application/json; charset=UTF-8"]}

API Documentation and Behavior Mismatch

I'm looking at the documentation for V2 for listing all orders and I'm noticing a number of discrepancies in the documentation and how it performs http://woocommerce.github.io/woocommerce-rest-api-docs/?ruby#list-all-orders

For example the orderby and order flags seem to have no effect on what gets returned. Additionally the per_page options doesn't actually change the page size that comes back and after does not seem to have any effect on what comes back.

Here is an example script that should replicate the problems:

# Setup:
require "woocommerce_api"

woocommerce = WooCommerce::API.new(
    "http://example.com", # Your store URL
    "consumer_key", # Your consumer key
    "consumer_secret", # Your consumer secret
    {
        wp_json: true, # Enable the WP REST API integration
        version: "v2" # WooCommerce WP REST API version
    }
)

result1 = woocommerce.get("orders?order=asc&orderby=slug").parsed_response
result2 = woocommerce.get("orders?order=desc&orderby=date").parsed_response

if result1 == result2
  puts "FAIL: ordering should change the results that come back"
else
  puts "PASS: it looks like the ordering changed things which is good"
end


result1 = woocommerce.get("orders?per_page=10").parsed_response # This is the default value
result2 = woocommerce.get("orders?per_page=15").parsed_response

if result1 == result2
  puts "FAIL: page size should be different"
else
  puts "PASS: it looks like the page size is different which is good"
end

Add metadata to existing coupon

Hello, I try with the following and I get no errors

@wc_api_client.put("coupons/42", { meta_data: [{ key: "email", value: "[email protected]" }] })

but then nothing changes on the Coupon

@wc_api_client.get("coupons/42")['meta_data']
=> nil

What am I doing wrong?

Accessing x-wp-total and x-wp-totalpages fails on this particular account

Hi guys we have a woocommerce that is loading the headers x-wp-total and x-wp-totalpages in postman as seen in the sceenshot below:

screen shot 2018-04-28 at 12 05 34 pm

but when I run the same query via the ruby gem, it omits the headers

request:

api.get('products?page=1&per_page=' + (search_params.page_size || 25), function(err, data, res) {


      console.log('headers', data.headers)

      // return response
      const response = {
        statusCode: 200,
        body: JSON.stringify({
          result: true,
          page_count: parseInt(data.headers['x-wp-totalpages']),
          page_size: (search_params.page_size || 25)
        })
      };

      callback(null, response);
    });

logged response:

{ date: 'Sat, 28 Apr 2018 01:51:48 GMT',
  'content-type': 'text/html; charset=UTF-8',
  'transfer-encoding': 'chunked',
  connection: 'close',
  'set-cookie': [ '__cfduid=d8b13fb621d86965f62633229257cdf721524880308; expires=Sun, 28-Apr-19 01:51:48 GMT; path=/; domain=.robbostackle.com; HttpOnly' ],
  'x-powered-by': 'PHP/7.0.29',
  'cache-control': 'max-age=0',
  expires: 'Sat, 28 Apr 2018 01:51:48 GMT',
  'host-header': '192fc2e7e50945beb8231a492d6a8024',
  vary: 'Accept-Encoding',
  'x-proxy-cache': 'MISS',
  'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
  server: 'cloudflare',
  'cf-ray': '4125e2c73c6c51f7-MEL' }

I know this is probably not a problem with the ruby gem, but I'm thinking along the lines of the customer might need to expose headers based on the user agent or something??

Any input on this?

System satus

WordPress Environment

Home URL: https://www.robbostackle.com
Site URL: https://www.robbostackle.com
WC Version: 3.3.5
Log Directory Writable: ✔
WP Version: 4.9.5
WP Multisite: –
WP Memory Limit: 1,000 MB
WP Debug Mode: –
WP Cron: ✔
Language: en_GB

Server Environment

Server Info: Apache/2.4.29 (Unix) mod_hive/6.6 OpenSSL/1.0.1e-fips mod_fastcgi/2.4.6
PHP Version: 7.0.29
PHP Post Max Size: 500 MB
PHP Time Limit: 600
PHP Max Input Vars: 10000
cURL Version: 7.53.0
OpenSSL/1.0.2k

SUHOSIN Installed: –
MySQL Version: 5.6.36
Max Upload Size: 500 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Database

WC Database Version: 3.3.5
WC Database Prefix: wpq3_
Total Database Size: 86.64MB
Database Data Size: 59.34MB
Database Index Size: 27.30MB
wpq3_woocommerce_sessions: Data: 0.56MB + Index: 0.02MB
wpq3_woocommerce_api_keys: Data: 0.00MB + Index: 0.01MB
wpq3_woocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.00MB
wpq3_woocommerce_downloadable_product_permissions: Data: 0.00MB + Index: 0.00MB
wpq3_woocommerce_order_items: Data: 0.01MB + Index: 0.01MB
wpq3_woocommerce_order_itemmeta: Data: 0.05MB + Index: 0.04MB
wpq3_woocommerce_tax_rates: Data: 0.00MB + Index: 0.01MB
wpq3_woocommerce_tax_rate_locations: Data: 0.00MB + Index: 0.00MB
wpq3_woocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB
wpq3_woocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.00MB
wpq3_woocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB
wpq3_woocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB
wpq3_woocommerce_payment_tokenmeta: Data: 0.00MB + Index: 0.00MB
wpq3_woocommerce_log: Data: 0.00MB + Index: 0.00MB
wpq3_commentmeta: Data: 0.00MB + Index: 0.00MB
wpq3_comments: Data: 0.02MB + Index: 0.02MB
wpq3_crony_jobs: Data: 0.02MB + Index: 0.00MB
wpq3_crony_logs: Data: 0.02MB + Index: 0.00MB
wpq3_links: Data: 0.00MB + Index: 0.00MB
wpq3_linksync_laidKey: Data: 0.02MB + Index: 0.00MB
wpq3_linksync_log: Data: 0.48MB + Index: 0.00MB
wpq3_options: Data: 0.84MB + Index: 0.07MB
wpq3_pmxe_exports: Data: 0.70MB + Index: 0.00MB
wpq3_pmxe_google_cats: Data: 0.26MB + Index: 0.05MB
wpq3_pmxe_posts: Data: 4.94MB + Index: 2.16MB
wpq3_pmxe_templates: Data: 0.00MB + Index: 0.00MB
wpq3_pmxi_files: Data: 0.01MB + Index: 0.00MB
wpq3_pmxi_history: Data: 0.00MB + Index: 0.00MB
wpq3_pmxi_imports: Data: 1.36MB + Index: 0.00MB
wpq3_pmxi_posts: Data: 5.81MB + Index: 2.24MB
wpq3_pmxi_templates: Data: 0.20MB + Index: 0.00MB
wpq3_postmeta: Data: 32.80MB + Index: 11.13MB
wpq3_posts: Data: 4.01MB + Index: 1.10MB
wpq3_po_plugins: Data: 3.52MB + Index: 5.91MB
wpq3_qss: Data: 0.17MB + Index: 0.05MB
wpq3_redirection_404: Data: 0.45MB + Index: 0.56MB
wpq3_redirection_groups: Data: 0.02MB + Index: 0.03MB
wpq3_redirection_items: Data: 0.02MB + Index: 0.08MB
wpq3_redirection_logs: Data: 0.02MB + Index: 0.08MB
wpq3_sbb_blacklist: Data: 0.20MB + Index: 0.08MB
wpq3_snp_log: Data: 0.02MB + Index: 0.00MB
wpq3_snp_stats: Data: 0.02MB + Index: 0.05MB
wpq3_social_users: Data: 0.00MB + Index: 0.00MB
wpq3_termmeta: Data: 0.76MB + Index: 0.61MB
wpq3_terms: Data: 0.31MB + Index: 0.44MB
wpq3_term_relationships: Data: 0.89MB + Index: 1.77MB
wpq3_term_taxonomy: Data: 0.39MB + Index: 0.62MB
wpq3_usermeta: Data: 0.17MB + Index: 0.09MB
wpq3_users: Data: 0.02MB + Index: 0.02MB
wpq3_wcpdf_invoice_number: Data: 0.02MB + Index: 0.00MB
wpq3_wc_download_log: Data: 0.02MB + Index: 0.03MB
wpq3_wc_point_of_sale_sale_reports: Data: 0.00MB + Index: 0.00MB
wpq3_wc_webhooks: Data: 0.02MB + Index: 0.02MB
wpq3_wd_fb_data: Data: 0.05MB + Index: 0.00MB
wpq3_wd_fb_info: Data: 0.02MB + Index: 0.00MB
wpq3_wd_fb_option: Data: 0.02MB + Index: 0.00MB
wpq3_wd_fb_shortcode: Data: 0.02MB + Index: 0.00MB
wpq3_wd_fb_theme: Data: 0.02MB + Index: 0.00MB
wpq3_woochimp_scheduled_events: Data: 0.00MB + Index: 0.00MB
wpq3_wplc_chat_msgs: Data: 0.02MB + Index: 0.00MB
wpq3_wplc_chat_sessions: Data: 0.02MB + Index: 0.00MB
wpq3_wplc_offline_messages: Data: 0.02MB + Index: 0.00MB

Post Type Counts

attachment: 5284
blocks: 23
bne_testimonials_sg: 1
custom_css: 1
extra_product_tab: 2
featured_item: 8
mc4wp-form: 1
nav_menu_item: 15
page: 25
pos_temp_register_or: 1
post: 9
product: 3368
product_variation: 5066
revision: 8
sg_optimizer_jobs: 5
shop_coupon: 1
shop_order: 48
shop_order_refund: 5
snp_popups: 1
wcst_trigger: 9
woocollections: 4
woocollitems: 10
wpcf7_contact_form: 9

Security

Secure connection (HTTPS): ✔
Hide errors from visitors: ✔

Active Plugins (21)

ManageWP - Worker: by ManageWP – 4.5.0
BNE Testimonials Pro: by Kerry Kline – 2.7.2
Actionable Google Analytics: by Tatvic – CC-V3-2.0 – Not tested with the active version of WooCommerce
Contact Form 7: by Takayuki Miyoshi – 5.0.1
MailChimp for WordPress: by ibericode – 4.2.1
Nextend Social Login: by Nextendweb – 3.0.6
WooCommerce Product Filter: by Mihajlovic Nenad – 6.5.5 – Not tested with the active version of WooCommerce
Redirection: by John Godley – 3.2
SG Optimiser: by SiteGround – 4.0.5
Squirrly SEO 2018 (Briefcase): by Squirrly SEO – 8.3.17
StopBadBots: by Bill Minozzi – 4.77
Transients Manager: by Pippin Williamson – 1.7.4
Woocomerce Brands Pro: by Proword – 4.3.1 – Not tested with the active version of WooCommerce
Woocommerce Variations Table - Grid: by Spyros Vlachopoulos – 1.3.9 – Not tested with the active version of WooCommerce
WooCommerce Extended Coupon Features: by Soft79 – 2.6.2
WooCommerce Composite Products: by SomewhereWarm – 3.13.7 – 3.13.8 is available
WooCommerce Stacked Product Layout: by SomewhereWarm – 1.1.7 – Not tested with the active version of WooCommerce
WooCommerce PayPal Express Checkout Gateway: by WooCommerce – 1.5.3
WooCommerce Pretty Emails: by MB Création – 1.8.6 – Not tested with the active version of WooCommerce
WooCommerce: by Automattic – 3.3.5
WP Rocket: by WP Media – 3.0.4

Settings

API Enabled: ✔
Force SSL: –
Currency: GBP (£)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: composite (composite)
external (external)
grouped (grouped)
simple (simple)
variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)

WC Pages

Shop base: #63 - /shop/
Basket: #62 - /cart/
Checkout: #61 - /checkout/
My account: #60 - /my-account/
Terms and conditions: #10945 - /terms-conditions/

Theme

Name: Flatsome Child
Version: 3.0
Author URL:
Child Theme: ✔
Parent Theme Name: Flatsome
Parent Theme Version: 3.5.3
Parent Theme Author URL: http://www.uxthemes.com/
WooCommerce Support: ✔

Templates

Overrides: flatsome/woocommerce/archive-product.php
flatsome/woocommerce/cart/cart-empty.php
flatsome/woocommerce/cart/cart.php
flatsome/woocommerce/checkout/form-checkout.php
flatsome/woocommerce/checkout/form-coupon.php
flatsome/woocommerce/checkout/thankyou.php
flatsome/woocommerce/content-product.php
flatsome/woocommerce/content-product_cat.php
flatsome/woocommerce/content-single-product.php
flatsome-child/woocommerce/content-widget-product.php
/home/globet47/public_html/robbostackle.com/wp-content/plugins/woocommerce-pretty-emails/emails/admin-cancelled-order.php version 2.3.0 is out of date. The core version is 2.5.0
/home/globet47/public_html/robbostackle.com/wp-content/plugins/woocommerce-pretty-emails/emails/admin-failed-order.php
/home/globet47/public_html/robbostackle.com/wp-content/plugins/woocommerce-pretty-emails/emails/admin-new-order.php version 2.0.0 is out of date. The core version is 2.5.0
/home/globet47/public_html/robbostackle.com/wp-content/plugins/woocommerce-pretty-emails/emails/customer-completed-order.php version 1.6.4 is out of date. The core version is 2.5.0
/home/globet47/public_html/robbostackle.com/wp-content/plugins/woocommerce-pretty-emails/emails/customer-invoice.php version 2.2.0 is out of date. The core version is 3.3.0
/home/globet47/public_html/robbostackle.com/wp-content/plugins/woocommerce-pretty-emails/emails/customer-new-account.php
/home/globet47/public_html/robbostackle.com/wp-content/plugins/woocommerce-pretty-emails/emails/customer-note.php version 1.6.4 is out of date. The core version is 2.5.0
/home/globet47/public_html/robbostackle.com/wp-content/plugins/woocommerce-pretty-emails/emails/customer-on-hold-order.php version - is out of date. The core version is 2.5.0
/home/globet47/public_html/robbostackle.com/wp-content/plugins/woocommerce-pretty-emails/emails/customer-processing-order.php version 1.6.4 is out of date. The core version is 2.5.0
/home/globet47/public_html/robbostackle.com/wp-content/plugins/woocommerce-pretty-emails/emails/customer-refunded-order.php version 2.4.0 is out of date. The core version is 2.5.0
/home/globet47/public_html/robbostackle.com/wp-content/plugins/woocommerce-pretty-emails/emails/customer-reset-password.php
/home/globet47/public_html/robbostackle.com/wp-content/plugins/woocommerce-pretty-emails/emails/email-addresses.php version 2.2.0 is out of date. The core version is 3.2.1
/home/globet47/public_html/robbostackle.com/wp-content/plugins/woocommerce-pretty-emails/emails/email-customer-details.php
/home/globet47/public_html/robbostackle.com/wp-content/plugins/woocommerce-pretty-emails/emails/email-footer.php version 2.0.0 is out of date. The core version is 2.3.0
/home/globet47/public_html/robbostackle.com/wp-content/plugins/woocommerce-pretty-emails//emails/themes/email-header-centered.php version 1.0 is out of date. The core version is 2.4.0
/home/globet47/public_html/robbostackle.com/wp-content/plugins/woocommerce-pretty-emails/emails/email-order-items.php version 2.1.2 is out of date. The core version is 3.2.0
flatsome/woocommerce/global/breadcrumb.php
flatsome/woocommerce/global/quantity-input.php
flatsome/woocommerce/global/wrapper-end.php
flatsome/woocommerce/global/wrapper-start.php
flatsome/woocommerce/loop/loop-end.php
flatsome/woocommerce/loop/loop-start.php
flatsome/woocommerce/loop/pagination.php
flatsome/woocommerce/loop/result-count.php
flatsome/woocommerce/loop/sale-flash.php
flatsome/woocommerce/myaccount/form-login.php
flatsome/woocommerce/myaccount/navigation.php
flatsome/woocommerce/notices/error.php
flatsome/woocommerce/notices/notice.php
flatsome/woocommerce/notices/success.php
flatsome/woocommerce/product-searchform.php
flatsome/woocommerce/single-product/photoswipe.php
flatsome/woocommerce/single-product/price.php
flatsome/woocommerce/single-product/product-image.php
flatsome/woocommerce/single-product/product-thumbnails.php
flatsome/woocommerce/single-product/related.php
flatsome/woocommerce/single-product/review.php
flatsome/woocommerce/single-product/sale-flash.php
flatsome/woocommerce/single-product/share.php
flatsome/woocommerce/single-product/short-description.php
flatsome/woocommerce/single-product/tabs/tabs.php
flatsome/woocommerce/single-product/title.php
flatsome-child/woocommerce/single-product/up-sells.php
flatsome/woocommerce/single-product-reviews.php
flatsome/woocommerce/single-product.php

Outdated Templates: ❌Learn how to update
`

Getting invalid signature error response for valid consumer key/secret

  • Installed woocommerce 2.4.10 on wordpress (test machine)
  • Created new api key with read/write permissions:
    "consumer_key"=>"ck_5f5b3fb4762955ac109b0d7add5b39c97e110198", "consumer_secret"=>"cs_fe8d616d33cb2a09d7e43f0d4438df2299b6793c"

making GET request over http:

D, [2015-11-30T15:50:17.860010 #34865] DEBUG -- : [httplog] Connecting: test.com:80
D, [2015-11-30T15:50:17.873659 #34865] DEBUG -- : [httplog] Sending: GET http://test.com:80/wc-api/v3/products?oauth_consumer_key=ck_9fd4eaa90e58f9b6035f74540d3032b8d2655d9d&oauth_nonce=e144f03ba198dffa288980cfa4ea0ccc9ce0dcf6&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1448927417&oauth_signature=QxbVO1i0t4mMy%252B3HzxR%252BRdBt%252F90%253D
D, [2015-11-30T15:50:17.873856 #34865] DEBUG -- : [httplog] Header: user-agent: WooCommerce API Client-Ruby/1.0.3
D, [2015-11-30T15:50:17.873961 #34865] DEBUG -- : [httplog] Header: content-type: application/json;charset=utf-8
D, [2015-11-30T15:50:17.874057 #34865] DEBUG -- : [httplog] Header: accept: application/json
D, [2015-11-30T15:50:17.874151 #34865] DEBUG -- : [httplog] Header: connection: close
D, [2015-11-30T15:50:17.874251 #34865] DEBUG -- : [httplog] Data: {}
D, [2015-11-30T15:50:18.167211 #34865] DEBUG -- : [httplog] Status: 401
D, [2015-11-30T15:50:18.167472 #34865] DEBUG -- : [httplog] Benchmark: 0.29283203097293153 seconds
D, [2015-11-30T15:50:18.167937 #34865] DEBUG -- : [httplog] Header: date: Mon, 30 Nov 2015 23:50:17 GMT
D, [2015-11-30T15:50:18.168130 #34865] DEBUG -- : [httplog] Header: server: Apache/2.4.12
D, [2015-11-30T15:50:18.168325 #34865] DEBUG -- : [httplog] Header: x-powered-by: PHP/5.4.43
D, [2015-11-30T15:50:18.168469 #34865] DEBUG -- : [httplog] Header: connection: close
D, [2015-11-30T15:50:18.168630 #34865] DEBUG -- : [httplog] Header: transfer-encoding: chunked
D, [2015-11-30T15:50:18.168754 #34865] DEBUG -- : [httplog] Header: content-type: application/json; charset=UTF-8
D, [2015-11-30T15:50:18.169004 #34865] DEBUG -- : [httplog] Response:
{"errors":[{"code":"woocommerce_api_authentication_error","message":"Invalid Signature - provided signature does not match"}]}

Returns invalid signature error, using latest version of gem.

API generates 'Consumer Key is missing'

We ran into this with our own implementation of an API wrapper and I though that using this gem would "fix" it but no luck :(.

When using v2, the api spits back "Consumer Key is missing" on some servers.

This is documented in the API:

Occasionally some servers may not properly parse the Authorization header (if you see a “Consumer key is missing” error when authenticating over SSL, you have a server issue). In this case, you may provide the consumer key/secret as query string parameters.

I'm not sure what "you have a server issue" is but since this is a customer of ours that is running into it, we don't have direct access to their server to see what the issue is. Is there any way that this gem could realize that this has happened and fallback to the query string params?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.