Fixed/Custom Fields

All fields has a sort_order field. The fields is divided into fixed_fields and custom_fields.
It is up to you to merge and sort by the sort_order field!

Fixed and Custom fields format

You can see which fields is required, their validation type and possible option ids according to the matching resource. You can find the find the different resources on this page, or the left menu.

fixed_fields is always required unless specified "Does not support fixed_fields"

Parameters

  • fixed_fields array
    • Required
    • fixed_fields.*.name string
      • Required if fixed_fields.id is not present
    • fixed_fields.*.id integer
      • Required if fixed_fields.name is not present
    • fixed_fields.*.value string
      • Required
  • custom_fields array
    • custom_fields.*.name string
      • Required if custom_fields.id is not present
    • custom_fields.*.id integer
      • Required if custom_fields.name is not present
    • custom_fields.*.value string
      • Required

Payload

{
  "fixed_fields": [
    {
      "name": "first_name",
      "value": "Jane"
    },
    {
      "name": "last_name",
      "value": "Doe"
    }
  ],
  "custom_fields": [
    {
      "name": "name",
      "value": "value"
    }
  ]
}

Account

GET /fields/account

Get the fields available for accounts

Response
Status code 200

{
  "fixed_fields": [
    {
      "name": "name",
      "label": "Name",
      "type": "text",
      "required": true,
      "hidden": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "address",
      "label": "Address",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "state_region",
      "label": "State/Region",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "country",
      "label": "Country",
      "type": "single_choice",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null,
      "options": [
        {
          "id": 1,
          "value": "AF"
        }
      ]
    },
    {
      "name": "vat",
      "label": "VAT",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "website",
      "label": "Website",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": "url"
    }
  ],
  "custom_fields": [
    {
      "id": 1,
      "name": "email",
      "label": "Custom E-mail",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": "email"
    },
    {
      "id": 2,
      "name": "number",
      "label": "Custom Number",
      "type": "numeric",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": "numeric"
    },
    {
      "id": 3,
      "name": "date",
      "label": "Custom Date",
      "type": "date",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": "date"
    },
    {
      "id": 4,
      "name": "boolean",
      "label": "Custom Boolean",
      "type": "boolean",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": "boolean"
    },
    {
      "id": 5,
      "name": "single_choice",
      "label": "Custom Single Choice",
      "type": "single_choice",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null,
      "options": [
        {
          "id": 244,
          "value": "Option 1"
        },
        {
          "id": 245,
          "value": "Option 2"
        },
        {
          "id": 246,
          "value": "Option 3"
        }
      ]
    },
    {
      "id": 6,
      "name": "multiple_choice",
      "label": "Custom Multiple Choice",
      "type": "multiple_choice",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null,
      "options": [
        {
          "id": 247,
          "value": "Option 1"
        },
        {
          "id": 248,
          "value": "Option 2"
        },
        {
          "id": 249,
          "value": "Option 3"
        },
        {
          "id": 250,
          "value": "Option 4"
        },
        {
          "id": 251,
          "value": "Option 5"
        }
      ]
    }
  ]
}

B2C account

GET /fields/b2c_account

Get the fields available for B2C accounts

Response
Status code 200

{
  "fixed_fields": [
    {
      "name": "name",
      "label": "Name",
      "type": "text",
      "required": true,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    }
  ],
  "custom_fields": []
}

Contact

GET /fields/contact

Get the fields available for contacts

Response
Status code 200

{
  "fixed_fields": [
    {
      "name": "salutation",
      "label": "Salutation",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "first_name",
      "label": "First name",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "last_name",
      "label": "Last name",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "email",
      "label": "Email",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": "email"
    },
    {
      "name": "landline_phone_number",
      "label": "Landline phone number",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "mobile_phone_number",
      "label": "Mobile phone number",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "skype",
      "label": "Skype",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "title",
      "label": "Title",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    }
  ],
  "custom_fields": [
    {
      "id": 7,
      "name": "email",
      "label": "Custom E-mail",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": "email"
    },
    {
      "id": 8,
      "name": "number",
      "label": "Custom Number",
      "type": "numeric",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": "numeric"
    },
    {
      "id": 9,
      "name": "date",
      "label": "Custom Date",
      "type": "date",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": "date"
    },
    {
      "id": 10,
      "name": "single_choice",
      "label": "Custom Single Choice",
      "type": "single_choice",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null,
      "options": [
        {
          "id": 252,
          "value": "Option 1"
        },
        {
          "id": 253,
          "value": "Option 2"
        },
        {
          "id": 254,
          "value": "Option 3"
        }
      ]
    },
    {
      "id": 11,
      "name": "multiple_choice",
      "label": "Custom Multiple Choice",
      "type": "multiple_choice",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null,
      "options": [
        {
          "id": 255,
          "value": "Option 1"
        },
        {
          "id": 256,
          "value": "Option 2"
        },
        {
          "id": 257,
          "value": "Option 3"
        },
        {
          "id": 258,
          "value": "Option 4"
        },
        {
          "id": 259,
          "value": "Option 5"
        }
      ]
    }
  ]
}

