kan Posted September 23, 2019 Share Posted September 23, 2019 Hi I have an issue while Placing an order using API. Placing an order with "Free" billing cycle but order placeed with "Monthly" billing cycle. See https://nimb.ws/KhLHV8 . https://nimb.ws/KvqJiT Product Setting : https://nimb.ws/a9DWBU I tried "free","free-account","Free","Free-Account"..etc... But not working. $postdata = array( 'action' => 'AddOrder', 'clientid' =>10, 'pid' => array('242'), 'noinvoiceemail'=>true, 'priceoverride'=>'0.00', 'noemail'=>true, 'noinvoice'=>true, 'billingcycle' => array('Free'), 'paymentmethod' => 'paypal', 'responsetype' => 'json' ); Regards kan 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 23, 2019 Share Posted September 23, 2019 Hi kan, from those product settings, what you're seeing makes sense because it shows that it is setup as a recurring monthly product (payment type = recurring). if you wanted to set it as a free product, you would duplicate the product and create a "free" alternative product - and then use that PID in your API call... if you do that, specifying free in the API should work... at the moment, you're trying to use a billing cycle that isn't assigned to the product... a product can't have both "free" and "recurring" payment types enabled - you could have a recurring product priced at zero, but it's billing cycle wouldn't be free (it would be one-time or recurring). 0 Quote Link to comment Share on other sites More sharing options...
kan Posted September 23, 2019 Author Share Posted September 23, 2019 Hey, brian! I understood your point and it was correct but the situation here was I have to use the same PID and using admin I have to override payment method to free for certain conditions. Thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 23, 2019 Share Posted September 23, 2019 2 hours ago, kan said: I understood your point and it was correct but the situation here was I have to use the same PID and using admin I have to override payment method to free for certain conditions. my point is that I don't think that you can use addorder to create an order with an invalid billing cycle, e.g free when the product is set as recurring - the cart validation will prevent it.... it wouldn't work the other way either if the product were setup as free, but you then wanted to add a price to it and make it recurring. you could leave it recurring and set the price to 0, but you won't be able to make it free (in the sense I think you mean of "free")... if "certain conditions" are met, can't you just use a different pid (e.g a free product) in your API call? 0 Quote Link to comment Share on other sites More sharing options...
kan Posted September 24, 2019 Author Share Posted September 24, 2019 Thanks Brian, this will help 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.