Jump to content

Free Billing Cycle on Add Order API


kan

Recommended Posts

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

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated