Create field for form

Creates a new custom field on the specified form.

POST/v1/forms/:pageId/fields

Authorization

api_key_auth
AuthorizationBearer <token>

API key authentication. Use "Bearer YOUR_API_KEY" format.

In: header

Path Parameters

pageId*string

Unique identifier. Must be in BSON ObjectId format.

Match^[0-9a-fA-F]{24}$

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.checkoutpage.com/v1/forms/:pageId/fields" \  -H "Content-Type: application/json" \  -d '{    "label": "Company Name"  }'
{
  "data": {
    "id": "507f1f77bcf86cd799439011",
    "label": "Company Name",
    "placeholder": "Enter your company name",
    "element": "text",
    "type": "company-name",
    "options": [
      {
        "id": "65f4a1c2e4a9f3d2b1c0a9e8",
        "label": "Label",
        "value": "value"
      }
    ],
    "required": true,
    "order": 0,
    "reference": "custom_field_1",
    "hidden": false,
    "defaultValue": {
      "enabled": true,
      "value": "string"
    },
    "showHideLogic": {
      "enabled": true,
      "comparison": "is",
      "value": "string",
      "element": {
        "elementTitle": "string",
        "elementType": "field",
        "elementId": "string"
      }
    },
    "minValue": {
      "enabled": true,
      "value": "string"
    },
    "maxValue": {
      "enabled": true,
      "value": "string"
    },
    "limitAllowedCountries": {
      "enabled": true,
      "countries": [
        "string"
      ]
    },
    "showSelectedDialCode": true,
    "createdAt": "2024-01-15T10:30:00.000Z",
    "updatedAt": "2024-01-15T10:30:00.000Z"
  }
}
{
  "status": "error",
  "type": "error",
  "message": "Not Found",
  "errors": [
    {
      "param": "string",
      "message": "string",
      "value": null
    }
  ],
  "property1": null,
  "property2": null
}
{
  "status": "error",
  "type": "error",
  "message": "Not Found",
  "errors": [
    {
      "param": "string",
      "message": "string",
      "value": null
    }
  ],
  "property1": null,
  "property2": null
}
{
  "status": "error",
  "type": "error",
  "message": "Not Found",
  "errors": [
    {
      "param": "string",
      "message": "string",
      "value": null
    }
  ],
  "property1": null,
  "property2": null
}
{
  "status": "error",
  "type": "error",
  "message": "Not Found",
  "errors": [
    {
      "param": "string",
      "message": "string",
      "value": null
    }
  ],
  "property1": null,
  "property2": null
}
{
  "status": "error",
  "type": "error",
  "message": "Not Found",
  "errors": [
    {
      "param": "string",
      "message": "string",
      "value": null
    }
  ],
  "property1": null,
  "property2": null
}
{
  "status": "error",
  "type": "error",
  "message": "Not Found",
  "errors": [
    {
      "param": "string",
      "message": "string",
      "value": null
    }
  ],
  "property1": null,
  "property2": null
}