Availability Token Request / Group-APIs
In this article
Reserve resources and get token to confirm activity: GetAvailabilityToken()
Confirm group activity line: ConfirmGroupActivityV2()
Delete and cancel group activity: DeleteGroupActivity()
Update status on group header: UpdateGroupHeaderStatus()
Assigning additional charges (both on group reservation and on activity group lines)
Returning Group additional charges
Inserting, updating, and removing Group Members
Inserting, updating, and removing Group Members on a group line reservation
This is the recommended process for creating Activity Group reservations using the APIs:
- Reserve product availability using tokens (GetAvailabilityToken API).
- Create the group reservation (InsertGroupReservation API).
- Create the group members (SetGroupMembers API).
- Create the Group lines (ConfirmGroupActivity API).
Note: Do not use the status change parameter, just create the group lines without confirmation if you want to add named group members and add reservation charges. - Assign the members (AssignGroupMember API).
- Assign the additional charges on reservation and/or group lines (SetGroupAdditionalCharges API).
- Do Group reservation confirmation using confirmation status (UpdateGroupHeaderStatus API). Individual reservations are now created.
- The basket goes through standard eCommerce customer order API with order reference per line. You must set the Order reference field in order for payments to be applied.
- When the customer order is inserted into the database, payments/deposits are applied (subscriber MonitorIncomingPayment in the web support codeunit). Depending on the setup in the Activity Setup - Web section, the payments are either applied as deposit or fully paid.
Reserve resources and get token to confirm activity: GetAvailabilityToken()
GetAvailabilityToken(LocationNo: Code[20]; ProductNo: Code[20]; ActivityDate: Date; ActivityTime: Time; OptionalResource: Code[20]; SetQuantity: Decimal) : Text
This function reserves resources and returns tokens to confirm activity.
Confirm group activity line: ConfirmGroupActivityV2()
ConfirmGroupActivityV2(GroupNo: Code[20]; LocationNo: Code[20]; ProductNo: Code[20]; ActivityDate: Date; ActivityTime: Time; OptionalResource: Code[20]; OptionalComment: Text[200]; SetQuantity: Decimal; SetNoOfPeople: Decimal; Paid: Boolean; SetGroupReservation: Code[20]; PromoCode: Code[20]; ClientName: Text[20]; Email: Text[200]; UnitPrice: Decimal; CustomerAccountNo: Code[20]; Token: Code[50]; SetGroupHeaderStatus: Boolean; ReservationNo: Code[20]): Text
This function confirms group activity. Token and SetGroupHeaderStatus are optional.
Returns a JSON object with details of group activity.
Delete and cancel group activity: DeleteGroupActivity()
DeleteGroupActivity(GroupNo_p:Code[20]; GroupLineNo_p:Integer) :Text
This function deletes and cancels related activities for a specific group line. All parameters are required.
Update status on group header: UpdateGroupHeaderStatus()
UpdateGroupHeaderStatus(GroupNo: Code[20]; SetStatusCode: Code[20]) :Text
This function assigns a new status code to the group header. All parameters are required.
Create allowance for product/client when order line is received from web basket: PresellActivityProduct()
PresellActivityProduct(LocationNo: Code[20]; PromoCode: Code[20]; ClientNo: Code[20]; ProductNo: Code[20]; Quantity: Integer) : Text
Parameters LocationNo. (required), PromoCode, ClientNo. (required), ActivityProduct No. (required), Quantity (required).
This function creates pre-sell allowance entry for the selected product or client, when the Customer Order line is received from the web basket. Normally to sell an activity product in bulk, which can be later redeemed towards a booking.
Note: The redeeming is automatically done based on the client no. (member account/contact) during the normal booking process.
Return values
itemNo | The item no code. |
unitPrice | The unit price. |
bookingRef | The value to be assigned to the customer order line. |
Assigning additional charges (both on group reservation and on activity group lines)
SetGroupAdditionalCharges(GroupReservationNo: Code[20]; GroupLineNo: Integer; LineNo: Integer; ProductType: Option Item,Deal; ItemNo: Code[20]; Qty: Decimal; var Price: Decimal; var DiscountPercentage: Decimal; UOM: Code[20]; VariantCode: Code[20]; ParentLine: Integer; GroupMemberNo: Integer; OptionalComment: Text[200]; var ErrorString: Text): Boolean
This API allows insert, modification, and delete of additional charges. GroupLineNo as 0 refers to group reservation charges and are not associated with any activity group line.
GroupReservationNo, GroupLineNo: The group line to link to, set as 0 if reservation charge.
LineNo: The sequence of the charge line to insert,modify or delete.
ProductType: Option Item, Deal;
ItemNo: Item number or Deal Number.
Quantity: Set as 0 to delete the line.
Price: Set as -1 to use system pricing calculations.
DiscountPercentage: Set as -1 to use system discount calculations. These two fields (price and discount) are returning price and discount when using system calculations to retrieve the pricing.
Unit of Measure, Item Variant Code: These fields are only valid with item lines. Leave blank with deal lines.
ParentLine: Not Used.
Group Member sequence reference number, set as 0 = paymaster. Note: When assigning to a specific group line, the group member setting is ignored since it will be assigned on all related group members.
Optional Comment text - 200 character free text associated with the charge line.
Returning Group additional charges
GetGroupReservationAdditionalCharges(GroupReservationNo: Code[20]; GroupMemberNo: Integer; var ActivityChargeRespond: XmlPort "LSC Activity Charge Respond")
This API returns (as XML or Json) all additional charges on a group reservation, Parameter Group Reservation number, and optionally Group Member No. to filter the returned document on a specific group member only.
Inserting, updating, and removing Group Members
SetGroupMembers(GroupReservationNo: Code[20]; MemberSequence: Integer; MemberContact: Code[20]; Name: Text[100]; Email: Text[100]; Phone: Text[100]; GuestType: Code[20]; OptionalComment: Text[200]; var ErrorString: Text): Boolean
This API manages the insert, update, and deleting of group members on a group reservation.
Assigning the members of a group reservation. Note: The reservation must be in Draft status.
Note: A blank name deletes the group member record. Using Member Contact code is optional. Also note that each member gets a unique sequence number (MemberSequence), starting from 1 and onwards (increment of 1).
Inserting, updating, and removing Group Members on a group line reservation
AssignGroupMember(GroupReservationNo: Code[20]; GroupLineNo: Integer; MemberSequence: Integer; var
ErrorString: Text): Boolean
RemoveGroupMember(GroupReservationNo: Code[20]; GroupLineNo: Integer; MemberSequence: Integer; var ErrorString: Text): Boolean
These two APIs manage the assignment and removal of group members towards a group line reservation.