Jump to content

API AddOrder pass billingcycle issue


Sam666

Recommended Posts

Hello,

I am able to add order via API AddOrder action, but the billingcycle always not passed to the API, no matter set to quarterly/semiannually/annually, it's always set to the default monthly(the other fields like priceoverride/hostname/clientid are able to pass to API).  Below is the POST URL, is there anything wrong on my request? Appreciate if anyone can help. 

https://www.example.com/clientarea/includes/api.php?action=AddOrder&clientid=1&paymentmethod=stripe&pid=41&billingcycle=annually&priceoverride=123&noinvoice=false&hostname=www.example.com&identifier=vmWf7bHEQY9y5Gwmrq9UWVnVojr8u1j9&secret=Ox123xEnP212T53k&responsetype=json"

Link to comment
Share on other sites

Thanks @Kian, yes it's due to the product just allowed Monthly, the billing cycle params can be accepted now. 

BTW, I have another issue is the `noinvoice` param also not accepted by API. No matter set to "true" or "false", both no invoice being generated. Is there anything I have missed?

https://www.example.com/clientarea/includes/api.php?action=AddOrder&clientid=1&paymentmethod=stripe&pid=41&billingcycle=annually&priceoverride=123&noinvoice=false&hostname=www.example.com&identifier=vmWf7bHEQY9y5Gwmrq9UWVnVojr8u1j9&secret=Ox123xEnP212T53k&responsetype=json"

Link to comment
Share on other sites

Uhm... wait a second. Why are you posting that URL? I am not up to date on recent changes of WHMCS but if we are talking about sending API commands, you should be using POST not GET. In other words I would expect you to send a POST request to http://example.com/includes/api.php and not the query string you provided.

Also, if you are using the API on the same system, you don't even need to send any request. You can directly use localAPI function.

Link to comment
Share on other sites

7 hours ago, Kian said:

Uhm... wait a second. Why are you posting that URL? I am not up to date on recent changes of WHMCS but if we are talking about sending API commands, you should be using POST not GET. In other words I would expect you to send a POST request to http://example.com/includes/api.php and not the query string you provided.

Also, if you are using the API on the same system, you don't even need to send any request. You can directly use localAPI function.

I am using the POST action, attached screenshot is my API test on postman, no matter set the `noinvoice` param to `true` or `false`, both didn't generate invoice. It seems this param has been ignored, or I have passed a wrong param/value?

AddOrder API doc: https://developers.whmcs.com/api-reference/addorder/

iShot_2022-12-21_10.58.24.png

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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