#StackBounty: #ruby #ruby-on-rails-4 #woocommerce #wordpress-rest-api #woocommerce-rest-api Creating coupon through API and ruby return…

Bounty: 50

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 = {
code: “10off”,
discount_type: “percent”,
amount: “10”,
individual_use: true,
exclude_sale_items: true,
minimum_amount: “100.00”

woocommerce.post("coupons", data).parsed_response

I expect it to return a successful response from the API instead I get {“errors”=>[{“code”=>”woocommerce_api_missing_coupon_data”, “message”=>”No coupon data specified to create coupon”}]}

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.