generateInvoicePdf
Requires at least one of the permissions payments:invoice:read or purchase:purchase_invoice:read.
Generate a PDF for an invoice and return base64 encoded data
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation GenerateInvoicePdf($invoiceId: ID!) {
generateInvoicePdf(invoiceId: $invoiceId)
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation GenerateInvoicePdf($invoiceId: ID!) {\n generateInvoicePdf(invoiceId: $invoiceId)\n}",
"variables": {
"invoiceId": "id"
}
}
EOF
Variables:
{
"invoiceId": "id"
}
Response:
{
"data": {
"generateInvoicePdf": "string"
}
}
generateInvoicePdf(
invoiceId: ID!
template: String
): String!
Arguments
generateInvoicePdf.invoiceId ● ID! non-null scalar
The ID of the invoice.
generateInvoicePdf.template ● String scalar
The PDF template: professional, modern or classic. Omit to use the organization's default.
Type
String scalar
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.