Skip to main content
POST
/
product_fields
Add a new product field
curl --request POST \
  --url https://api.rechain.co/public/v1/product_fields \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Sample Name",
  "company_id": "123e4567-e89b-12d3-a456-426614174000",
  "position": 1,
  "product_field_group_id": "123e4567-e89b-12d3-a456-426614174000",
  "field_type": 3,
  "multiple_selection": true,
  "listbox_options": [
    "Option 1",
    "Option 2",
    "Option 3"
  ],
  "createdAt": "2021-01-01T00:00:00Z",
  "updatedAt": "2021-01-01T00:00:00Z"
}
'
{
  "name": "Sample Name",
  "company_id": "123e4567-e89b-12d3-a456-426614174000",
  "position": 1,
  "product_field_group_id": "123e4567-e89b-12d3-a456-426614174000",
  "field_type": 3,
  "multiple_selection": true,
  "listbox_options": [
    "Option 1",
    "Option 2",
    "Option 3"
  ],
  "createdAt": "2021-01-01T00:00:00Z",
  "updatedAt": "2021-01-01T00:00:00Z",
  "id": "123e4567-e89b-12d3-a456-426614174000"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Create a new product field

name
string
required
Example:

"Sample Name"

company_id
string
required
Example:

"123e4567-e89b-12d3-a456-426614174000"

position
integer
Example:

1

product_field_group_id
string
Example:

"123e4567-e89b-12d3-a456-426614174000"

field_type
enum<integer>

Field type, can be any of { short_text: 0, long_text: 1, checkbox: 2, listbox: 3, date: 4 }

Available options:
0,
1,
2,
3,
4
Example:

3

multiple_selection
boolean
Example:

true

listbox_options
string[]
Example:
["Option 1", "Option 2", "Option 3"]
createdAt
string<date-time>
Example:

"2021-01-01T00:00:00Z"

updatedAt
string<date-time>
Example:

"2021-01-01T00:00:00Z"

Response

Successful operation

id
string
Example:

"123e4567-e89b-12d3-a456-426614174000"