Create field for form
Creates a new custom field on the specified form.
/v1/forms/:pageId/fieldsAuthorization
api_key_auth API key authentication. Use "Bearer YOUR_API_KEY" format.
In: header
Path Parameters
Unique identifier. Must be in BSON ObjectId format.
^[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
}