Cloud is My Home Posted July 21, 2019 Share Posted July 21, 2019 Hello, I wanted to get the Order ID using the invoice ID with API (Internal) or with by Interacting with the database I would love it if someone helps me with this. Thanks! 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted July 22, 2019 Share Posted July 22, 2019 This query provides Order ID and Order Number using Invoice ID as input parameter. SELECT id, ordernum FROM tblorders WHERE invoiceid = '{YOUR_INVOICE_ID}' LIMIT 1 1 Quote Link to comment Share on other sites More sharing options...
Cloud is My Home Posted July 23, 2019 Author Share Posted July 23, 2019 Thanks Kian this has worked for me. But I was wondering how can I achieve using Capsule https://developers.whmcs.com/advanced/db-interaction/ 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 23, 2019 Share Posted July 23, 2019 4 hours ago, Cloud is My Home said: But I was wondering how can I achieve using Capsule the capsule equivalent would be... $orderid = Capsule::table('tblorders')->where('invoiceid','{YOUR_INVOICE_ID}')->value('id'); if you wanted ordernum instead, you would change ->value('id') to ->value('ordernum') 1 Quote Link to comment Share on other sites More sharing options...
Cloud is My Home Posted July 26, 2019 Author Share Posted July 26, 2019 On 7/23/2019 at 10:47 AM, brian! said: the capsule equivalent would be... $orderid = Capsule::table('tblorders')->where('invoiceid','{YOUR_INVOICE_ID}')->value('id'); if you wanted ordernum instead, you would change ->value('id') to ->value('ordernum') This worked just fine, Thanks! 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.