dotbloup Posted April 25, 2018 Share Posted April 25, 2018 If I understand it well, in WHMCS, the order ID is always equal to invoice ID? In WHMCS, when an order is created, an invoice is also simulteneously created. I wonder if I can use an Invoice ID to find an order ID when i call it from an internal API function. . Are there situations where the Order ID isn't equal anymore to the Invoice ID? 0 Quote Link to comment Share on other sites More sharing options...
mbit Posted April 26, 2018 Share Posted April 26, 2018 orderID and invoiceID are two separate things and are not "in sync", but they are "connected" in WHMCS DB tables They may be the same in the beggining (for the first few orders) as each order creates a new invoice. As soon as you create an invoice on itself, IDs will not be the same. I don't think any API function gets you the orderID from an invoiceID but you can get it yourself. If you need to get the orderID from the original invoiceID generated by that order, try something like this: use Illuminate\Database\Capsule\Manager as DB; $orderID = DB::table('tblorders')->where('invoiceid', '1')->value('id'); 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.