Skip to main content

Quickstart: generate your first PDF

This quickstart takes you from a new Pritset account to a generated PDF using the included sample DOCX template. You will upload the template in the portal, then send one direct API request.

For the underlying rules, keep Templating syntax and Template processing nearby as you work through the steps.

1. Create an account or sign inโ€‹

Create a Pritset account, or sign in to the portal if you already have one.

After authentication, Pritset opens the portal at https://app.pritset.com.

2. Download the sample DOCXโ€‹

Download the Pritset test template and save it as pritset-test-template.docx.

The template expects this data:

  • title
  • description
  • An advantages array whose items contain title and description

You can learn how those fields are inserted in Template syntax.

3. Upload the template and copy its IDโ€‹

In the portal:

  1. Open Templates from the left sidebar.
  2. Select the blue + button.
  3. Enter Pritset quickstart as the name.
  4. Select pritset-test-template.docx and choose Save.
  5. Find the new row in the Templates table and copy the value in its Id column.

Keep this value for YOUR_TEMPLATE_ID. See Managing templates for the portal workflow or Template management for the complete API.

4. Find your access token and secretโ€‹

Open Profile in the portal. In the Security section, copy your Access token and User secret. The profile guide shows where these values appear.

Use them as YOUR_ACCESS_TOKEN and YOUR_SECRET. Keep both values private. The authentication reference explains the required headers.

5. Send the direct-processing requestโ€‹

Replace the three YOUR_... placeholders, then run this command in a Bash-compatible terminal from the directory where you want to save the PDF:

curl --request POST \
"https://api.pritset.com/api/template/process/direct/YOUR_TEMPLATE_ID" \
--header "Authorization: YOUR_ACCESS_TOKEN" \
--header "X-Secret: YOUR_SECRET" \
--form 'data={"title":"Hello Pritset","description":"Your first PDF generated from a DOCX template.","advantages":[{"title":"Editable templates","description":"Keep document layouts in Word."},{"title":"Simple API","description":"Send JSON and receive a PDF."}]}' \
--output generated.pdf \
--write-out "\nHTTP %{http_code} %{content_type}\n"

The request uses multipart/form-data with one form field named data. Its value is valid JSON matching the sample template. Do not add a Bearer prefix to the access token.

6. Locate the saved PDFโ€‹

The direct-processing endpoint returns the generated PDF as the response body. The command saves that body as generated.pdf in your current directory.

7. Confirm the successful resultโ€‹

A successful request prints:

HTTP 200 application/pdf

Open generated.pdf. It should contain:

  • The title Hello Pritset
  • The description Your first PDF generated from a DOCX template.
  • An Our advantages section with Editable templates and Simple API

You have now completed one direct document generation. See Template processing for the full direct and webhook workflows.

8. Handle common failuresโ€‹

If the status is not 200, generated.pdf contains the error response rather than a readable PDF. Check the status and response body before trying again.

Missing or invalid credentialsโ€‹

  • Typical status: 401 Unauthorized
  • Confirm that both Authorization: YOUR_ACCESS_TOKEN and X-Secret: YOUR_SECRET were replaced.
  • Copy the token and secret again from the same portal profile. Do not include quotes, spaces, or a Bearer prefix in their values.

Incorrect template IDโ€‹

  • Typical status: 404 Not Found
  • Copy the ID from the row for Pritset quickstart in the Templates table.
  • Replace only YOUR_TEMPLATE_ID in the request URL.

Invalid JSON or placeholder mismatchโ€‹

  • Typical status: 400 Bad Request
  • Confirm that the data field contains valid JSON.
  • For this sample, include title, description, and an advantages array. Every array item must contain title and description.
  • If you use a different DOCX template, update the JSON to match that template's placeholders.

See API errors for response formats, status codes, and retry guidance.

What Pritset doesโ€‹

Pritset generates PDFs from editable DOCX templates through an API. Your application sends JSON, and Pritset replaces the template placeholders and returns a finished PDF. This workflow supports invoices, reports, receipts, healthcare documents, contracts, resumes, certificates, itineraries, and other application-generated documents.

Developers control the integration while non-developers can continue editing document layouts in Microsoft Word, LibreOffice, or another DOCX-compatible editor.

What you can do with Pritsetโ€‹

  • Manage reusable DOCX templates through the portal or API
  • Generate PDFs with direct or webhook processing
  • Insert JSON values, repeat content, add links, and generate images or charts
  • Track usage and available balance

Pritset portal dashboard

Pricingโ€‹

New accounts start with $15 in promotional credit. A successful document generation costs $0.003, so the starting credit covers 5,000 generated PDFs. Invalid requests and failed generation attempts are not charged. When the balance reaches zero, generation pauses until you make a manual, one-time top-up from $1.

See pricing for the complete billing model.

More examplesโ€‹

The Pritset examples repository contains additional DOCX templates, matching JSON payloads, and generated PDFs.

Open GitHub examples

Referenceโ€‹