# Create Custom Input Field

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/products/{product_id}/custom_user_input_fields/:
    post:
      summary: Create Custom Input Field
      deprecated: false
      description: >-
        Adds custom user-input fields to a product, allowing customers to
        provide additional information while making a purchase. Custom user
        input fields can be used to collect data such as personalization
        details, gift messages, or special instructions.


        <Accordion title="🔑Scopes" defaultOpen>
            
          `products.read_write` - Products Read & Write
         
        </Accordion>
      tags:
        - Default module/Apps/Merchant APIs/Products/Product Variants
        - Product Customizations
      parameters:
        - name: product_id
          in: path
          description: The unique identifier for the product.
          required: true
          example: e0ad7a76-ba42-4c59-94c9-0da600117fbf
          schema:
            type: string
            examples:
              - 107c2ff5-5c70-4749-b9bd-56dc1793013b
        - name: Access-Token
          in: header
          description: >-
            This token is used to authenticate and access information related to
            the store. It is obtained through an OAuth mechanism and is required
            to perform operations on the store's data. The `X-Manager-Token`
            should be included in the header of API requests that require
            store-related information.
          required: true
          example: '{{Access-Token}}'
          schema:
            type: string
        - name: Store-Id
          in: header
          description: Unique identifier of the store.
          required: true
          example: '{{StoreId}}'
          schema:
            type: number
            examples:
              - 37213
        - name: Role
          in: header
          description: ''
          required: true
          example: Manager
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: false
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomInputRequestObject'
            example:
              type: TEXT
              label:
                en: Engraving Text
                ar: نص النقش
              hint:
                en: Please enter the engraving you want on the product
                ar: الرجاء إدخال النص المراد نقشه على المنتج
              price: 44.5
              is_required: false
              is_published: true
              display_order: 1
              configs:
                is_multiline: true
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  type:
                    type: string
                  hint:
                    type: object
                    properties:
                      en:
                        type: string
                      ar:
                        type: string
                    x-apidog-orders:
                      - en
                      - ar
                    required:
                      - en
                      - ar
                    x-apidog-ignore-properties: []
                    nullable: true
                  label:
                    type: object
                    properties:
                      en:
                        type: string
                      ar:
                        type: string
                    required:
                      - en
                      - ar
                    x-apidog-orders:
                      - en
                      - ar
                    x-apidog-ignore-properties: []
                  display_order:
                    type: integer
                  is_required:
                    type: boolean
                  price:
                    type: number
                  formatted_price:
                    type: string
                  configs:
                    type: object
                    properties:
                      is_multiline:
                        type: boolean
                    x-apidog-orders:
                      - is_multiline
                    required:
                      - is_multiline
                    x-apidog-ignore-properties: []
                    nullable: true
                  visibility_condition:
                    anyOf:
                      - $ref: '#/components/schemas/VisibilityConditionObject'
                      - type: 'null'
                  is_published:
                    type: boolean
                required:
                  - id
                  - type
                  - hint
                  - label
                  - display_order
                  - is_required
                  - price
                  - formatted_price
                  - configs
                  - visibility_condition
                  - is_published
                x-apidog-orders:
                  - id
                  - type
                  - hint
                  - label
                  - display_order
                  - is_required
                  - price
                  - formatted_price
                  - configs
                  - visibility_condition
                  - is_published
                x-apidog-ignore-properties: []
              example:
                id: b5364fa7-dda9-4005-aabf-fd20abb82517
                type: TEXT
                hint:
                  en: Please enter the engraving you want on the product
                  ar: الرجاء إدخال النص المراد نقشه على المنتج
                label:
                  en: Engraving Text
                  ar: نص النقش
                display_order: 1
                is_required: false
                price: 44.5
                formatted_price: ' SAR 44.50'
                configs:
                  is_multiline: true
                visibility_condition: null
                is_published: true
          headers: {}
          x-apidog-name: Created
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Response returned when the request cannot be authenticated
                  because the required credentials are missing, invalid, or
                  expired.
                properties:
                  status:
                    type: string
                    description: Indicates the overall status of the API response.
                    examples:
                      - error
                  message:
                    type: object
                    description: >-
                      Contains structured details explaining why the request
                      could not be authenticated.
                    properties:
                      type:
                        type: string
                        description: Indicates the category of the response message.
                        examples:
                          - error
                      code:
                        type: string
                        description: >-
                          A machine-readable code identifying the authentication
                          error. Returns null when no specific code is
                          available.
                        examples:
                          - UNAUTHORIZED
                        nullable: true
                      name:
                        type: string
                        description: >-
                          A short, human-readable title describing the
                          authentication error. Returns null when no title is
                          available.
                        examples:
                          - Unauthorized
                        nullable: true
                      description:
                        type: string
                        description: >-
                          A human-readable explanation of why the request could
                          not be authenticated. Returns null when no detailed
                          explanation is available.
                        examples:
                          - >-
                            Authentication credentials are missing, invalid, or
                            expired.
                        nullable: true
                    required:
                      - type
                      - code
                      - name
                      - description
                    x-apidog-orders:
                      - type
                      - code
                      - name
                      - description
                    x-apidog-ignore-properties: []
                required:
                  - status
                  - message
                x-apidog-orders:
                  - status
                  - message
                examples:
                  - status: error
                    message:
                      type: error
                      code: UNAUTHORIZED
                      name: Unauthorized
                      description: >-
                        Authentication credentials are missing, invalid, or
                        expired.
                x-apidog-ignore-properties: []
              examples:
                '2':
                  summary: Example 1
                  value:
                    status: error
                    message:
                      type: error
                      code: ERROR_SESSION_MISSING
                      name: Sorry
                      description: Please login first.
                '3':
                  summary: Example 2
                  value:
                    status: error
                    message:
                      type: error
                      code: ERROR_SESSION_INVALID
                      name: Sorry
                      description: Login session expired. Please login again.
                '4':
                  summary: Example 3
                  value:
                    status: error
                    message:
                      type: error
                      code: ERROR_SESSION_INVALID
                      name: Sorry
                      description: Invalid authentication
          headers: {}
          x-apidog-name: Unauthorized
        '500':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Status of the error.
                  message:
                    $ref: '#/components/schemas/ResponseEnvelopMessage'
                required:
                  - status
                  - message
                x-apidog-orders:
                  - status
                  - message
                x-apidog-ignore-properties: []
              example:
                status: error
                message:
                  type: error
                  code: MSG_HIDDEN
                  name: Error
                  description: Internal Server Error
          headers: {}
          x-apidog-name: Internal Server error
      security: []
      x-apidog-folder: Default module/Apps/Merchant APIs/Products/Product Variants
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/613905/apis/api-9148585-run
components:
  schemas:
    CustomInputRequestObject:
      type: object
      properties:
        type:
          type: string
          description: >-
            Defines the type of input field that will be added to the product.
            This can represent different types of input fields such as text
            boxes, number fields, or file uploads.
          examples:
            - TEXT
            - NUMBER
            - URL
            - FILE
            - IMAGE
            - DATE
            - TIME
        label:
          type: object
          properties:
            en:
              type: string
              description: The label in English.
            ar:
              type: string
              description: The label in Arabic.
          required:
            - en
            - ar
          x-apidog-orders:
            - en
            - ar
          description: >-
            This represents the display name of the input field.

            It is a localized object where each key is a language code and the
            value is the corresponding translated label.
          x-apidog-ignore-properties: []
        hint:
          type: object
          properties:
            en:
              type: string
              description: The hint in English.
            ar:
              type: string
              description: The hint in Arabic.
          x-apidog-orders:
            - en
            - ar
          description: >-
            Additional information or guidance related to the input field. It's
            often used as a tooltip or helper text for the user.
          x-apidog-ignore-properties: []
          nullable: true
        price:
          type: number
          description: Represents the price associated with this input field.
          default: 0
          examples:
            - 14.35
        is_required:
          type: boolean
          description: >-
            Specifies whether filling this input field is required by the
            customer.
          default: false
        is_published:
          type: boolean
          description: Specifies whether this input field is published or not.
          default: true
        display_order:
          type: integer
          description: >-
            The display order of this input field in relation to other input
            fields.
        configs:
          type: object
          properties:
            is_multiline:
              type: boolean
              default: false
              description: >-
                This option is only applicable when input field type is TEXT. It
                specfies if the text box should be multi line.
          x-apidog-orders:
            - is_multiline
          x-apidog-ignore-properties: []
          nullable: true
      required:
        - type
        - label
      x-apidog-orders:
        - type
        - label
        - hint
        - price
        - is_required
        - is_published
        - display_order
        - configs
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    VisibilityConditionObject:
      type: object
      properties:
        condition_field_id:
          type: string
        condition_field_type:
          type: string
          examples:
            - custom_option_field
            - custom_user_input_field
        id:
          type: string
        operator:
          type: string
          examples:
            - IN
            - '='
            - '!='
            - '>'
            - '>='
            - <
            - <=
        value:
          anyOf:
            - type: object
              properties:
                value:
                  type: number
              x-apidog-orders:
                - value
              title: Number
              required:
                - value
              x-apidog-ignore-properties: []
            - type: object
              properties:
                id:
                  type: string
              x-apidog-orders:
                - id
              required:
                - id
              title: ID
              x-apidog-ignore-properties: []
            - type: object
              properties:
                id:
                  type: array
                  items:
                    type: string
              x-apidog-orders:
                - id
              required:
                - id
              title: List of IDs
              x-apidog-ignore-properties: []
      x-apidog-orders:
        - condition_field_id
        - condition_field_type
        - id
        - operator
        - value
      required:
        - condition_field_id
        - condition_field_type
        - id
        - operator
        - value
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ResponseEnvelopMessage:
      type: object
      properties:
        type:
          type: string
          description: Type of response message returned by the API.
          examples:
            - success
        code:
          type: string
          description: Response code returned by the API, if available.
          examples:
            - MSG_POPUP_OK
          nullable: true
        name:
          type: string
          description: Name or title of the response message, if available.
          examples:
            - Coupons
          nullable: true
        description:
          type: string
          description: Detailed description of the response message, if available.
          examples:
            - Coupons created successfully
          nullable: true
      required:
        - type
        - code
        - name
        - description
      description: Additional response metadata.
      x-apidog-orders:
        - type
        - code
        - name
        - description
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://api.zid.sa/
    description: Prod Env
security: []

```
