Customfield

A CustomField object provides you with the ability to extend the User Interface for the Shopmonkey web app.


GET/v3/customfield/:id

Find Customfield Definition

Find one Customfield Definition by id

URL parameters

  • Name
    id
    Type
    string Required
    Description
    the id for the object to retrieve

200 Response

  • Name
    data
    Type
    object Required
    Description
    CustomFieldDefinition schema
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Properties for data object

  • Name
    id
    Type
    string Required
    Description
  • Name
    meta
    Type
    object Required
    Description
    the metadata about the most recent change to the row
  • Name
    createdDate
    Type
    string Required
    Description
  • Name
    updatedDate
    Type
    string Required
    Description
  • Name
    companyId
    Type
    string Required
    Description
  • Name
    type
    Type
    string Required
    Description
  • Name
    config
    Type
    object
    Description
    the configuration for the custom field, dependent on the type
  • Name
    name
    Type
    string Required
    Description
    the name of the internal field name (not displayed)
  • Name
    label
    Type
    object
    Description
    the label text to show for the field as JSON where key is the language and value is the localized value
  • Name
    help
    Type
    object
    Description
    the help text to show for the field as JSON where key is the language and value is the localized value
  • Name
    description
    Type
    object
    Description
    the description text to show for the field as JSON where key is the language and value is the localized value
  • Name
    required
    Type
    boolean Required
    Description
    if the value is required to have a value
  • Name
    validationUrl
    Type
    string Required
    Description
    the url (which much be CORs enabled) for validating the value on change
  • Name
    validationRegExp
    Type
    string Required
    Description
    a regular expression to use for validating the input value
  • Name
    scope
    Type
    string Required
    Description

Properties for meta object

  • Name
    userId
    Type
    string
    Description
    the user id that made the most recent change
  • Name
    sessionId
    Type
    string
    Description
    the session id for the most recent change
  • Name
    version
    Type
    number
    Description
    a monotonically increasing number for the most recent change

4xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

5xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Example Request

GET
/v3/customfield/:id
curl https://api.shopmonkey.cloud/v3/customfield/ID \ 
  -H "Authorization: Bearer ${SM_TOKEN}"

Example Response
application/json

{
  "success": true,
  "data": {
    "id": "id",
    "meta": {
      "userId": "userId",
      "sessionId": "sessionId",
      "version": 1
    },
    "createdDate": "createdDate",
    "updatedDate": null,
    "companyId": "companyId",
    "type": "type",
    "name": "name",
    "required": true,
    "validationUrl": null,
    "validationRegExp": null,
    "scope": "scope"
  }
}

GET/v3/customfield

List Customfield Definitions

Find all Customfield Definitions

200 Response

  • Name
    data
    Type
    array Required
    Description
    an array of items
  • Name
    meta
    Type
    object
    Description
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Properties for meta object

  • Name
    hasMore
    Type
    boolean Required
    Description
    if there are more records available
  • Name
    total
    Type
    number Required
    Description
    the total number of records

4xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

5xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Example Request

GET
/v3/customfield
curl https://api.shopmonkey.cloud/v3/customfield \ 
  -H "Authorization: Bearer ${SM_TOKEN}"

Example Response
application/json

{
  "success": true,
  "data": [
    {
      "id": "id",
      "createdDate": "createdDate",
      "updatedDate": null,
      "companyId": "companyId",
      "type": "type",
      "name": "name",
      "required": true,
      "validationUrl": null,
      "validationRegExp": null,
      "scope": "scope"
    }
  ]
}