Skip to content

Service

The following hooks are provided for Service related events.

CancellationRequest

Executes as a cancellation request is being created

Parameters

VariableTypeNotes
useridint
relidintThe id of the service being cancelled
reasonstring
typestring

Response

No response supported

Example Code

<?php
add_hook('CancellationRequest', 1, function($vars) {
    // Perform hook code here...
});

PreServiceEdit

Executes as the service is being saved, before any changes have been made.

Parameters

VariableTypeNotes
serviceidint

Response

No response supported

Example Code

<?php
add_hook('PreServiceEdit', 1, function($vars) {
    // Perform hook code here...
});

ServiceDelete

Executes when the Service has been deleted.

Parameters

VariableTypeNotes
useridintAn alias for $clientId maintained for backwards compatibility
clientIdintThe client associated with the service
serviceidintThe product service ID

Response

No response supported

Example Code

<?php
add_hook('ServiceDelete', 1, function($vars) {
    // Perform hook code here...
});

ServiceEdit

Executes when the Service has been edited. After the changes have been made.

Parameters

VariableTypeNotes
useridint
serviceidint

Response

No response supported

Example Code

<?php
add_hook('ServiceEdit', 1, function($vars) {
    // Perform hook code here...
});

ServiceRecurringCompleted

Executes when the Recurring Cycles Limit is reached for a product.

Parameters

VariableTypeNotes
serviceidint
recurringinvoicesintThe total count of invoices generated

Response

No response supported

Example Code

<?php
add_hook('ServiceRecurringCompleted', 1, function($vars) {
    // Perform hook code here...
});