> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.pdfgeneratorapi.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to Integrate with Xano

[Xano](https://www.xano.com/) is the fastest way to build a scalable backend for your App using No Code. Each Xano account comes with a scalable server, a flexible database, and a No Code API builder that can transform, filter, and integrate with data from anywhere. Xano is one of the few no code backend platforms that provides a comprehensive Database test environment, allowing you to switch between production and test data easily.

You can use PDF Generator API with Xano to quickly generate PDF documents using the data you already have in your Xano application (e.g. store orders, database records).

* [API documentation](https://docs.pdfgeneratorapi.com/v3/)
* [Download Snippet from Xano Marketplace](https://www.xano.com/snippet/jn7mDmAP)
* [Example API](https://x8ki-letl-twmt.n7.xano.io/apidoc:GBLiHqx8)
* [Example documents](https://pdfgeneratorapi.com/templates/free-templates)

### Example API

You can try out our example API [here](https://x8ki-letl-twmt.n7.xano.io/apidoc:GBLiHqx8). You can use `389486` as `template_id` value for in `generate_document` and `get_editor_url` endpoints. In the orders endpoint, you can use `1` as the `orders_id` value to generate an invoice for the order.

### Setup

To use PDF Generator API with Xano, you need a PDF Generator API account. You can create a [free Sandbox Account](https://us1.pdfgeneratorapi.com/signup) and use it for **14 days** to evaluate and integrate the API, with **up to 50credits** available during the trial period.

| For more information on how credit usage is calculated, see this [article](https://support.pdfgeneratorapi.com/en/article/how-credit-usage-is-calculated-5820vc/).

### Download snippet

You can download the snipped from the [Xano Marketplace](https://www.xano.com/snippet/jn7mDmAP/) and start using the PDF Generation API functions in your backend. You can read more about Xano snippets from their help page [here](https://docs.xano.com/frequently-asked-questions).

### Configuration

We use Xano [environment variables](https://docs.xano.com/what-xano-includes/workspace/settings/environment-variables) to store API key, API secret and workspace values. You need to copy the PDF Generator API key and secret from the Account Settings view to Xano General Settings. The API key and secret are used to authenticate your request and workspace identifier specifies the request user context

* **pdf\_api\_key** - You can find your PDF Generator API key from the Account Settings view in PDF Generator API.
* **pdf\_api\_secret** - You can find your PDF Generator API secret from the Account Settings view in PDF Generator API.
* **pdf\_api\_workspace** - The Workspace identifier specifies the request user context. Your default workspace identifier is the email you used to sign up to PDF Generator API. You can also set any other string value. If the workspace doesn't exist yet, it is automatically created when an API request is made.

![PDF Generator API key and secret in Account Settings](https://storage.crisp.chat/users/helpdesk/website/11e0e518fc48ce00/image_5pu81i.png)

![Xano General Settings](https://storage.crisp.chat/users/helpdesk/website/11e0e518fc48ce00/xanogeneralsettings_1bz4iya.png)

### Functions

We have created three main functions that allow you to fetch a list of templates, open a  template in the editor and merge your data with a template to generate a document.

### generate\_document

The `generate_document` function is a wrapper for our [Generate Document API endpoint](https://docs.pdfgeneratorapi.com/v3/#operation/mergeTemplate) and you can use the function to merge data from your application with a template created in PDF Generator API. The function accepts the same parameters as available for the API endpoint. 

![Function "generate_document"](https://storage.crisp.chat/users/helpdesk/website/11e0e518fc48ce00/screenshot2022-02-2019-14-41_1u4nkbx.png)

### get\_editor\_url

The `get_editor_url` function is a wrapper for our [Open Editor API endpoint](https://docs.pdfgeneratorapi.com/v3/#operation/getEditorUrl) and you can use the function to generate URL to open the editor view from your application. The function accepts the same parameters as available for the API endpoint. 

![Function "get_editor_url"](https://storage.crisp.chat/users/helpdesk/website/11e0e518fc48ce00/screenshot2022-02-2019-18-59_qzy1le.png)

### get\_templates

The `get_templates` function is a wrapper for our [Get templates API endpoint](https://docs.pdfgeneratorapi.com/v3/#tag/Templates/operation/getTemplates) and you can use the function to fetch a list of templates available for the workspace.

![Function "get_templates"](https://storage.crisp.chat/users/helpdesk/website/11e0e518fc48ce00/screenshot2022-02-2019-51-37_1e7hhga.png)

### API

The example API endpoints are created to show how to use PDF Generator API functions generate\_document, get\_templates and get\_editor\_url in your application endpoints. Besides preparing an endpoint for each function, we added an example endpoint that generates an invoice for an order. 

![Example endpoints](https://storage.crisp.chat/users/helpdesk/website/11e0e518fc48ce00/screenshot2022-02-2020-55-41_8xlqot.png)
---
### Related articles you may find helpful

* [Functions](/en/article/functions-srekaa/)
* [How to use the editor?](/en/article/how-to-use-the-editor-1a194yy/)
* [What is the difference between master and regular user?](/en/article/what-is-the-difference-between-master-and-regular-user-1f3usg0/)
