generatePaymentPdf
Requires at least one of the permissions payments:payment:read or purchase:payment:read.
Generate a PDF for a payment/collection 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 GeneratePaymentPdf($paymentId: ID!) {
generatePaymentPdf(paymentId: $paymentId)
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation GeneratePaymentPdf($paymentId: ID!) {\n generatePaymentPdf(paymentId: $paymentId)\n}",
"variables": {
"paymentId": "id"
}
}
EOF
Variables:
{
"paymentId": "id"
}
Response:
{
"data": {
"generatePaymentPdf": "string"
}
}
generatePaymentPdf(
paymentId: ID!
template: String
): String!
Arguments
generatePaymentPdf.paymentId ● ID! non-null scalar
The ID of the payment.
generatePaymentPdf.template ● String scalar
The name of the PDF template to use. Omit for the 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.