Jump to content

Single order results even when multiple items ordered through the external API.


Recommended Posts

I am using python and the WHMCS external API to develop a custom store.
I am having trouble ordering more than one item from the external API method - AddOrder.
Whenever I try to order more than one item the resulting order only ever has one item in it.
For example I tried ordering 2 domains and passed the following data into AddOrder:

{ 'addonids': [],
'addons': [],
'billingcycle': ['annually', 'annually'],
'clientid': '18',
'clientip': '',
'configoptions': [],
'contactid': '18',
'customfields': [],
'dnsmanagement': [],
'domain': ['doubledomainorder1.com', 'doubledomainorder2.com'],
'domaintype': ['register', 'register'],
'emailforwarding': [],
'hostname': [],
'idprotection': [],
'nameserver1': 'ns1.blacknight.com',
'nameserver2': 'ns2.blacknight.com',
'nameserver3': 'ns3.blacknight.com',
'nameserver4': 'ns4.blacknight.com',
'nameserver5': None,
'ns1prefix': ['ns1'],
'ns2prefix': ['ns2'],
'paymentmethod': 'globalpay',
'pid': [1001, 1001],
'promocode': '',
'rootpw': ['', ''],
'serviceids': []}

This resulted in a single order for doubledomainorder2.com

I have tried using the example provided on https://developers.whmcs.com/api-reference/addorder/ with the same result.
I don't know if I am doing something incorrectly or there is a bug in the external API code.

Also, there is something I don't understand about the pid entry. It seems that domains do not have a pid (like products and services do). However, in the example on https://developers.whmcs.com/api-reference/addorder/ the pid was set to 'pid' => array(1,1) for the domain ordering.
So is the example correct? If so how do you find the pid for domains as the API call GetProducts does not return the pid for domains.
This would be useful for a mixed order of domains and say SSL certificates.

Any help would be much appreciated.

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.

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