prepare_mandate_pdf
Generate a deterministic PDF of a mandate for the principal to sign with their own signature tool. It embeds the exact mandate JSON and SHA-256 hash on every page.
Instructions
Return the mandate as a PDF for the principal to sign with its own signature tool.
Takes the same arguments as create_mandate (and prepare_mandate_signature). Nothing is written. The PDF shows the mandate and carries, as the attached file amr-mandate.json, the exact bytes prepare_mandate_signature returns for the same arguments and signed_at; the SHA-256 of these bytes is printed on every page. The same arguments and signed_at always give the same PDF.
The registry does not sign this PDF and does not check a signature made on it in this version: the principal signs it with its own tool (for example a PAdES signature), and keeps the signed file. An agent cannot sign in the principal's place. create_mandate accepts signed_at only within AMR_PRINCIPAL_SIGNATURE_MAX_AGE_SECONDS (default 900 s) of its clock: generate, sign and register within that window, or generate a new PDF. The PDF matches a registered mandate only if that mandate was created with the same arguments, the same signed_at and a principal signature.
Args: signed_at: ISO 8601 timestamp with timezone to place in the content. Default: now (UTC). Pass the same value to create_mandate. (all other arguments: see create_mandate)
Returns: JSON string with keys: pdf_base64 (standard base64 of the PDF), filename, pdf_sha256, attachment_name ("amr-mandate.json"), payload_sha256 (the value printed in the PDF), payload, payload_b64url, signed_at. On error: the same error as prepare_mandate_signature, or {"error": "...", "code": "mandate_pdf_too_large"} (content over 256 KiB or more than 200 pages).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | Yes | ||
| agent_id | Yes | ||
| currency | No | EUR | |
| metadata | No | ||
| signed_at | No | ||
| max_amount | No | ||
| period_days | No | ||
| principal_id | Yes | ||
| risk_classes | No | ||
| amount_actions | No | ||
| duration_hours | Yes | ||
| allowed_actions | No | ||
| forbidden_actions | No | ||
| parent_mandate_id | No | ||
| period_max_amount | No | ||
| delegation_allowed | No | ||
| legal_basis_article | Yes | ||
| max_delegation_depth | No | ||
| legal_basis_regulation | Yes | ||
| legal_basis_jurisdiction | No | EU |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |