Custom Fields
Methods
- order_custom_field.info
- order_custom_field.list
- order_custom_field.create
- order_custom_field.update
- order_custom_field.delete
Entity Properties
order_custom_field.info
order_custom_field.info (int $customFieldId)
Retrieve full order custom field information.
Parameters
- 0 int
- Order Custom Field ID
Return Value
An object with Order Custom Field.
Example Request
{
"jsonrpc" : 2.0,
"id" : 1234,
"method" : "call",
"params" : [
"27a5c429525a85c9e02c91537874808e",
"order_custom_field.info",
[
23
]
]
}
Example Response
{
"result": {
"custom_field_id": "23",
"name": "Colors",
"code": "colors",
"is_active": "1",
"input_type": "multiselect",
"is_required": "0",
"client_note": null,
"client_permissions": "unrestricted",
"is_display_client_grid": "0",
"is_display_client_form": "0",
"sort_order": "0",
"created_at": "2022-12-14T17:07:31+00:00",
"updated_at": "2022-12-14T17:07:31+00:00",
"options": [
{
"option_id": 12,
"label": "Red",
"is_default": false,
"sort_order": 5
}
]
},
"id": "1234",
"jsonrpc": "2.0"
}
Error Codes
code | message |
---|---|
101 | Requested order custom field does not exist. |
order_custom_field.list
order_custom_field.list ()
Retrieve list of order custom fields.
Return Value
An array of objects. Each object will contain Order Custom Field properties.
Example Request
{
"jsonrpc" : 2.0,
"id" : 1234,
"method" : "call",
"params" : [
"34aa989befe360d67fe3f70b3517a1e5",
"order_custom_field.list"
]
}
Example Response
{
"result": [
{
"custom_field_id": "3",
"name": "Original Purchase Date",
"code": "purchase_date",
"is_active": "1",
"input_type": "date",
"is_required": "0",
"client_note": null,
"client_permissions": "restricted",
"is_display_client_grid": "1",
"is_display_client_form": "0",
"sort_order": "0",
"created_at": "2022-07-01T10:46:16+00:00",
"updated_at": "2022-07-01T10:46:16+00:00"
},
{
"custom_field_id": "4",
"name": "Main Item SKU",
"code": "main_sku",
"is_active": "1",
"input_type": "text",
"is_required": "0",
"client_note": null,
"client_permissions": "unrestricted",
"is_display_client_grid": "0",
"is_display_client_form": "1",
"sort_order": "99",
"created_at": "2022-07-01T11:43:28+00:00",
"updated_at": "2022-07-01T11:43:28+00:00"
}
],
"id": "1234",
"jsonrpc": "2.0"
}
order_custom_field.create
order_custom_field.create (object $data)
Create a new order custom field.
Parameters
- 0 object
- Order Custom Field data (see “Order Custom Field”)
Return Value
An object with the new Order Custom Field”).
Example Request
{
"jsonrpc" : 2.0,
"id" : 1234,
"method" : "call",
"params" : [
"27a5c429525a85c9e02c91537874808e",
"order_custom_field.create",
[
{
"name": "Colors",
"code": "colors",
"is_active": 1,
"input_type" : "multiselect",
"client_permissions" : "unrestricted",
"is_display_client_grid": 1,
"is_display_client_form": 1,
"options" :
[
{
"label" : "Red",
"is_default": 0,
"sort_order": 5
}
]
}
]
]
}
Example Response
{
"result": {
"custom_field_id": "30",
"name": "Colors",
"code": "colors",
"is_active": "1",
"input_type": "multiselect",
"is_required": "0",
"client_note": null,
"client_permissions": "unrestricted",
"is_display_client_grid": "1",
"is_display_client_form": "1",
"sort_order": "0",
"created_at": "2022-12-15T16:57:15+00:00",
"updated_at": "2022-12-15T16:57:15+00:00",
"options": [
{
"option_id": 18,
"label": "Red",
"is_default": false,
"sort_order": 5
}
]
},
"id": "1234",
"jsonrpc": "2.0"
}
Error Codes
code | message |
---|---|
100 | Invalid data given. Details in error message. |
order_custom_field.update
order_custom_field.update (string $customFieldId, object $data)
Modify the order custom field.
Parameters
- 0 int
- Custom Field ID
- 1 object|null
- Order Custom Field data (see “Order Custom Field”)
Return Value
true if order custom field was successfully updated.
Example Request
{
"jsonrpc" : 2.0,
"id" : 1234,
"method" : "call",
"params" : [
"27a5c429525a85c9e02c91537874808e",
"order_custom_field.update",
[
23,
{
"name": "Colors"
}
]
]
}
Example Response
{
"result": true,
"id": "1234",
"jsonrpc": "2.0"
}
Error Codes
code | message |
---|---|
100 | Invalid data given. Details in error message. |
101 | Requested order custom field does not exist. |
order_custom_field.delete
order_custom_field.delete (int $customFieldId)
Delete order custom field.
Parameters
- 0 int
- Custom Field ID
Return Value
true if the order custom field was deleted.
Example Request
{
"jsonrpc" : 2.0,
"id" : 1234,
"method" : "call",
"params" : [
"27a5c429525a85c9e02c91537874808e",
"order_custom_field.delete",
[
25
]
]
}
Example Response
{
"result": true,
"id": "1234",
"jsonrpc": "2.0"
}
Error Codes
code | message |
---|---|
100 | Invalid data given. Details in error message. |
Entity Properties
Order Custom Field Properties
custom_field_id |
An automatically generated unique identifier for an Order Custom Field.
|
---|---|
name |
The "name" property.
|
code |
The "code" property.
|
is_active |
Flag whether Order Custom Field is active.
|
input_type |
The "input_type" property. Allowed values: "text", "multiline-text", "number", "currency", "select", "multiselect", "boolean", "date", "client-user", "email", "url".
|
is_required |
Flag whether Order Custom Field is required.
|
client_note |
The "client_note" property.
|
client_permissions |
The "unrestricted" property. Allowed values: "unrestricted", "restricted", "read-only", "hidden".
|
is_display_client_grid |
Flag whether Order Custom Field is displayed in the client grid.
|
is_display_client_form |
Flag whether Order Custom Field is displayed in the client form.
|
sort_order |
The "sort_order" property.
|
created_at |
The "Created At" property.
|
updated_at |
The "Updated At" property.
|
options | Array of options. See "Option Properties". |
Order Custom Field Option Properties
option_id |
The internal option ID.
|
---|---|
label |
The "Label" property.
|
is_default |
Flag whether option is default.
|
sort_order |
The "Sort Order" property.
|