See the Queries page for a presentation of this resource.
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. |
CustomFieldInputType
CustomFieldInputType| Value | Description |
|---|---|
text | Text input. |
textarea | Textarea input. |
number | Number input. |
boolean | Boolean checkbox. |
date | Date picker. |
datetime | DateTime picker. |
select | Select dropdown. |
multiselect | Multi-select. |
CustomFieldModelType
CustomFieldModelType| Value | Description |
|---|---|
Customer | Customer entity. |
Supplier | Supplier entity. |
Employee | Employee entity. |
Product | Product entity. |
Variant | Variant entity. |
Order | Sales order entity. |
Estimate | Estimate entity. |
Invoice | Invoice entity. |
ShippingOrder | Shipping order entity. |
Purchase | Purchase entity. |
PurchaseReceipt | Purchase receipt entity. |
ProductReturn | Product return entity. |
Refund | Refund entity. |
CreditNote | Credit note entity. |
StockAdjustment | Stock adjustment entity. |
Payment | Payment entity. |
Subscription | Subscription entity. |
CustomFieldValueInput
CustomFieldValueInput