[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Forder-properties\u002Fcreate":3,"docs-tabs-entities\u002Forder-properties\u002Fcreate":6},{"content":4,"lastmod":5},"## Create an order property\n\n`POST \u002Fv1\u002Forder-properties`\n\nCreates an online store order field definition for entering additional information at checkout.\n\nPass fields at the root of the JSON body, without a `fields` wrapper.\n\n## Request body fields\n\n| Field | Type | Required | Description |\n|------|------|------|------|\n| `personTypeId` | number | yes | Payer type ID. List: [`GET \u002Fv1\u002Fperson-types`](\u002Fdocs\u002Fentities\u002Fperson-types\u002Flist) |\n| `type` | string | yes | Property type: `STRING`, `Y\u002FN`, `NUMBER`, `ENUM`, `FILE`, `DATE`, `LOCATION`, `ADDRESS` |\n| `name` | string | yes | Order field name |\n| `propsGroupId` | number | yes | Property group ID for the selected payer type. Source: [`GET \u002Fv1\u002Forder-properties`](.\u002Flist.md), the `propsGroupId` field |\n| `code` | string \\| null | no | Symbolic code |\n| `sort` | number | no | Sort order |\n| `defaultValue` | any | no | Default value. A scalar or structure depending on the type and `multiple`. For `FILE`, upload using `{ \"fileData\": [\"filename\", \"base64\"] }` |\n| `description` | string \\| null | no | Field description |\n| `settings` | object | no | Property type settings. A JSON object. Pass the property fields at the top level of the request body |\n| `xmlId` | string \\| null | no | External ID |\n| `inputFieldLocation` | number | no | Deprecated field. Bitrix24 does not use it |\n| `active` | boolean | no | The property is active |\n| `required` | boolean | no | A value is required at checkout |\n| `multiple` | boolean | no | The property holds multiple values |\n| `userProps` | boolean | no | Save the value in the buyer profile |\n| `util` | boolean | no | Internal property |\n| `isAddress` | boolean | no | The property contains an address |\n| `isAddressFrom` | boolean | no | Origin address |\n| `isAddressTo` | boolean | no | Destination address |\n| `isEmail` | boolean | no | The property contains an email address |\n| `isFiltered` | boolean | no | Use the property in a filter |\n| `isLocation` | boolean | no | The property contains a location |\n| `isLocation4tax` | boolean | no | Location used to calculate taxes |\n| `isPayer` | boolean | no | Payer name |\n| `isPhone` | boolean | no | Phone number |\n| `isProfileName` | boolean | no | Buyer profile name |\n| `isZip` | boolean | no | Postal code |\n\nThe server assigns `id`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Forder-properties\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n  \"personTypeId\": 5,\n  \"type\": \"STRING\",\n  \"name\": \"Comment for the courier\",\n  \"propsGroupId\": 9,\n  \"code\": \"DELIVERY_COMMENT\",\n  \"sort\": 500,\n  \"active\": false,\n  \"required\": false,\n  \"defaultValue\": \"Call before delivery\",\n  \"settings\": {\n    \"maxlength\": 200\n  }\n}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Forder-properties\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n  \"personTypeId\": 5,\n  \"type\": \"STRING\",\n  \"name\": \"Comment for the courier\",\n  \"propsGroupId\": 9,\n  \"code\": \"DELIVERY_COMMENT\",\n  \"sort\": 500,\n  \"active\": false,\n  \"required\": false,\n  \"defaultValue\": \"Call before delivery\",\n  \"settings\": {\n    \"maxlength\": 200\n  }\n}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Forder-properties', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    \"personTypeId\": 5,\n    \"type\": \"STRING\",\n    \"name\": \"Comment for the courier\",\n    \"propsGroupId\": 9,\n    \"code\": \"DELIVERY_COMMENT\",\n    \"sort\": 500,\n    \"active\": false,\n    \"required\": false,\n    \"defaultValue\": \"Call before delivery\",\n    \"settings\": {\n      \"maxlength\": 200\n    }\n  }),\n})\n\nconst { success, data } = await res.json()\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Forder-properties', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    \"personTypeId\": 5,\n    \"type\": \"STRING\",\n    \"name\": \"Comment for the courier\",\n    \"propsGroupId\": 9,\n    \"code\": \"DELIVERY_COMMENT\",\n    \"sort\": 500,\n    \"active\": false,\n    \"required\": false,\n    \"defaultValue\": \"Call before delivery\",\n    \"settings\": {\n      \"maxlength\": 200\n    }\n  }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|------|------|\n| `success` | boolean | `true` on success. HTTP status: `201` |\n| `data` | object | Created order property. Full field list: [Order property fields](.\u002Ffields.md) |\n\n## Response example\n\nThe main fields are shown. Full list: [Order property fields](.\u002Ffields.md).\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 125,\n    \"personTypeId\": 5,\n    \"type\": \"STRING\",\n    \"name\": \"Comment for the courier\",\n    \"propsGroupId\": 9,\n    \"code\": \"DELIVERY_COMMENT\",\n    \"active\": false,\n    \"defaultValue\": \"Call before delivery\",\n    \"settings\": {\n      \"maxlength\": 200,\n      \"multiline\": \"N\"\n    }\n  }\n}\n```\n\n## Error response example\n\n400 — `settings` was set to `null`:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"Order property settings must be an object.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|------|------|\n| 400 | `MISSING_REQUIRED_FIELDS` | `personTypeId`, `type`, `name`, or `propsGroupId` is missing; `personTypeId`, `name`, or `propsGroupId` is `null`; or `name` is an empty string |\n| 400 | `INVALID_PARAMS` | `type` is not an allowed property type, is `null`, or is an empty string. Message: `Invalid order property type.` |\n| 400 | `READONLY_FIELD` | The request contains `id`, `relations` or `variants`, including inside `settings` |\n| 400 | `INVALID_PARAMS` | An object or array was passed to a scalar field |\n| 400 | `INVALID_PARAMS` | A nonnumeric string, an empty string, or a boolean was passed to a numeric field |\n| 400 | `INVALID_PARAMS` | A flag is neither boolean `true`\u002F`false` nor one of the strings `\"Y\"`\u002F`\"N\"`, `\"yes\"`\u002F`\"no\"`, `\"1\"`\u002F`\"0\"`, `\"true\"`\u002F`\"false\"` (case-insensitive, ignoring surrounding whitespace) |\n| 400 | `INVALID_PARAMS` | `settings` is not a JSON object |\n| 422 | `BITRIX_ERROR` | Bitrix24 rejected the operation. The reason is in `message` |\n| 422 | `BITRIX_ERROR` | The key's user does not have permission in Bitrix24. The Bitrix24 code is in `error.b24Code`: `200040300020` |\n| 403 | `BITRIX_ACCESS_DENIED` | The portal credentials do not have the `sale` scope (`insufficient_scope`) |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode |\n| 403 | `SCOPE_DENIED` | The API key does not have the `sale` scope |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n\nFor the full list of shared API errors, see [Error codes](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [Order properties](\u002Fdocs\u002Fentities\u002Forder-properties)\n- [Get an order property](.\u002Fget.md)\n- [Update an order property](.\u002Fupdate.md)\n- [Delete an order property](.\u002Fdelete.md)\n- [Order property fields](.\u002Ffields.md)\n","2026-10-09",{},1795415262459]