customFieldsSet
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.
Write custom-field values on up to 25 records the app can read, all or none: its own fields (under _apps.<appId>) and the organization's fields opened to apps for writing. Needs write_custom_fields.
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 CustomFieldsSet($input: CustomFieldsSetInput!) {
customFieldsSet(input: $input) {
owners {
id
customFields
entity
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CustomFieldsSet($input: CustomFieldsSetInput!) {\n customFieldsSet(input: $input) {\n owners {\n id\n customFields\n entity\n }\n }\n}",
"variables": {
"input": {
"owners": [
{
"customFields": {},
"entity": "string",
"id": "id"
}
]
}
}
}
EOF
Variables:
{
"input": {
"owners": [
{
"customFields": {},
"entity": "string",
"id": "id"
}
]
}
}
Response:
{
"data": {
"customFieldsSet": {
"owners": [
{
"id": "id",
"customFields": {},
"entity": "string"
}
]
}
}
}
customFieldsSet(
input: CustomFieldsSetInput!
): CustomFieldsSetResult!
Arguments
customFieldsSet.input ● CustomFieldsSetInput! non-null input
The records and their values.
Type
CustomFieldsSetResult object
What a customFieldsSet call wrote.