recordExport
Requires at least one of the permissions inventory:stock_adjustment:export, inventory:stock_transfer:export, payments:collection:export, payments:invoice:export, payments:payment:export, purchase:grn:export, purchase:payment:export, purchase:purchase_invoice:export, purchase:purchase_order:export or sales:sales_order:export.
Writes the audit entry for a completed export. Call it when the file is actually downloaded, not when the dialog opens. Needs the export permission for that document type. Returns true.
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 RecordExport($input: AuthorizeExportInput!) {
recordExport(input: $input)
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation RecordExport($input: AuthorizeExportInput!) {\n recordExport(input: $input)\n}",
"variables": {
"input": {
"exportKey": "string"
}
}
}
EOF
Variables:
{
"input": {
"exportKey": "string"
}
}
Response:
{
"data": {
"recordExport": true
}
}
recordExport(
input: AuthorizeExportInput!
): Boolean!
Arguments
recordExport.input ● AuthorizeExportInput! non-null input
The export key that identifies the document type, and the label of the record being exported.
Type
Boolean scalar
The Boolean scalar type represents true or false.