Jump to content

Update invoice payments/transactions


pazion

Recommended Posts

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 ).

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

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.

Guest
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