I am using the SOAP API for Magento (v1.5.1.0) and have managed to get the entire process of creating a cart, adding user, adding billing/shipping addresses, payment methods, etc. working, however I cannot get Coupons to work.
The code I'm using is as follows:
if ($couponCode != '') {
try {
$result = $this->magentoservice->shoppingCartCouponAdd($sessionId, $cartId, $couponCode);
} catch (Exception $err) {
return $this->returnError($err->getMessage());
}
}
I've tried with both a guest user and a registered user and I keep getting the same exception thrown - "Access denied.". As far as I can see from the limited documentation and forums posts this isn't even an expected error.
$sessionId and $cartId are definately valid. The $couponCode if entered directly on the magento frontend works.
Can anyone advise me how I might be able to solve this?