appSaveCustomField
Requires at least one of the permissions customers:customer:read, payments:collection:read, products:product:read, purchase:debit_note:read, purchase:grn:read, purchase:payment:read, purchase:purchase_invoice:read, purchase:purchase_order:read, sales:credit_note:read, sales:quote:read, sales:sales_invoice:read, sales:sales_order:read, sales:shipment:read or suppliers:supplier:read.
Add a custom field to the calling app's own namespace, or change one of its fields. At most 20 per kind of record, apart from the organization's own fields. Needs write_custom_fields and read access to that kind of record.
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 AppSaveCustomField($input: AppSaveCustomFieldInput!) {
appSaveCustomField(input: $input) {
id
type
appAccess
archived
carryForward
defaultValue
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation AppSaveCustomField($input: AppSaveCustomFieldInput!) {\n appSaveCustomField(input: $input) {\n id\n type\n appAccess\n archived\n carryForward\n defaultValue\n }\n}",
"variables": {
"input": {
"entity": "string",
"key": "string",
"labels": {},
"placements": [
"string"
],
"required": true,
"type": "string",
"visibility": "string"
}
}
}
EOF
Variables:
{
"input": {
"entity": "string",
"key": "string",
"labels": {},
"placements": [
"string"
],
"required": true,
"type": "string",
"visibility": "string"
}
}
Response:
{
"data": {
"appSaveCustomField": {
"id": "id",
"type": "string",
"appAccess": "string",
"archived": true,
"carryForward": true,
"defaultValue": {}
}
}
}
appSaveCustomField(
input: AppSaveCustomFieldInput!
): CustomFieldDefinition!
Arguments
appSaveCustomField.input ● AppSaveCustomFieldInput! non-null input
The field's settings.
Type
CustomFieldDefinition object
A field the organization added to one kind of record.