> ## Documentation Index
> Fetch the complete documentation index at: https://developers.partoo.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create custom fields

> This endpoint enables you to create custom fields for your organization. You can specify the field name, description, slug, type-specific constraints, order, and optionally assign it to a section. `PROVIDER` users can pass `org_id` to create custom fields for a managed organization.




## OpenAPI

````yaml /assets/openapi/openapi-bundled.yaml post /custom_fields
openapi: 3.1.0
info:
  title: Partoo Rest API
  version: v2
  license:
    name: © Copyright Partoo
    url: https://www.partoo.co/en/gtu-api/
  x-logo:
    url: >-
      https://partoo-client-images.s3.amazonaws.com/logo-partoo-restapi-white.png
  description: >
    ## Introduction

    The Partoo Rest API allows you to automate all the actions that are possible
    to do in the Partoo Web Application.


    The Partoo Rest API can be used for many different purposes:
      - Create/update/delete your businesses & users if you are a client.
      - Create/subscribe/manage organizations, businesses & users if you are a reseller.
      - Retrieve data on businesses you have access to if you are a publisher.
      - ...
servers:
  - url: https://api.partoo.co/v2
    description: Production server
  - url: https://api.sandbox.partoo.co/v2
    description: Sandbox server (dev environment for clients & partners)
security:
  - ApiKeyAuth: []
paths:
  /custom_fields:
    post:
      tags:
        - Custom Fields
      summary: Create custom fields
      description: >
        This endpoint enables you to create custom fields for your organization.
        You can specify the field name, description, slug, type-specific
        constraints, order, and optionally assign it to a section. `PROVIDER`
        users can pass `org_id` to create custom fields for a managed
        organization.
      operationId: postCreateCustomFields
      parameters:
        - $ref: '#/components/parameters/query_org_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/CustomFieldBool'
                  title: Boolean Field
                - $ref: '#/components/schemas/CustomFieldText'
                  title: Text Field
                - $ref: '#/components/schemas/CustomFieldInteger'
                  title: Integer Field
                - $ref: '#/components/schemas/CustomFieldFloat'
                  title: Float Field
                - $ref: '#/components/schemas/CustomFieldSingleSelect'
                  title: Single Select Field
                - $ref: '#/components/schemas/CustomFieldMultipleSelect'
                  title: Multiple Select Field
                - $ref: '#/components/schemas/CustomFieldMultipleSelectImage'
                  title: Multiple Select Image Field
                - $ref: '#/components/schemas/CustomFieldImagesUploader'
                  title: Images Uploader Field
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  custom_field_id:
                    $ref: '#/components/schemas/CustomFieldId'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
