Skip to main content

Quickstart: generate your first PDF

The goal of this quickstart is one successful PDF. Use the included DOCX template, send matching JSON, and save the response as generated.pdf.

1. Create an accountโ€‹

Create a Pritset account, or sign in. New accounts include $15 credit, enough for 5,000 successful PDF generations. No card is required.

2. Obtain credentialsโ€‹

In the portal, open Profile โ†’ Security and copy your Access token and User secret. Keep both private. Pritset sends the access token directly in Authorization and the secret in X-Secret; do not add a Bearer prefix.

3. Upload a DOCX templateโ€‹

Download the sample template. In the portal, open Templates, select +, upload the file, and copy its Id. Use that value as YOUR_TEMPLATE_ID.

The template expects title, description, and an advantages array. See template syntax when you are ready to add more variables.

4. Send data and generate the PDFโ€‹

Replace every YOUR_... value below. The request saves the finished file as generated.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 layouts in Word."}]}' \
--output generated.pdf \
--write-out "\nHTTP %{http_code} %{content_type}\n"

5. What success looks likeโ€‹

  • The request returns HTTP 200.
  • The response content type is application/pdf.
  • The generated document contains the supplied title, description, and advantages.

The cURL command and every SDK example save the response as generated.pdf. Open that file with a PDF viewer to check the result.

Next stepsโ€‹

If the first request failsโ€‹

  • 401: copy the access token and secret again from the portal; do not add Bearer.
  • 404: copy the template ID from the Templates table.
  • 400: make the JSON match the fields in your DOCX template.

For status codes, validation behavior, and retry guidance, see API errors. Advanced template management and webhook details remain in the linked API reference.