dperron25 Posted February 8, 2018 Share Posted February 8, 2018 i create invoice with api in whmcs so i want to link a new invoice with the service. how i can solve this situation Thank you Link to comment Share on other sites More sharing options...
twhiting9275 Posted February 10, 2018 Share Posted February 10, 2018 What do you mean? You want to create a URL for the customer to pay? That'll be something like whmcs//viewinvoice.php?id=INVOICEID . You can get the invoiceid from the API results... If you're using the examples here, then that'd turn out something like { "result": "success", "invoiceid": "1", "status": "Unpaid" } so, the invoiceid would be $invoiceid = $results['invoiceid']; Link to comment Share on other sites More sharing options...
dperron25 Posted February 10, 2018 Author Share Posted February 10, 2018 no I created an API to create invoices in whmcs but I am not able to attach the invoice created by API to a service Link to comment Share on other sites More sharing options...
dperron25 Posted February 10, 2018 Author Share Posted February 10, 2018 because a dont have relid on api create invoice Link to comment Share on other sites More sharing options...
twhiting9275 Posted February 11, 2018 Share Posted February 11, 2018 Correct. Those should be used for one off invoices, not product created invoices. Link to comment Share on other sites More sharing options...
dperron25 Posted February 11, 2018 Author Share Posted February 11, 2018 how i can add relid with api it is possible ? Link to comment Share on other sites More sharing options...
twhiting9275 Posted February 11, 2018 Share Posted February 11, 2018 No, it is not, and it shouldn't be. These, as I mentioned, are for one off invoices, not services which renew. Once you start playing with that, you're really getting yourself into trouble. WHMCS has a hard enough time trying to keep invoices straight, without worrying about APIs messing products and services up. Link to comment Share on other sites More sharing options...
dperron25 Posted February 11, 2018 Author Share Posted February 11, 2018 okay in this case i'm going to create a mysql query to modify the relid thanks you again Link to comment Share on other sites More sharing options...
twhiting9275 Posted February 12, 2018 Share Posted February 12, 2018 Like I said, that's not the proper way to go about this. You need to leave the automated invoicing side of things alone, unless you know full well what you're doing. WHMCS has enough problems trying to keep invoices straight, simply 'attaching a relid' to an invoice already in play will screw things up Link to comment Share on other sites More sharing options...
dperron25 Posted February 12, 2018 Author Share Posted February 12, 2018 I know but nowadays I am selling IP telephony and I can not put the service at a fixed price because it depends on the call time if it changes and I want if the customer does not pay the bill that he suspends the service Link to comment Share on other sites More sharing options...
twhiting9275 Posted February 12, 2018 Share Posted February 12, 2018 What you're trying to do is a hack. It's better (honestly) to utilize a module that is built for your system specifically, and can calculate things like this. Since you've got something to suspend automatically, you've got the framework for the module in place. Shouldn't be terribly hard to add a per minute charge if over X minutes Link to comment Share on other sites More sharing options...
dperron25 Posted February 12, 2018 Author Share Posted February 12, 2018 I know but I already created the module that calculates everything but I am not able to interfere with billing without going through API Link to comment Share on other sites More sharing options...
Recommended Posts