components:
  parameters:
    query_org_id:
      in: query
      name: org_id
      schema:
        type: integer
      required: false
      description: >
        Organization ID. Only `PROVIDER` users can specify a different
        organization. If not provided, defaults to your own organization.
  schemas:
    CustomFieldBool:
      description: Boolean Custom Field
      type: object
      required:
        - name
        - type
      properties:
        name:
          $ref: '#/components/schemas/CustomFieldName'
        description:
          $ref: '#/components/schemas/CustomFieldDescription'
        type:
          $ref: '#/components/schemas/CustomFieldTypeBool'
        slug:
          $ref: '#/components/schemas/CustomFieldSlug'
        order:
          $ref: '#/components/schemas/CustomFieldOrder'
        force:
          $ref: '#/components/schemas/CustomFieldForceUpdate'
        section_id:
          $ref: '#/components/schemas/CustomFieldSectionId'
    CustomFieldText:
      description: Text Custom Field
      type: object
      required:
        - name
        - type
      properties:
        name:
          $ref: '#/components/schemas/CustomFieldName'
        description:
          $ref: '#/components/schemas/CustomFieldDescription'
        type:
          $ref: '#/components/schemas/CustomFieldTypeText'
        slug:
          $ref: '#/components/schemas/CustomFieldSlug'
        max_len:
          $ref: '#/components/schemas/CustomFieldMaxLen'
        order:
          $ref: '#/components/schemas/CustomFieldOrder'
        force:
          $ref: '#/components/schemas/CustomFieldForceUpdate'
        section_id:
          $ref: '#/components/schemas/CustomFieldSectionId'
    CustomFieldInteger:
      description: Integer Custom Field
      type: object
      required:
        - name
        - type
      properties:
        name:
          $ref: '#/components/schemas/CustomFieldName'
        description:
          $ref: '#/components/schemas/CustomFieldDescription'
        type:
          $ref: '#/components/schemas/CustomFieldTypeInteger'
        slug:
          $ref: '#/components/schemas/CustomFieldSlug'
        min:
          $ref: '#/components/schemas/CustomFieldMin'
        max:
          $ref: '#/components/schemas/CustomFieldMax'
        order:
          $ref: '#/components/schemas/CustomFieldOrder'
        force:
          $ref: '#/components/schemas/CustomFieldForceUpdate'
        section_id:
          $ref: '#/components/schemas/CustomFieldSectionId'
    CustomFieldFloat:
      description: Float Custom Field
      type: object
      required:
        - name
        - type
      properties:
        name:
          $ref: '#/components/schemas/CustomFieldName'
        description:
          $ref: '#/components/schemas/CustomFieldDescription'
        type:
          $ref: '#/components/schemas/CustomFieldTypeFloat'
        slug:
          $ref: '#/components/schemas/CustomFieldSlug'
        min:
          $ref: '#/components/schemas/CustomFieldFloatMin'
        max:
          $ref: '#/components/schemas/CustomFieldFloatMax'
        order:
          $ref: '#/components/schemas/CustomFieldOrder'
        force:
          $ref: '#/components/schemas/CustomFieldForceUpdate'
        section_id:
          $ref: '#/components/schemas/CustomFieldSectionId'
    CustomFieldSingleSelect:
      description: Single Select Custom Field
      type: object
      required:
        - name
        - type
        - possible_values
      properties:
        name:
          $ref: '#/components/schemas/CustomFieldName'
        description:
          $ref: '#/components/schemas/CustomFieldDescription'
        type:
          $ref: '#/components/schemas/CustomFieldTypeSingleSelect'
        slug:
          $ref: '#/components/schemas/CustomFieldSlug'
        possible_values:
          $ref: '#/components/schemas/CustomFieldPossibleValues'
        possible_orders:
          $ref: '#/components/schemas/CustomFieldPossibleOrders'
        order:
          $ref: '#/components/schemas/CustomFieldOrder'
        force:
          $ref: '#/components/schemas/CustomFieldForceUpdate'
        section_id:
          $ref: '#/components/schemas/CustomFieldSectionId'
    CustomFieldMultipleSelect:
      description: Multiple Select Custom Field
      type: object
      required:
        - name
        - type
        - possible_values
      properties:
        name:
          $ref: '#/components/schemas/CustomFieldName'
        description:
          $ref: '#/components/schemas/CustomFieldDescription'
        type:
          $ref: '#/components/schemas/CustomFieldTypeMultipleSelect'
        slug:
          $ref: '#/components/schemas/CustomFieldSlug'
        possible_values:
          $ref: '#/components/schemas/CustomFieldPossibleValues'
        possible_orders:
          $ref: '#/components/schemas/CustomFieldPossibleOrders'
        max_selected_values:
          $ref: '#/components/schemas/CustomFieldMaxSelectedValues'
        order:
          $ref: '#/components/schemas/CustomFieldOrder'
        force:
          $ref: '#/components/schemas/CustomFieldForceUpdate'
        section_id:
          $ref: '#/components/schemas/CustomFieldSectionId'
    CustomFieldMultipleSelectImage:
      description: Multiple Select Image Custom Field
      type: object
      required:
        - name
        - type
        - possible_values
        - possible_images_urls
        - possible_images_labels
      properties:
        name:
          $ref: '#/components/schemas/CustomFieldName'
        description:
          $ref: '#/components/schemas/CustomFieldDescription'
        type:
          $ref: '#/components/schemas/CustomFieldTypeMultipleSelectImage'
        slug:
          $ref: '#/components/schemas/CustomFieldSlug'
        possible_values:
          $ref: '#/components/schemas/CustomFieldPossibleValuesMSI'
        possible_images_urls:
          $ref: '#/components/schemas/CustomFieldPossibleImagesUrls'
        possible_images_labels:
          $ref: '#/components/schemas/CustomFieldPossibleImagesLabels'
        possible_orders:
          $ref: '#/components/schemas/CustomFieldPossibleOrders'
        max_selected_values:
          $ref: '#/components/schemas/CustomFieldMaxSelectedValues'
        order:
          $ref: '#/components/schemas/CustomFieldOrder'
        force:
          $ref: '#/components/schemas/CustomFieldForceUpdate'
        section_id:
          $ref: '#/components/schemas/CustomFieldSectionId'
    CustomFieldImagesUploader:
      description: Images uploader Custom Field
      type: object
      required:
        - name
        - type
        - text_fields
      properties:
        name:
          $ref: '#/components/schemas/CustomFieldName'
        description:
          $ref: '#/components/schemas/CustomFieldDescription'
        type:
          $ref: '#/components/schemas/CustomFieldTypeImagesUploader'
        slug:
          $ref: '#/components/schemas/CustomFieldSlug'
        text_fields:
          $ref: '#/components/schemas/CustomFieldTextFields'
        order:
          $ref: '#/components/schemas/CustomFieldOrder'
        force:
          $ref: '#/components/schemas/CustomFieldForceUpdate'
        section_id:
          $ref: '#/components/schemas/CustomFieldSectionId'
    CustomFieldId:
      description: Id of the custom field
      type: integer
      example: 42
    CustomFieldName:
      description: The name of the custom field
      type: string
      minLength: 1
      maxLength: 50
      example: Click and collect
    CustomFieldDescription:
      description: Description of the custom field
      type: string
      maxLength: 150
      nullable: true
      example: Whether the business offers click and collect service
    CustomFieldTypeBool:
      description: BOOLEAN
      minLength: 1
      type: string
      example: BOOLEAN
    CustomFieldSlug:
      description: >-
        Unique identifier slug for the custom field. Cannot contain any of the
        following characters: `,;/\|<>`
      type: string
      minLength: 1
      maxLength: 100
      nullable: true
      example: click-and-collect
    CustomFieldOrder:
      description: >-
        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.
      type: integer
      default: 10
      example: 30
    CustomFieldForceUpdate:
      description: >
        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.
      type: boolean
      default: false
    CustomFieldSectionId:
      description: Id of the custom field section
      type: integer
      example: 6
    CustomFieldTypeText:
      description: TEXT
      minLength: 1
      type: string
      example: TEXT
    CustomFieldMaxLen:
      description: maximum lenght for TEXT field
      type: integer
      example: 10
    CustomFieldTypeInteger:
      description: INTEGER
      minLength: 1
      type: string
      example: INTEGER
    CustomFieldMin:
      description: minimum value for INTEGER field
      type: integer
      example: 0
    CustomFieldMax:
      description: maximum value for INTEGER field
      type: integer
      example: 100
    CustomFieldTypeFloat:
      description: FLOAT
      minLength: 1
      type: string
      example: FLOAT
    CustomFieldFloatMin:
      description: minimum value for FLOAT field
      type: number
      example: 0
    CustomFieldFloatMax:
      description: maximum value for FLOAT field
      type: number
      example: 10.5
    CustomFieldTypeSingleSelect:
      description: SINGLE_SELECT
      minLength: 1
      type: string
      example: SINGLE_SELECT
    CustomFieldPossibleValues:
      minItems: 1
      description: list of available values
      type: array
      items:
        type: string
      example:
        - free parking
        - disabled access
    CustomFieldPossibleOrders:
      description: >
        The order of the possible values. Array of integers where each element
        corresponds  to the display order of the value at the same index in
        possible_values. Orders with gaps (e.g., [5, 8, 1]) will be
        automatically normalized to consecutive  values (e.g., [2, 3, 1]) while
        preserving the relative ordering.
      type: array
      items:
        type: integer
        nullable: true
      nullable: true
      example:
        - 3
        - 2
        - 4
        - 1
    CustomFieldTypeMultipleSelect:
      description: MULTIPLE_SELECT
      minLength: 1
      type: string
      example: MULTIPLE_SELECT
    CustomFieldMaxSelectedValues:
      description: Maximum number of values that can be selected for multiple select fields
      type: integer
      minimum: 1
      nullable: true
      example: 3
    CustomFieldTypeMultipleSelectImage:
      description: MULTIPLE_SELECT_IMAGE
      minLength: 1
      type: string
      example: MULTIPLE_SELECT_IMAGE
    CustomFieldPossibleValuesMSI:
      minItems: 1
      description: >
        List of available values.

        Each element corresponds to one of possible_images_urls and
        possible_images_labels.

        Hence, the 3 lists shall have the same size.
      type: array
      items:
        type: string
      example:
        - first image
        - second image
    CustomFieldPossibleImagesUrls:
      minItems: 1
      description: List of available urls
      type: array
      items:
        type: string
      example:
        - https://image1
        - https://image2
    CustomFieldPossibleImagesLabels:
      minItems: 1
      description: >
        List of available labels.

        Can be set to null but shall always have the same number of elements as
        possible_values and possible_images_urls.
      type: array
      items:
        type: string
      example:
        - Image 1
        - Image 2
    CustomFieldTypeImagesUploader:
      description: IMAGES_UPLOADER
      minLength: 1
      type: string
      example: IMAGES_UPLOADER
    CustomFieldTextFields:
      description: Configuration for text type Custom Fields
      type: array
      items:
        type: object
        required:
          - text_field
        properties:
          text_field:
            type: string
            description: Name of the text field
          max_length:
            type: integer
            minimum: 1
            maximum: 1000
            nullable: true
            description: Maximum length for the text field
      example:
        - text_field: Caption
          max_length: 100
        - text_field: Alt Text
          max_length: 50
  responses:
    '401':
      description: You are not authenticated
      content:
        application/json:
          schema:
            description: Error that occurs when you are not authenticated
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authentication:
                    type: string
                    default: User not authenticated
    '403':
      description: |
        You are not allowed to perform this action
      content:
        application/json:
          schema:
            description: >
              Error that occurs when you are authenticated but you are trying to
              perform an action you are not allowed to perform
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authorization:
                    type: string
                    default: Operation not allowed
    '404':
      description: Resource does not exist
      content:
        application/json:
          schema:
            description: >-
              Error that occcurs when you are trying to reach a resource that
              does not exist
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  json:
                    type: string
                    default: Resource not found
  securitySchemes:
    ApiKeyAuth:
      description: >
        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.
      type: apiKey
      in: header
      name: x-APIKey

````