CreateCustomField
Creates a new custom field definition.
Parameters:
| Parameter | Type | Description |
|---|---|---|
input | CustomFieldInput! | Custom field data. |
mutation CreateCustomField($input: CustomFieldInput!) {
CreateCustomField(input: $input) {
id
label
identifier
input_type
model_type
metadata
weight
}
}UpdateCustomField
Updates an existing custom field.
Parameters:
| Parameter | Type | Description |
|---|---|---|
id | ID! | Custom field ID. |
input | CustomFieldInput! | Updated fields. |
DeleteCustomField
Deletes a custom field.
Parameters:
| Parameter | Type | Description |
|---|---|---|
id | ID! | Custom field ID. |
UpdateCustomFieldWeights
Updates the sort order of multiple custom fields.
Parameters:
| Parameter | Type | Description |
|---|---|---|
input | [CustomFieldWeightInput!]! | Weight updates. |
CustomFieldInput
| Field | Type | Required | Description |
|---|---|---|---|
label | String | Yes | Display label. |
identifier | String | No | Machine-readable identifier. |
input_type | CustomFieldInputType | Yes | Widget/value type. |
model_type | CustomFieldModelType | Yes | Target entity type. |
metadata | JSON | No | Extra config (e.g., select options). |
weight | Int | No | Sort order. |
CustomFieldWeightInput
Setting Custom Field Values on Entities
When creating or updating an entity, you can pass custom field values using the custom_fields input:
mutation CreateProduct($input: ProductInput!) {
CreateProduct(input: $input) {
id
label
custom_fields {
custom_field {
identifier
label
}
values {
text_value
number_value
}
}
}
}Custom Field Input on Entities
| Entity | Input Field |
|---|---|
| Customer | CustomerInput.custom_fields |
| Supplier | SupplierInput.custom_fields |
| Employee | EmployeeInput.custom_fields |
| Product | ProductInput.custom_fields |
| Variant | VariantInput.custom_fields |
| Order | OrderInput.custom_fields |
| Estimate | EstimateInput.custom_fields |
| Invoice | InvoiceInput.custom_fields |
| ShippingOrder | ShippingOrderInput.custom_fields |
| Purchase | PurchaseInput.custom_fields |
| PurchaseReceipt | PurchaseReceiptInput.custom_fields |
| ProductReturn | ProductReturnInput.custom_fields |
| Refund | RefundInput.custom_fields |
| CreditNote | CreditNoteInput.custom_fields |
| StockAdjustment | StockAdjustmentInput.custom_fields |
| Payment | PaymentInput.custom_fields |
| Subscription | SubscriptionInput.custom_fields |
EntityCustomFieldInput
| Field | Type | Required | Description |
|---|---|---|---|
custom_field_identifier | String | Yes | Identifier of the target custom field. |
values | [EntityCustomFieldValueInput!]! | Yes | Array of values. |
EntityCustomFieldValueInput
| Field | Type | Description |
|---|---|---|
value | Mixed | The value to set. |
CustomFieldValueInput
CustomFieldValueInput