B2C contact

GET /fields/b2c_contact

Get the fields available for B2C contacts

Response
Status code 200

{
  "fixed_fields": [
    {
      "name": "salutation",
      "label": "Salutation",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "first_name",
      "label": "First name",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "last_name",
      "label": "Last name",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "email",
      "label": "Email",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": "email"
    },
    {
      "name": "landline_phone_number",
      "label": "Landline phone number",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "mobile_phone_number",
      "label": "Mobile phone number",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "skype",
      "label": "Skype",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "title",
      "label": "Title",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "address",
      "label": "Address",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "zip_code",
      "label": "Zip code",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "city",
      "label": "City",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "state_region",
      "label": "State/Region",
      "type": "text",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "country",
      "label": "Country",
      "type": "single_choice",
      "required": false,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null,
      "options": [
        {
          "id": 244,
          "value": "AF"
        },
        {
          "id": 245,
          "value": "AX"
        }
      ]
    }
  ],
  "custom": []
}

Product

GET /fields/product

Get the fields available for products

Response
Status code 200

{
  "fixed_fields": [
    {
      "name": "name",
      "label": "Name",
      "type": "text",
      "required": true,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null
    },
    {
      "name": "list_price",
      "label": "List price",
      "type": "numeric",
      "required": true,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": "numeric"
    },
    {
      "name": "purchase_price",
      "label": "Purchase price",
      "type": "numeric",
      "required": true,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": "numeric"
    },
    {
      "name": "type",
      "label": "Type",
      "type": "single_choice",
      "required": true,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": null,
      "options": [
        {
          "id": 487,
          "value": "Hours"
        },
        {
          "id": 488,
          "value": "Pieces"
        }
      ]
    },
    {
      "name": "tax",
      "label": "Tax",
      "type": "numeric",
      "required": true,
      "hidden": false,
      "read_only": false,
      "sort_order": 0,
      "validation": "numeric"
    }
  ],
  "custom_fields": []
}

Update fixed field

PUT /fields/fixed/:field_id

Can only be used to update the hidden status of fixed fields.

Parameters

  • hidden boolean - Should the field be visible in the frontend.
    • Required

Payload

{
  "hidden": true
}

Response
Status code 200

{
  "id": 2,
  "name": "address",
  "label": "Address",
  "type": "text",
  "required": false,
  "validation": null,
  "hidden": true,
  "read_only": false,
  "sort_order": 0,
  "team_id": null
}

Create custom field

POST /fields/custom

Parameters

  • owner string
    • Must be account, b2c_account, contact, b2c_contact, additional_data or product
    • Required
  • type string
    • Must be text, numeric, date, boolean, single_choice, multi_line or multiple_choice
    • Required
  • label string
    • Max 60 characters
    • Required
  • hidden boolean - Should the field be visible in the frontend.
  • read_only boolean - Should the field be editable in the frontend.
  • validation string
    • Must be email, url, date, numeric or boolean
    • default: null
  • options string
    • Required if the type is single_choice or multiple_choice

Note: If the field has options, the validation can't be set.

Payload

{
  "owner": "account",
  "type": "single_choice",
  "label": "Some custom single choice field",
  "hidden": false,
  "read_only": false,
  "validation ": null,
  "options": [
    {
      "value": "Some option 1"
    },
    {
      "value": "Some option 2"
    }
  ]
}

Response
Status code 201

{
  "id": 14,
  "name": "some_custom_single_choice_field",
  "label": "Some custom single choice field",
  "type": "single_choice",
  "required": false,
  "hidden": false,
  "read_only": false,
  "sort_order": 0,
  "validation": null,
  "options": [
    {
      "id": 263,
      "value": "Some option 1"
    },
    {
      "id": 264,
      "value": "Some option 2"
    }
  ],
  "team_id": null,
  "group_id": null
}

