The Helium REST API available to developers is the same API that Helium is built on; it powers both Helium.js and user dashboard. Each request returns JSON, and uses HTTP response codes to communicate successful requests and/or errors.
Each request to the API must be made over HTTPS and must use HTTP basic authentication with your private key. You can find your private key in Settings.
You should never share your private key. If you suspect that your key may have been compromised, you can also reset it in Settings.
Example: Making an authenticated request using Curl
curl https://gethelium.com/api/v1/items/ \
-u YOUR PRIVATE KEY:
This resource represents items (products) that you plan to sell.
As returned by GET and PUT methods.
If no SKU is defined, returns a list of all items. To filter the items returned, you can add one of more SKUs (delimited by semicolons) to the URL
None
Example: Returns a list of all items
>> curl https://gethelium.com/api/v1/items/ \
-u YOUR PRIVATE KEY:
>> [
{
"sku": "product-1",
"name": "Breath Mints",
"price": 100,
"type": "general"
},
{
"sku": "product-2",
"name": "Story of My Life",
"price": 999,
"type": "file",
"file": {
"name": "my-book.epub",
"location": "/api/v1/items/product-2/file"
}
},
{
"sku": "product-3",
"name": "Monthly Newsletter",
"price": 50,
"type": "plan",
"interval": "month"
}
]
Example: Returns only items “product-1” and “product-3”
>> curl https://gethelium.com/api/v1/items/product-1;product-3/ \
-u YOUR PRIVATE KEY:
>> [
{
"sku": "product-1",
"name": "Breath Mints",
"price": 100,
"type": "general"
},
{
"sku": "product-3",
"name": "Monthly Newsletter",
"price": 50,
"type": "plan",
"interval": "month"
}
]
To create a new item, or to edit an existing item, call PUT on this resource.
If the PUT is successful, the newly created/updated item will be returned. If there is an error, a description of the fields in error is returned.
Below is a list of the applicable parameters. Note, if you are calling a PUT on an item that already exists, you should only send across the parameters for which you are modifying.
Note, for subscriptions (that is, items where type="plan"), you may only alter the item’s name after its been created. You can't alter its price or interval. If you need to alter these values, simply create an item with a new SKU and new values.
Example: Creating a new item
>> curl https://gethelium.com/api/v1/items/product-4 \
-u YOUR PRIVATE KEY:
-X PUT
-d "name=Breath Mints (jumbo pack)"
-d "price=200"
-d "type=general"
>> {
"sku": "product-4",
"name": "Breath Mints (jumbo pack)",
"price": 200,
"type": "general"
}
Example: Editing the price of an item
>> curl https://gethelium.com/api/v1/items/product-4 \
-u YOUR PRIVATE KEY:
-X PUT
-d "price=400"
>> {
"sku": "product-4",
"name": "Breath Mints (jumbo pack)",
"price": 400,
"type": "general"
}
Example: Bad request, missing required values
>> curl https://gethelium.com/api/v1/items/product-5 \
-u YOUR PRIVATE KEY:
-X PUT
-d "name=Something random"
>> {
"errors": {
"price": "Price is required and must be at least 50",
"type": "Item type is required"
}
}
Deletes an item. Once deleted, the item can no longer be purchased by customers. If successful, this resource will return an HTTP response code of 204 and nothing will be returned in its body.
Example: Deleting an item
>> curl https://gethelium.com/api/v1/items/product-1 \
-u YOUR PRIVATE KEY:
-X DELETE
>>
This resource represents charges to customers’ credit cards (orders).
If no ID is defined, returns a list charges ordered by most recent to oldest. Specify an ID to retrieve only a given charges information.
Example: Returns a list of all charges
>> curl https://gethelium.com/api/v1/charges/ \
-u YOUR PRIVATE KEY:
>> [
{
"id": "NY3U2V5U9E2",
"card": {
"last4": "4242",
"type": "Visa"
},
"customer": {
"id": "LU1U2V5U9E2",
"email": "demo@gmail.com"
},
"fee": 0,
"created": 1351890105,
"items": [
{"sku": "laptop-stand", "price": 19900, "name": "Laptop Stand"},
{"sku": "laptop-bag", "price": 9900, "name": "Laptop Bag"}
],
"live": 1,
"shipping": 0,
"amount": 398
}
]
Use of this site and associated services acknowledges your acceptance of the GDPR / Terms of Service