Skip to main content
POST
/
custom_fields
Create custom fields
curl --request POST \
  --url https://api.partoo.co/v2/custom_fields \
  --header 'Content-Type: application/json' \
  --header 'x-APIKey: <api-key>' \
  --data '
{
  "name": "Click and collect",
  "type": "BOOLEAN",
  "description": "Whether the business offers click and collect service",
  "slug": "click-and-collect",
  "order": 30,
  "force": false,
  "section_id": 6
}
'
{
  "custom_field_id": 42
}

Authorizations

x-APIKey
string
header
required

The authentication system on Partoo API is using API Key that should be put in the header of the request (the name of the header is x-APIKey). An api_key is linked to a user. This user's role will give you different access level to the API features.

Body

application/json

Boolean Custom Field

name
string
required

The name of the custom field

Required string length: 1 - 50
Example:

"Click and collect"

type
string
required

BOOLEAN

Minimum string length: 1
Example:

"BOOLEAN"

description
string | null

Description of the custom field

Maximum string length: 150
Example:

"Whether the business offers click and collect service"

slug
string | null

Unique identifier slug for the custom field. Cannot contain any of the following characters: ,;/\|<>

Required string length: 1 - 100
Example:

"click-and-collect"

order
integer
default:10

Describes where the custom field is displayed on the Business Edit view of the Partoo App. If the custom field is within a section, order specifies its position within the custom field section.

Example:

30

force
boolean
default:false

The deletion of a custom field or the update of its metadata can have impacts on custom fields which are already set for businesses.

  • If force is set to false, updates/deletions will be performed only if they are non-destructive.
    If some businesses would be impacted by the update/deletion, an exception will be returned.

  • If force is set to true, destructive modification will be performed and businesses' values will be deleted accordingly.

section_id
integer

Id of the custom field section

Example:

6

Response

OK

custom_field_id
integer

Id of the custom field

Example:

42