Jump to content

addOrder ignores affid?


niels

Recommended Posts

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?

 

Link to comment
Share on other sites

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 by niels
Link to comment
Share on other sites

  • WHMCS Staff

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.

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