# Getting a 400 error on creating custom fields via API - order: This value is not valid

**URL:** <https://forum.mautic.org/t/getting-a-400-error-on-creating-custom-fields-via-api-order-this-value-is-not-valid/19951>\
**Category:** Development\
**Created:** [June 24, 2021, 5:14pm UTC](https://forum.mautic.org/t/getting-a-400-error-on-creating-custom-fields-via-api-order-this-value-is-not-valid/19951 "2021-06-24T17:14:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [June 24, 2021, 5:14pm UTC](https://forum.mautic.org/t/getting-a-400-error-on-creating-custom-fields-via-api-order-this-value-is-not-valid/19951/1 "2021-06-24T17:14:16Z")

</div>

Anyone able to help me out with an issue I am bumping up against when testing this PR: [https://github.com/mautic/mautic/pull/9761](https://github.com/mautic/mautic/pull/9761)

When I try to create the field I am using a POST to [https://mautic4.ddev.site/api/fields/contact/new](https://mautic4.ddev.site/api/fields/contact/new) per [the docs](https://developer.mautic.org/#create-field)

I am getting a 400 response with vanilla Mautic (no PR applied, features branch):

```auto
“code”: 400,
            “message”: “order: This value is not valid.“,

```

I have made sure I am using an int, tried setting to higher values, tried not including order - nothing seems to work - also tried getting first and literally copy/pasting.

Also reported on Stack Overflow: [symfony - Mautic Contact Field Api request returning 400 in response - Stack Overflow](https://stackoverflow.com/questions/54490419/mautic-contact-field-api-request-returning-400-in-response) with no response.

Not sure if this is a bug or a user error! 😊

Here’s the body I am using to test in Postman:

```auto
{
        "label": "Added by API",
        "alias": "addedbyapi",
        "type": "text",
        "group": "core",
        "object": "contact",
        "order": 150,
        "defaultValue": null,
        "isRequired": false,
        "isPubliclyUpdatable": false,
        "isUniqueIdentifier": false,
        "properties": {}
}

```

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [September 15, 2021, 9:22am UTC](https://forum.mautic.org/t/getting-a-400-error-on-creating-custom-fields-via-api-order-this-value-is-not-valid/19951/2 "2021-09-15T09:22:12Z")

</div>

Solution: Field needs to be called field\_order - also something was saved or cached someplace in Postman which was using the fieldname order! 🤦‍♀️ thanks @kuzmany for the tip off!
