DocuBeaver Help
How Credits Work
Our credit system is designed to give you flexibility and control over your API usage. Here’s how it works:
- Each page in a PDF consumes 1 credit when generated via the API. For example, if you generate a PDF with 1 page, you’ll consume 1 credit. If you generate a PDF with 100 pages, you’ll consume 100 credits.
- Free plan users receive 200 credits per month which are not carried over to the next month.
- Pro tier users receive 10,000 credits per month which are carried over to the next month.
- Enterprise users have unlimited credits and custom solutions.
Monitoring Your Usage
You can monitor your credit usage in real-time through your dashboard. This allows you to keep track of your API calls and plan accordingly.
Exceeding Free Tier Limits
If you exceed your monthly credit limit on the Free tier, you’ll need to upgrade to the Pro tier to continue making API calls. We’ll notify you when you’re approaching your limit.
PDF Generation Via Forms
Every template you create will have a form associated with it. You can use this form to generate PDFs by submitting the form data. This is useful for generating invoices, contracts, reports, and any other PDF documents. This is a free feature and does not consume any credits.
Making API Calls
You can call the API in the following way. You’ll need to provide your API key in the Authorization
header of your request. You can create API keys in your dashboard.
$ curl -X POST
https://api.docubeaver.com/v1/generate-pdf \\
-H "Authorization: Bearer <YOUR_API_KEY>" \\
-H "Content-Type: application/json" \\
-d '{
"templateId": "67827e7ea2d5597db6b8b51e",
"data": {
"invoice.number": "INV-001",
"invoice.date": "2023-01-01",
"invoice.due_date": "2023-01-31",
"invoice.total": "$100.00",
"customer.name": "Acme Corp",
"customer.address": "123 Main St, Anytown, USA",
"customer.email": "info@acme.com",
"customer.phone": "555-123-4567",
}
"webhookUrl": "https://example.com/webhook?userId=123",
"password": "ilovedocubeaver"
}'
- The
templateId
is the unique identifier of the template you want to generate a PDF for. It can be found in the templates tab in the dashboard. - The
data
object contains the data you want to fill in the template with. It’s a JSON object where the keys are the field names and the values are the field values. All the keys and values must be strings. - The
webhookUrl
is a URL where the API will send a POST request when the PDF is generated. The request will contain the url of the generated PDF which is valid and stored for 3 days. After 3 days, the PDF will be deleted from our servers and cannot be accessed. - The
password
is an optional parameter that you can use to encrypt the generated PDFs. If you don’t provide a password, the generated PDFs will be unencrypted.
Response
The API will return the following response if the PDF generation is successful:
{
"success": true,
"message": "PDF generated successfully",
"payload":{
"taskId": "578b7e7ea2d5d97d36b6b51e",
}
}
taskId
is the unique identifier of the task that was created to generate the PDF. You can use this to check the status of the task in the dashboard.
On failure, the API will return the following response:
{
"success": false,
"message": "Failed to generate PDF",
"error": {
"code": "INVALID_TEMPLATE",
"message": "Template not found"
}
}
code
is a short code that describes the error.message
is a more detailed description of the error.
API Rate Limits
We have set API rate limits to prevent abuse. If you exceed the rate limit, you’ll receive an error message.