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

Sets the pricing items and amounts for a Web Enrolment. 

By default, when a Web Enrolment is processed, the new enrolment is given all web published pricing items that have been assigned to the occurrence that the Web Enrolment is for, and the total amount is set accordingly. Use this function to set particular pricing items, and particular amounts for those pricing items, to be assigned to the new enrolment. The pricing items must be web published and assigned to the occurrence that the Web Enrolment is for. 

A Web Enrolment ID (webEnrolId) is passed as a parameter. This should be the ID returned by the function used to create the web enrolment: AddClientWebEnrolment or AddEmployerWebEnrolment

The parameter priceTypes is a List of TPric, indicating the pricing items and amounts for them to assign to this Web Enrolment. The easiest way to get a list of these is to use the GetPricingForOccurrence function to get a list of all pricing items for the occurrence the Web Enrolment is for. 

In each TPric, the Enpr_ID (or, for backward compatibility with older API versions, the Pric_ID) must be set to indicate the pricing item, and the Enpr_Amount and Enpr_GST can be set to the amount to use. Note that Enpr_Amount must include any GST component, and both Enpr_Amount and Enpr_GST must include any surcharge component. If Enpr_Amount or Enpr_GST are null, the price for the pricing item in the occurrence is used. All other fields in each TPric are ignored. 

It is highly recommended that you specify the Enpr_ID in each TPric, instead of specifying the Pric_ID, as the Enpr_ID uniquely identifies the particular pricing item you want from the occurrence. If Enpr_ID is specified, Pric_ID is ignored. 

The ability to leave Enpr_ID as null or 0 and set the Pric_ID instead is deprecated and for backward compatibility only. Pric_ID only identifies the type of pricing item, and so specifying a Pric_ID only will add each published pricing item of that type in the occurrence to the web enrolment, which may result in putting multiple pricing items in the web enrolment. In addition, if you also specify an Enpr_Amount and/or Enpr_GST, this amount will be applied to each pricing item of that type, which may be incorrect. Also note that Pric_ID cannot be used to specify an inventory item - Enpr_ID must be used to specify an inventory item price. 

This function also updates the total amount in the Web Enrolment with the total of the pricing item amounts. 

A subsequent call to this function for the same Web Enrolment ID will override all the price types given on any previous call for that Web Enrolment ID. 

Note that when the web enrolment is processed, if you have used AddUnitsToWebEnrolment to exclude some units from the occurrence in the new web enrolment, then any occurrence prices linked to those excluded units will also not be included in the new enrolment, whether or not you have used this AddPriceTypesToWebEnrolment function to specify pricing items for those excluded units. The same applies if some units are not added to the new enrolment because they have been linked to an existing enrolment for the client. 

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

Requires a valid registration key entry for the Short Courses feature. 

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

C#
[WebMethod(Description = "Records the specified pricing items and amounts against the existing web enrolment ID")]
public TAuthenticate AddPriceTypesToWebEnrolment(string token, int webEnrolId, List<TPric> priceTypes);
Parameters 
Description 
string token 
String containing a token. 
int webEnrolId 
Integer ID of Web Enrolment. 
List<TPric> priceTypes 
List of TPric, containing each Enpr_ID and optionally the amount and GST to add to the web enrolment. 

TAuthenticate : an Authenticate Object containing the result of the update.

Copyright (c) VETtrak 2022. All rights reserved.