# Cannot create company with state shortcodes through the API

**URL:** <https://integration.keap.com/t/cannot-create-company-with-state-shortcodes-through-the-api/82202>\
**Category:** API Q&A\
**Tags:** api, company, region\
**Created:** [February 12, 2021, 7:23pm UTC](https://integration.keap.com/t/cannot-create-company-with-state-shortcodes-through-the-api/82202 "2021-02-12T19:23:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Walter\_Contreras](https://avatars.discourse-cdn.com/v4/letter/w/ba8739/32.png) [@Walter\_Contreras](https://integration.keap.com/u/Walter_Contreras)\
**Post date:** [February 12, 2021, 7:23pm UTC](https://integration.keap.com/t/cannot-create-company-with-state-shortcodes-through-the-api/82202/1 "2021-02-12T19:23:52Z")

</div>

Howdy,

We’ve noticed since 2019 there is a double standard for IFS API interactions that does not apply to user interactions.

 ![Screen Shot 2021-02-12 at 2.14.17 PM](https://us1.discourse-cdn.com/flex019/uploads/infusionsoft1/original/2X/7/722f92a403f6f10b2eb39baae469d447f50683e9.png)  
You’ll notice that I can type random nonsense into the state field, and that’s great. Really, it’s just a string field; therefore there’s no enforcement of type etc. But if I were to do the same thing through the REST API, you’ll notice that my request gets rejected! Even if I use a **valid state/province shortcode** the API will say it is invalid.  
 ![Screen Shot 2021-02-12 at 11.28.25 AM](https://us1.discourse-cdn.com/flex019/uploads/infusionsoft1/original/2X/7/781f9f908d6b1cca16d8eb2a2bf144085f207a9a.png)  
Okay, so we came up with a really clever solution for this where we lookup the full name of the state from a table and then use THAT in our POST/PATCH request. This was working fine but then I realized, InfusionSoft provides a form for users to search multiple states **by shortcode only**  
What?  
 ![Screen Shot 2021-02-12 at 1.08.49 PM](https://us1.discourse-cdn.com/flex019/uploads/infusionsoft1/original/2X/b/bc677ffd20cad17500a41e47a5d114b441df3cf5.png)  
Can you explain this to me? Is there a way I can use the XML-RPC API to post state shortcodes?

---

<div class="post-metadata">

**Author:** ![TomScott](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/tomscott/32/67_2.png) [@TomScott](https://integration.keap.com/u/TomScott)\
**Post date:** [March 4, 2021, 8:11pm UTC](https://integration.keap.com/t/cannot-create-company-with-state-shortcodes-through-the-api/82202/2 "2021-03-04T20:11:12Z")

</div>

The Region field should conform to ISO\_3166-2 standards, which means that for a Country of “US” it’s generally just as simple as providing “US-TX” for short values, or “Texas” for full name. There are libraries available for most major languages to provide the ISO list so that you can map it to dropdown values at need rather than hard-coding it.

> **[ISO 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US)**
>
> ISO 3166-2:US is the entry for the United States in ISO 3166-2, part of the ISO 3166 standard published by the International Organization for Standardization (ISO), which defines codes for the names of the principal subdivisions (e.g., provinces or states) of all countries coded in ISO 3166-1.
> Currently for the United States, ISO 3166-2 codes are defined for the following subdivisions:
> Each code consists of two parts, separated by a hyphen. The first part is .mw-parser-output .monospaced{font-f...
