Skip to content

Custom Products API

A custom product is a service you fulfill yourself, optionally run by a plugin of your own. See Products. Besides update, an admin call servicecustom_<method> with an order_id runs that method of the service’s plugin (the same rules as the client call).

Admin calls need Module access on the Servicecustom card of the staff group’s Permissions tab, plus each call’s own permission below (Super Administrators have all). See Authentication.

POST /api/admin/servicecustom/update

Replaces the settings (config) of a custom service.

Permission: Manage custom services (servicecustom.manage)

Parameter Type Description
order_id integer, required The service’s order.
config object The new settings; they replace the old ones. Without it nothing changes.

Returns: true.

Errors:

  • Order not found (code 9999)
  • Order is not activated (code 9999) when the order has no service yet

POST /api/client/servicecustom/call

Runs a method of the plugin behind one of the client’s active custom services, such as a button on the service page. Any other parameters are passed to the method.

Parameter Type Description
order_id integer, required The client’s active order.
method string, required The plugin method. Not allowed: delete, cancel, uncancel, suspend, unsuspend, renew, activate and names starting with _.

Returns: What the plugin method returns; null when the service has no plugin or its file is missing.

Errors:

  • Order not found (code 9999)
  • Order is not activated (code 9999)
  • Custom plugin method cancel is forbidden (code 403)
  • Plugin MyPlugin does not support action reboot (code 3125)

The method gets the service, the order and all the call’s parameters. Authorized users need the Manage services permission.