niels Posted March 12, 2019 Share Posted March 12, 2019 I'm using the API to create orders. This works fine so far: clientid, pid, billingcycle, promocode and paymentmethod are all used as expected. The affid however seems to be ignored. For example: $this->post("addorder", "json", array( "clientid" => 1, "pid" => 1, "affid" => 1, "paymentmethod" => 'paypal' )); This creates an order for user 1, product 1, using PayPal. But it does not assign affiliate 1 to the order. (Affiliate 1 is a properly activated affiliate. I can use the Manual Assign feature after to assign the affiliate after the order is created.) Is this a bug? Or am I missing something? Is anyone using this successfully? 0 Quote Link to comment Share on other sites More sharing options...
niels Posted March 12, 2019 Author Share Posted March 12, 2019 (edited) Answering my own question: A client cannot place an order using their own affiliate ID. Makes sense, I suppose. Silently ignoring this is confusing though. An error from addOrder would be preferable, or at least a mention in the documentation for addOrder. To make matters more confusing: I noticed addOrder will accept and assign non-existent affiliate ID's. (The affiliate will show as empty in WHMCS and the Manual Assign button will not show.) This means I should check the existence of an affiliate ID before using it, but there's no convenient API call to do so. GetAffiliates does not accept an affid variable and retrieving all affiliates is rather excessive (10.000+ in our database). Will file a bug report for this one. Edited March 12, 2019 by niels 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Staff WHMCS Peter Posted March 12, 2019 WHMCS Staff Share Posted March 12, 2019 Hi @niels, I've been looking in to your reported issue relating to WHMCS allowing non-existing affiliate ID's to be assigned. It appears there is a defect here. Case #CORE-13262 is open with our developers in order to have this reviewed for future releases. Whilst I cannot provide an estimated time for completion for this, once we resolve cases and push features they are available at our change log, here: http://changelog.whmcs.com/ I apologize for the inconvenience, and appreciate your patience as we work to resolve this. Thanks again for taking the time to report your findings. 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.