Configuring Remote Event Handling
Remote event handlers allow you to subscribe an external system to Billing events. This, in turn, allows you to build an integration solution to obtain the necessary data from CloudBlue Commerce once an event of a certain type occurs. For example, you can create a solution to receive invoices as soon as they are generated in CloudBlue Commerce and print them using a third-party system in your preferred format.
Note: Regarding the event-based integration, – the preferable, supported and to-be extended in the future way is to use events available on APS Bus. For details, refer to APS documentation.
How remote event handlers work
- An external web service is registered in Billing as a Remote Event Receiver, and waits for the notification on event from Billing.
- When an event of the necessary type occurs, the Remote Event Receiver receives a notification from Billing, and passes the event parameters to the respective Remote Event Handler.
- The Remote Event Handler parses the parameters, then responds to the external web service with a call that contains the necessary information.
For example, you need to track invoices in your external system (web service). In this case:
- You register your external web service in Billing as Remote Event Receiver.
- You create the Remote Event Handler, specifying that:
- On occurrence of the Invoice Created event, the web service (Remote Event Receiver) will be notified by Billing.
- You also specify that when the web service sends the event data, the Event Handler should parse it, and send back the ID of the created invoice.
- Then this ID can be used by the web service as you like. For example, the web service can call the ARDocDetailsListGet_API method to obtain details of the document, that would allow to create some nice printing copy of the invoice.
Overview of Remote Event Handling
- CloudBlue Commerce and Remote Web Services support only secure messaging via HTTPS between themselves.
- CloudBlue Commerce supports query in URL. You can specify an external URL as the target of an HTTPS call, including the URL query part.
- The generic URL structure is:
[protocol]://[user]:[passwd]@[domainname]/[path]?[query]
. The final URL for a call is a combination of the base URL (specified during the Remote Event Receiver configuration) and the relative path (specified during the Remote Event Handler configuration).
Note: CloudBlue Commerce allows you to leave the relative path empty.
- The generic URL structure is:
- CloudBlue Commerce supports HTTP verbs POST, PUT, GET, DELETE verbs for an HTTPS call.
- CloudBlue Commerce sends the Event Type and parameters serialized as a JSON object in the HTTPS requests for the verbs POST and PUT.
- CloudBlue Commerce sends the Event Type and parameters serialized as a QUERY in the HTTPS requests for the verbs GET and DELETE.
-
CloudBlue Commerce supports default values of event parameters.
CloudBlue Commerce allows you to describe the event parameters and set their default values in the Signature field of the Remote Event Handler configuration (in the same way as for the local event handler type).