0
votes

We have a webshop that has different pricing for certain customers (certain customers might have 15% off certain product categories).

I'm making orders using the Woocommerce API, but when placing an order the pricing is based on the user that created the consumer key and secret (if I place a discount on products on this account, I can see the discounted price). And out of the box Woocommerce doesn't allow customers to create API keys.

So I'm looking for a way to access the products as if I'm a certain user. Something like

https://example.com/wp-json/wc/v3/products/{product_id}?customer_id={customer_id}

or

https://example.com/wp-json/wc/v3/customers/{customer_id}/products/...

But I do not know where to start to create something like this...

1

1 Answers

1
votes

Doing this with a CURL isn't going to happen, Unless its natively supported by the team, This will have to be a implementation on your application, So you have a way of knowing which users get what discounts im guessing? So cant you just assign something like a Tag to that user Called E.G 15% discount then on your checkout process check threw the users tags if a Discount Tag is Present apply the discount?