Appearance
Overview
The Invoiceable API uses Bearer Tokens to authenticate requests. This is a standard security protocol where you exchange a generated token for access to protected resources.
You must include this token in the header of every API request.
Prerequisites
Subscription Required
API access is reserved for active subscribers. You cannot generate or use API tokens without a valid subscription plan.
Before you can authenticate, please ensure:
- You have created an account.
- You have completed a subscription (Abo) in your dashboard.
- Your subscription status is active.
Obtaining a Token
Once you have an active subscription, you can generate your API tokens:
- Log in to your Dashboard.
- Navigate to Settings > API Tokens.
- Click on "Create New Token".
- Give your token a descriptive name (e.g., "Production Website" or "Testing").
- Copy the token immediately. For security reasons, we will never show it again.
Usage
Include the token in the Authorization HTTP header of your request. The format is Bearer <your_token>.
Header Format
http
Authorization: Bearer 1|aBcDeFgHiJkLmNoPqRsTuVwXyZ123456
Accept: application/json
Content-Type: application/jsonExamples
cURL
bash
curl -X GET https://api.invoiceable.com/v1/invoices \
-H "Authorization: Bearer 1|aBcDeFgHiJkLmNoPqRsTuVwXyZ123456" \
-H "Accept: application/json" \
-H "Content-Type: application/json"Python
python
import requests
url = "https://api.invoiceable.com/v1/invoices"
headers = {
"Authorization": "Bearer 1|aBcDeFgHiJkLmNoPqRsTuVwXyZ123456",
"Accept": "application/json",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())PHP
php
<?php
$url = "https://api.invoiceable.com/v1/invoices";
$token = "1|aBcDeFgHiJkLmNoPqRsTuVwXyZ123456";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer " . $token,
"Accept: application/json",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;JavaScript (Fetch)
javascript
const url = "https://api.invoiceable.com/v1/invoices";
const token = "1|aBcDeFgHiJkLmNoPqRsTuVwXyZ123456";
fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
"Accept": "application/json",
"Content-Type": "application/json"
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));