Errors and error Handling

Integrating with HelcimPay.js involves a single API call to initialize your checkout session. This is where the majority of potential errors from HelcimPay.js are likely to originate.

Ensuring that you have configured your account correctly, sent the required header and body parameters, and are sending your request from your websites secure back-end server, will all help to ensure you eliminate or resolve any potential errors.

Some of the common errors you may come across and their respective solutions are covered below.

Unauthorized

This status 401 error response will be returned if you have attempted a request with an invalid or inactive api-token. Confirm your api-token is correct and active, in the Integrations section of your Helcim account, then attempt your request again.

{
  "errors": "Unauthorized"
}

No access permission

This status 401 error response will be returned if you have attempted a request that requires permissions that the api-token passed in the request is not allowed to complete. Update your token permissions in the Integrations section of your Helcim account and attempt your request again.

{
    "errors": "No access permission"
}

Missing required data

This status 400 error response will be returned if you have attempted a request that is missing required parameters in the request body. Update your request to include the missing parameters before attempting your request again.

{
  "errors": {
    "paymentType": "Missing required data payment Type"
  }
}

Cross-origin resource sharing (CORS) error

This error response returned in the browser is often the result of trying to initialize your HelcimPay.js checkout session from your client-side code. All requests to the Helcim API must be completed from your website or applications secure back-end server.

Access to fetch at 'https://api.myhelcim.com/v2/helcim-pay/initialize' from origin 'https://your-url.com' has been blocked by CORS policy:
Request header field api-token is not allowed by Access-Control-Allow-Headers in preflight response.