previewLiquidDocumentTemplate
Requires permission documents:template:update.
Render a template source with neutral sample data and return the HTML. Nothing is saved.
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
query PreviewLiquidDocumentTemplate($docType: String!, $source: String!) {
previewLiquidDocumentTemplate(docType: $docType, source: $source)
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query PreviewLiquidDocumentTemplate($docType: String!, $source: String!) {\n previewLiquidDocumentTemplate(docType: $docType, source: $source)\n}",
"variables": {
"docType": "string",
"source": "string"
}
}
EOF
Variables:
{
"docType": "string",
"source": "string"
}
Response:
{
"data": {
"previewLiquidDocumentTemplate": "string"
}
}
previewLiquidDocumentTemplate(
docType: String!
source: String!
): String!
Arguments
previewLiquidDocumentTemplate.docType ● String! non-null scalar
The document type, e.g. invoice.
previewLiquidDocumentTemplate.source ● String! non-null scalar
The Liquid source to preview.
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.