Add a Custom Field

POST /custom_fields

Add a new custom field

application/json

Body

  • custom_field object
    Hide custom_field attributes Show custom_field attributes object
    • key string
    • label string
    • entity_type string

      Values are item or order.

    • value_type string

      Values are string, number, boolean, or array.

    • options array[string]

Responses

  • 201 application/json

    Custom Field created

    Hide response attributes Show response attributes object
    • id string(guid)

      System generated unique identifier. Don't include this in POST request body.

    • key string
    • label string
    • entity_type string

      Values are item or order.

    • value_type string

      Values are string, number, boolean, or array.

    • options array[string]
    • created_at string(date-time)
    • updated_at string(date-time)
POST /custom_fields
curl \
 --request POST 'https://app.getfoundation.com/api/external/v1/custom_fields' \
 --header "X-API-Key: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"custom_field":{"key":"country_of_origin","label":"Country Of Origin","entity_type":"item","value_type":"string","options":["USA","China","India"]}}'
Request examples
{
  "custom_field": {
    "key": "country_of_origin",
    "label": "Country Of Origin",
    "entity_type": "item",
    "value_type": "string",
    "options": [
      "USA",
      "China",
      "India"
    ]
  }
}
Response examples (201)
{
  "id": "9aa62446-c3b0-42f5-8027-3648daed9d73",
  "key": "country_of_origin",
  "label": "Country Of Origin",
  "entity_type": "item",
  "value_type": "string",
  "options": [
    "USA",
    "China",
    "India"
  ],
  "created_at": "2025-05-04T09:42:00Z",
  "updated_at": "2025-05-04T09:42:00Z"
}