🧾Create Charges via API

Create single-use Pay Links called Charges seamlessly

Charges are an extended feature to Helio Pay Links that allows you to create unique, single-use payment links.

Charge creation is currently supported for the Solana network, with ETH, BTC and other chain support coming soon

Pre-requisites

In order to create a Charge using the Helio API, you need to complete the following steps.

1. Create Helio Account & get API keys

  • Navigate to https://app.hel.io and login by using any of the login methods.

  • Navigate to the settings page and select the API tab.

  • Click on Enable checkbox, this will generate Public API Key and Secret API Key for you.

  • Save both securely since you won't be able to retrieve the Secret API Key again, however, you can always regenerate both (which will override the old one).

2. Create a Pay Link

  • Navigate to the Pay Links section on https://app.hel.io and create a new Pay Link.

  • Fill in the required details, set the price and generate the pay link.

  • Note: You can also create a Pay Link via API.

Create the Charge using your API Key

  • Once you have create a pay link you can get the paymentRequestId of the pay link by navigating to the Pay Links -> Edit a pay link -> Integration and copying the Id at the end of the link within Share Pay Link.

For dynamic pricing, follow the same steps but copy the ID from the URL in your browser instead.

  • API Endpoint: https://api.hel.io/v1/charge/api-key

  • HTTP Method: POST

  • Required Query Parameters: ?apiKey={{Your public key here}}

  • Required Headers: Authorization: Bearer {{Your API Token here}}

Example request body:

{
    "paymentRequestId": "667974dbb38d45b726751902",
    "requestAmount": "0.2"
}
  • For regular pay links only paymentRequestID is required.

  • If you select dynamic pricing when creating a pay link you'll need to specify requestAmount, this is the amount the user pays.

Example response body:

{
    "id": "667c375be240df9843f7f4f9",
    "pageUrl": "https://app.hel.io//charge/87e3482c-669b-4c62-ab01-23239889acb4"
}
  • "id" represents the id of the charge.

  • "pageUrl" is the url of the charge page.

Example query:

curl --location 'https://api.hel.io/v1/charge/create/api-key?apiKey=<YOUR_PUBLIC_API_KEY>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_API_KEY' \
--data '{
    "paymentRequestId": "667974dbb38d45b726751902",
    "requestAmount": "0.2"
}'

From the following example replace: YOUR_PUBLIC_API_KEY, YOUR_SECRET_API_KEY, with the values you collected in the previous step.

Last updated