POST api/Products/CreateProductCustomField

Creates new custom field

Request Information

URI Parameters

None.

Body Parameters

CreateProductCustomFieldPost
NameDescriptionTypeAdditional information
CustomFieldTitle

Custom field title, the field is used only if the type is custom

string

None.

CustomFieldType

Custom field type, the field is used only if the type is custom. Product custom field support just DropDown, Textbox, MultiLine, Numeric, Decimal, CheckBox, Date, Url

CustomFieldTypeEnum

None.

Description

Description

string

None.

DoNotShowInTicket

the field will not show in ticket

boolean

None.

HintText

Text that should be shown as a hint for filling the field

string

None.

MaxLength

Fills only if custom field type is ID, maximum length of text

integer

None.

MinLength

Fills only if custom field type is ID, minimum length of text

integer

None.

PleaseSelect

True if the field should have "please select" option

boolean

None.

ProductId

The product id

integer

None.

Index

The default index for new field

integer

None.

Required

True if the field is required

boolean

None.

ShowInSelect

If true, the value of the field will be shown in autocomplete

boolean

None.

Items

Items for dropdown

Collection of ProductsCustomFieldItemPost

None.

Request Formats

application/json, text/json

Sample:
{
  "CustomFieldTitle": "Field",
  "CustomFieldType": 6,
  "Description": null,
  "DoNotShowInTicket": false,
  "HintText": null,
  "MaxLength": null,
  "MinLength": null,
  "PleaseSelect": false,
  "ProductId": 1,
  "Index": 0,
  "Required": false,
  "ShowInSelect": true,
  "Items": null
}

application/xml, text/xml

Sample:
<CreateProductCustomFieldPost xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/RequestorApiDataStructures.Posts">
  <CustomFieldTitle>Field</CustomFieldTitle>
  <CustomFieldType>CheckBox</CustomFieldType>
  <Description i:nil="true" />
  <DoNotShowInTicket>false</DoNotShowInTicket>
  <HintText i:nil="true" />
  <Index>0</Index>
  <Items i:nil="true" />
  <MaxLength i:nil="true" />
  <MinLength i:nil="true" />
  <PleaseSelect>false</PleaseSelect>
  <ProductId>1</ProductId>
  <Required>false</Required>
  <ShowInSelect>true</ShowInSelect>
</CreateProductCustomFieldPost>

Response Information

Resource Description

Id for new product's custom field

integer

Response Formats

application/json, text/json

Sample:
1

application/xml, text/xml

Sample:
<int xmlns="http://schemas.microsoft.com/2003/10/Serialization/">1</int>