ReflowPDF API api.reflowpdf.com/v1

    Templates

    Fill the gallery's templates, or the ones you design in the editor, with JSON.

    # The template's own sample data is the shape it reads: take it, change what is yours (jq), print.
    curl -s https://api.reflowpdf.com/v1/templates/invoice -H "Authorization: Bearer $REFLOWPDF_API_KEY" \
      | jq '{data: (.sample_data | .invoice.number = "INV-1042" | .buyer.name = "Globex Corporation")}' \
      | curl https://api.reflowpdf.com/v1/templates/invoice/pdf \
          -H "Authorization: Bearer $REFLOWPDF_API_KEY" \
          -H "Content-Type: application/json" \
          -d @- -o INV-1042.pdf

    Which templates#

    • The gallery: 53 ready documents (invoices, quotes, contracts, reports, certificates, tickets…) with sample data. Their ids are stable: invoice, purchase-order. See them all.
    • Yours: templates you saved in the editor's library (Save as template). Their ids start with lib_. One made in the editor's Code view (HTML with {{ … }} and its data) is filled with data; one designed on the page prints as designed (fillable: false).
    curl "https://api.reflowpdf.com/v1/templates?q=invoice" -H "Authorization: Bearer $REFLOWPDF_API_KEY"

    The shape of the data#

    GET /v1/templates/{id} gives a template's source, its sample_data and its data_schema, a JSON Schema (2020-12) read from the sample. Validate your data against it, or generate types from it.

    curl https://api.reflowpdf.com/v1/templates/invoice -H "Authorization: Bearer $REFLOWPDF_API_KEY"

    Leave data out and the template prints with its sample data: a quick way to see it. A value your data does not give prints empty and is reported (ReflowPDF-Missing-Variables).

    Paper#

    A template prints on its own paper (a gallery template's size and orientation, your template's page settings in the editor). options.paper is for a template that declares none.