HelcimPay.js Initialization

This reference outlines the steps for initializing HelcimPay.js, including obtaining the checkoutToken for rendering the payment iFrame covered in the implementation process and the secretToken for validating the transaction response covered in the validation process.


The table below outlines the required headers for the request.

PropertyTypeNecessityDescription
api-tokenStringRequiredThe api access token. Refer to this support article.

The table below outlines the required payload for the request.

PropertyTypeNecessityDescription
amountNumberRequiredThe final amount of the transaction to process.
currencyStringRequiredThe currency of which the transaction will be processed.

CAD | USD
paymentTypeStringRequiredThe type of transaction.

verify | purchase | preauth
customerCodeStringOptionalAn existing Helcim customer’s code you want to tie the transaction with. If this field is not present, a new customer will be created and linked to the transaction.
invoiceNumberStringOptionalAn existing Helcim due invoice number you want to process. If this field is not present, a new invoice will be created and linked to the transaction.

Below is an example API call implementation that initializes the HelcimPay.js instance. Refer to the developer documentation for more interactive examples.

fetch('https://api.myhelcim.com/v2/helcim-pay/initialize', payload)
  .then(response => console.log(response))
  .catch(err => console.error(err));

The table below details the response payload received from the API upon successful execution.

PropertyTypeDescription
checkoutTokenStringThe token used for displaying the HelcimPay.js modal.
secretTokenStringThe token used for validating the transaction response.