Jump to content

Using AddTransaction API to issue a credit for invoice


Recommended Posts

In the application, you can open a paid invoice and issue a Refund and set the Refund Type as 'Add to Client's Credit Balance'. 

image.png.a9c7bb10d73968511e68d9ecfad056c5.png

What is the correct API request for this? Would the following work (sample is using localAPI from a hook? I don't see a description available when issuing from invoice refund, so not sure it applies. Also, is amountout correct?

		//Add create credit from refund transaction
		$command = 'AddTransaction';
		$values = array(
		'invoiceid' => $invoiceid, // this would be passed in as declared var
		'transid' => 'Test',
		'userid' => $clientid, // this would be passed in as declared var
		'description' => 'Credit added to client...', // not sure this would be used without testing
		'amountout' => $creditamt, // not sure if amountin or amountout is used. This would be passed in as delcared var
		'fees' => '0.00',
		'credit' => '1',

		);

		$addInvoiceCredit = localAPI($command, $values, $adminuser);

 

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