ASP.NET VETtrak API web services
ContentsIndexHome
PreviousUpNext
VT_API.RecordPaymentForInvoice Method

Records a payment against an existing invoice.

C#
[WebMethod(Description = "Records a payment against an existing invoice")]
public TAuthID RecordPaymentForInvoice(string token, int invoiceId, string paymentTypeName, string paymentLocationCode, decimal amount, string paymentOrder, string RRN, string description, string externalIdentifier, DateTime? recordedDate);
Parameters 
Description 
string token 
String token. 
int invoiceId 
Integer ID of invoice to record payment against. 
string paymentTypeName 
Optional string of the name of the payment type to record for the payment. If null or empty, the payment type in the Configuration Manager with "default for web based payment processing" ticked is used. If specified, must be the name of a "positive" payment type. 
string paymentLocationCode 
Optional string of the code of the location the payment is made at. If null or empty, the "default location for payments" in the Programme Preferences tab of VETtrak Preferences will be used. 
decimal amount 
Decimal dollar amount of the payment, including any GST. Must be more than 0. 
string paymentOrder 
String payment order number to record on the payment. Maximum length 20 characters. 
string RRN 
String RRN number to record on the payment. Maximum length 20 characters. 
string description 
String to record as the payment description. 
string externalIdentifier 
Optional string to record as the external payment identifier. Maximum length 50 characters. 
DateTime? recordedDate 
Optional date the payment was recorded. If not specified, will be set to today. 

TAuthID indicating whether the payment was recorded successfully and the ID of the payment that was created.

The invoiceId parameter must be the ID of an existing invoice to record the payment against. 

The amount is automatically disbursed against the invoice items that are not yet fully paid. If the amount is greater than that owing on the invoice, the excess amount is posted to the holding account for the invoicee on the invoice. 

The paymentTypeName parameter is optional. If specified, it is the type of the payment (such as "Cash" or "Credit Card"), and it must be the name of a payment type set up in the Configuration Manager. Use the GetPaymentTypes function to retrieve a valid list of payment types you can use. If it is null or empty, the payment type with "default for web based payment processing" ticked is used - if no payment types have this ticked, an error will occur. 

The paymentLocationCode parameter is optional. If specified, it is the location of the payment, and it must be the code of a location set up in the Configuration Manager. Use the GetLocations function to retrieve a valid list of locations you can use. If it is null or empty, the "default location for payments" set up in the Programme Preferences tab of the VETtrak Preferences will be used - if this configuration is invalid, an error will occur. If this error occurs, ensure that you are using VETtrak version 4.3.9.12 or later, and in VETtrak go to the File menu -> Preferences -> Programme Preferences, check the "default location for payments", and press the Finish button to ensure the setting is saved correctly. 

The amount parameter is the dollar amount of the payment, including any GST. It must be greater than 0. 

The paymentOrder parameter is the order number to record on the payment. 

The RRN parameter is the RRN number to record on the payment. 

The description parameter is an optional description to record on the payment. 

The recordedDate parameter is an optional date of the payment. If not specified, will be set to today. 

The returned TAuthID indicates whether the payment was recorded successfully and, if so, the ID property contains the ID of the new payment. 

In the Portals API, invoices may be retrieved using the GetInvoicesForClient or GetInvoicesForEmployer functions. 

In the Enrol API, the invoice ID of a processed web enrolment is returned in the InvoiceId property in the TProcessedWebEnrol by the ProcessWebEnrolment function, allowing a subsequent payment to be recorded for the invoice that was created for a processed web enrolment. 

A token is passed for authentication. If the authentication fails, or other errors occur, no event types are returned. The result of the authentication is represented by a TAuthenticate object. 

Requires a valid registration key entry for the Finance feature. 

This function has security level "Protected", and can only be accessed by users that have explicitly been granted permission to the API.

Copyright (c) VETtrak 2022. All rights reserved.