authorizeExport
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.
Checks that you may export the given document type and says whether the organization requires the export to be encrypted. It writes nothing, so it is safe to call when an export dialog opens. Needs the export permission for that document type.
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 AuthorizeExport($input: AuthorizeExportInput!) {
authorizeExport(input: $input) {
allowed
requireEncryption
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation AuthorizeExport($input: AuthorizeExportInput!) {\n authorizeExport(input: $input) {\n allowed\n requireEncryption\n }\n}",
"variables": {
"input": {
"exportKey": "string"
}
}
}
EOF
Variables:
{
"input": {
"exportKey": "string"
}
}
Response:
{
"data": {
"authorizeExport": {
"allowed": true,
"requireEncryption": true
}
}
}
authorizeExport(
input: AuthorizeExportInput!
): AuthorizeExportResult!
Arguments
authorizeExport.input ● AuthorizeExportInput! non-null input
The export key that identifies the document type, and the label of the record being exported.
Type
AuthorizeExportResult object
Whether an export may go ahead.