How to Set Up a PDF (Document) Header Correctly
This guide explains how to add a PDF to the message header and avoid common mistakes like seeing a sample PDF instead of the real one.
What is a PDF (Document) Header?
A PDF header lets you send a document (invoice, receipt, report, etc.) at the top of a message.
Steps:
When creating a WhatsApp template and choosing the Header as Media type, follow the steps below to successfully pass the correct PDF during the API call:
From the Header drop-down, select Media, then choose Document as the media type.
Set the Type to Dynamic. Only Dynamic headers can accept documents sent via the Mercuri API.

In the Value field, enter a variable name (for example:
document).In the Sample Value field, upload a sample
.pdf,.doc, or.docxfile. This file is used only for preview and template approval and will not be sent to users.Complete and submit the WhatsApp template for approval.
Once the template is approved, update your Mercuri API payload by adding the required details, such as the template ID . Make sure the same variable name used in the template is passed again in the API parameters.
{ "parameters": { "document": "https://your-storage.com/invoice_123.pdf" } }
When sending the message using the Mercuri API, pass the PDF as a publicly accessible URL, not as an auto-download link.
Following the steps above ensures that the correct PDF is picked up from the Mercuri API and displayed properly in the message header.
This allows you to send the intended document smoothly and consistently to your users.
Last updated