Before you start #
Make sure you’ve entered your credentials and endpoints on the Plugin settings page – see Plugin Setup for information.
Collect Data #
You’ll need:
- Your Access Token from a previous step in the same Workflow
- A customer number
- A transaction reference
Create a Workflow #
Create a Workflow, and add the “BPAY – Create CRN” action from the “Plugins” tab of the Actions list.
Biller Code #
The Biller Code this request relates to.
Authorization #
Formatting is strict.
From the previous step, the “token_type” and the “access_token” with a space between them. For example:
Bearer QmVhbnNCZWFuc0JlYW5z
TID #
A unique transaction ID, this will be passed back in the response for validation purposes.
Customer Number #
The customer number you wish to convert to a CRN. This must contain exactly one digit less than the Biller’s valid format. For example, if the Biller’s valid CRN format is 9 digits, you must pass exactly 8 digits. If the Biller has more than one valid format, the same principle applies as long as it is applied to one of these formats.
Parse Response #
The response will contain:
crnResults #
An array containing the following:
tid #
The same format as passed to BPAY in your request.
billerCode #
The same format as passed to BPAY in your request.
baseCustomerNumber #
The same format as passed to BPAY in your request.
crn #
The CRN generated for this request.
crnGenerationSummary crnGenerationCode #
Error code – anything other than a 0 is a fail.
crnGenerationSummary crnGenerationMessage #
If the crnGenerationCode ≠0, this will provide basic information on the reason for failure, as text.
Next Actions #
You will now have data you can pass to a Thing, Element, or both.
We recommend including a step that handles the error written in “crnGenerationMessage” if the “crnGenerationCode” is not 0. For example, display the error in an alert then terminate the workflow.
Remember, if you use the “Terminate workflow” action, you must apply the “Only when” to the terminate action as well as the step parsing the error, or the workflow will stop here even if there is no error.
Because BPAY supports multiple CRNs being created in one request, the crnResults item is returned as an array.
Our plugin only supports single-CRN creation at this time, so when parsing your result, you’ll need to select “Results of step X (BPAY – Create CRN)’s crnResults”:first item, to interact with the data.