I am using woocommerce REST API for eCommerce android app and everything working good except coupon when creating new order from app.
Using this API to create order
https://my-domain.com/wp-json/wc/v2/orders
and passing some json data including
"coupon_lines" => [
"id" => 111,
"code" => "coupon code",
"discount" => "10.0",
"discount_tax" => "0"
]
by this way coupon will be applied to order but amount is not being reduced from total. Can anyone please help me? I am new to woocommerce.
I have searched for that and got that woocommerce REST API is not providing functionality to calculate coupon discount so I have to do it manually but don't know how to do it? and from where to start?
Even I got one solution that I can calculate coupon discount at client side and I did it but it's to tricky as there are lots of variations for coupon so my code broke down for some coupons. Totally stuck in this since last two days Please help me