API:Add Transaction

From WHMCS Documentation

Jump to: navigation, search

This command is used to add a transaction.

Attributes

userid - Optional Add Transaction to a user
invoiceid - Optional Add transaction to a particular invoice
description - Description of the transaction
amountin - amount to add to the account
amountout - if an outgoing enter this
fees - transaction fee you were charged
paymentmethod - gateway used in WHMCS
transid - Transaction ID you wish to assign
date - date of transaction (same format as your WHMCS eg DD/MM/YYYY)

Example Command

$postfields["action"] = "addtransaction";
$postfields["userid"] = "1";
$postfields["invoiceid"] = "1";
$postfields["description"] = "Test Transaction";
$postfields["amountin"] = "10.00";
$postfields["fees"] = "0.99";
$postfields["paymentmethod"] = "paypal";
$postfields["transid"] = "HGHW483DJ3";
$postfields["date"] = "31/12/2008";

Returned Variables

result - success or error
message - only returned with error

About the API System · Example API Usage · API Functions

API Functions
Add Client - Update Client - Delete Client - Get Clients - Get Clients Details - Get Clients Products - Get Clients Password - Send Email
Get Support Departments - Get Support Statuses - Get Tickets - Get Ticket - Get Ticket Predefined Cats - Get Ticket Predefined Replies
Open Ticket - Reply Ticket - Add Ticket Note - Delete Ticket
Module Create - Module Suspend - Module Unsuspend - Module Terminate
Create Quote - Update Quote - Delete Quote - Send Quote - Accept Quote
Get Orders - Get Order Statuses - Add Order - Accept Order - Pending Order - Cancel Order - Fraud Order - Delete Order
Get Invoice - Get Payment Methods - Create Invoice - Add Billable Item - Add Invoice Payment
Add Transaction - Add Credit - Capture Payment
Domain WHOIS Lookup - Get Activity Log - Get Admin Details - Update Admin Notes - Get Currencies - Get Email Templates
Get To-Do Items - Get To-Do Item Statuses - Get Staff Online - Get Stats - Encrypt Password - Decrypt Password