A complete, working example: invoice data as a dict, a template, one API call, a PDF on disk. Then the same thing for a …