Update custom field

PUT /fields/custom/:field_id

Parameters

  • owner string
    • Must be account, b2c_account, contact, b2c_contact, additional_data or product
    • Required
  • type string
    • Must be text, numeric, date, boolean, single_choice, multi_line or multiple_choice
    • Required
  • label string
    • Max 60 characters
    • Required
  • hidden boolean - Should the field be visible in the frontend.
  • read_only boolean - Should the field be editable in the frontend.
  • validation string
    • Must be email, url, date, numeric or boolean
    • default: null
  • options string
    • Required if the type is single_choice or multiple_choice

Payload

{
  "owner": "account",
  "type": "single_choice",
  "label": "Some updated custom single choice field",
  "hidden": false,
  "read_only": false,
  "validation ": null,
  "options": [
    {
      "id": 263,
      "value": "Some updated option 1"
    },
    {
      "id": 264,
      "value": "Some updated option 2"
    }
  ]
}

Response
Status code 200

{
  "id": 14,
  "name": "some_updated_custom_single_choice_field",
  "label": "Some updated custom single choice field",
  "type": "single_choice",
  "required": false,
  "hidden": false,
  "read_only": false,
  "sort_order": 0,
  "validation": null,
  "options": [
    {
      "id": 263,
      "value": "Some updated option 1"
    },
    {
      "id": 264,
      "value": "Some updated option 2"
    }
  ]
}

Delete a custom field

DELETE /fields/custom/:field_id

Response
Status code 204

Delete a custom field option

DELETE /fields/custom/:field_id/options/:option_id

Response
Status code 204

Sort order

PUT /fields/sorting

Parameters

  • fields array - Contains your fields.
    • Required
  • fields.*.id integer
    • Required
  • fields.*.field_type string
    • Must be fixed or custom
    • Required
  • fields.*.sort_order integer
    • Must be greater than 0
    • Required

Payload

{
  "fields": [
    {
      "field_type": "custom",
      "id": 1,
      "sort_order": 1
    },
    {
      "field_type": "custom",
      "id": 2,
      "sort_order": 2
    },
    {
      "field_type": "fixed",
      "id": 1,
      "sort_order": 3
    },
    {
      "field_type": "fixed",
      "id": 2,
      "sort_order": 4
    }
  ]
}

Response
Status code 204

Linking fields

PUT /fields/:field_type/:field_id/link

:field_type is custom or fixed.

Single and multiple choice fields can be linked. If the field has any links, a links object will be visible on the field. A field can have N links.

{
  "field_type": "custom",
  "field_id": 123456,
  "option_id": 654321,
  "options_shown": [123, 456, 789],
  "default_option": 123,
}

When the option 654321, from field id 123456 of type custom is selected, the field should only show the options 123 456 and 789, and the option with id 123 should be preselected.

Parameters

  • links.*.field_type string
    • custom or fixed
    • Required
  • links.*.field_id integer
    • Must be a valid field id, that the user has access to edit.
    • Required
  • links.*.option_id integer
    • Must be a valid option id, that belongs to the field_id.
    • Required
  • links.*.options_shown array
    • Must be valid option ids, that belongs to the field
    • Required
  • links.*.default_option integer
    • Must be a valid option id, that belongs to the field

Payload

{
  "links": [
    {
      "field_type": "custom",
      "field_id": 123456,
      "option_id": 654321,
      "options_shown": [123, 456, 789],
      "default_option": 123,
    }
  ]
}

Response
Status code 200

{
  "id": 891,
  "name": "field_1",
  "label": "Field 1",
  "type": "single_choice",
  "required": false,
  "validation": null,
  "options": [
    {
      "id": 2900,
      "value": "Choice 1"
    },
    {
      "id": 2901,
      "value": "Choice 2"
    },
    {
      "id": 2902,
      "value": "Choice 3"
    },
    {
      "id": 2903,
      "value": "Choice 4"
    }
  ],
  "hidden": false,
  "read_only": false,
  "sort_order": 0,
  "team_id": null,
  "group_id": null,
  "links": [
    {
      "field_type": "custom",
      "field_id": 892,
      "option_id": 2904,
      "options_shown": [
        2902
      ],
      "default_option": null
    }
  ]
}