pazion Posted June 12, 2014 Share Posted June 12, 2014 I am preparing to write a web interface for a customer to update payments from their bookkeeping software to WHMCS. ClientID and InvoiceID are known and matched, so I checked and see I can use Add_Payment to set invoice to paid. For matching and reference I want to use the transids from the bookkeeping software in the WHMCS payment information for all invoices. Problem is some invoices were already paid online and have their own transid. Can I do an "addinvoicepayment" altough invoice is already set to paid and just add bookkeeping transid? Or does this mean invoice is 2 times paid and adds extra credit to the account? Can I update transaction to set transid from bookkeeping to match the payment and prevent double payments? Or add an extra transaction and set it paid? Or does this add the amount to the reporting as well make the income figures wrong? Looking forward to someone who has a clear answer how we can add all payments from our bookkeeping into WHMCS without corrupting things as we already have payments handled by WHMCS ( should remain too because of the (un)suspending logic ). 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Ryan Posted June 13, 2014 Share Posted June 13, 2014 Hello pazion, Unfortunately the Add Payment is always going to add a payment to the account even if the invoice is already paid. You might want to look at the Update Transaction API - http://docs.whmcs.com/API:Update_Transaction. This will allow you to update an already paid invoice. If you need to add a transaction then you would use the Add Transaction API - http://docs.whmcs.com/API:Add_Transaction. Try those out and see if they do the job. --Thanks 0 Quote Link to comment Share on other sites More sharing options...
pazion Posted June 16, 2014 Author Share Posted June 16, 2014 Hi Ryan, Thanks for the clarification. I already thought add_payment would not be sufficient for my purpose Looks like I should go for update_trasnaction. I couls also create 2 transactions a positive and a negative with the same amount? Or would you advice against this? Add_payment and add_transaction use the same table/entity? ( or do I also need to do an add_payment when I do an add_transaction )? Thanks in advance! 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.