credits
The credits
-endpoint returns the current credit balance and next top-up date of an account.
Endpoint: 'https://api.pdfteam.com/api/credits'
Method: 'POST'
Cost: 0
Params:
{
user: string;
key: string;
}
// user: user name, see section 'API Access' in your account
// key: API key, see section 'API Access' in your account
Returns:
{
endpoint: string;
credits: number;
topup_date: string;
topup_amount: number;
}
Code sample (NodeJS with fetch
):
// Sample code for accessing the PDFTeam API, endpoint: credits
const url = 'https://api.pdfteam.com/api/credits';
let params = {
user: 'YOUR_USERNAME',
key: 'YOUR_APIKEY',
};
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(params),
}).then((result) => {
result.text().then((text) => {
console.log(text);
});
});
Sample response:
{
'endpoint':'credits',
'credits':1045,
'topup_date':'2025-04-25T00:00:00.000Z',
'topup_amount': 1000
}
Note 1: The number of consumed credits is also returned from a successful PDF conversion job
Note 2: Credit balance and next top-up date are also available in your account overview