> For the complete documentation index, see [llms.txt](https://vu-custom.gitbook.io/vu-custom/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vu-custom.gitbook.io/vu-custom/admin-api/account-management/create-a-sold_to_account.md).

# Create a sold\_to\_account

Method : <mark style="color:green;">**POST**</mark> &#x20;

{% code fullWidth="false" %}

```url
https://os.vucustom.com/api/v1/sold_to_accounts
```

{% endcode %}

<details>

<summary>Example Request Body</summary>

```json
{
    "sold_to_account": {
        "account_number": "123",
        "address_1": "448 Test Street",
        "address_2": "",
        "alternate_name": "ATTN",
        "city": "Lawrence",
        "company_name": "",
        "country": "US",
        "first_name": "John",
        "last_name": "Doe",
        "phone": "(770) 210-4897",
        "postal_code": "66049",
        "ship_to_accounts": [
            {
                "account_number": "123_sh",
                "address_1": "448 Test Street",
                "address_2": "",
                "alternate_name": "ATTN",
                "city": "s",
                "company_name": "",
                "country": "US",
                "email": "test@test.com",
                "first_name": "John",
                "last_name": "Doe",
                "phone": "(770) 210-4897",
                "postal_code": "66049",
                "state_region": "KS"
            }
        ],
        "state_region": "KS"
    }
}
```

</details>

Request Body Schema

<table><thead><tr><th width="187">Field Name</th><th width="87">Type</th><th width="66">Required</th><th>Description</th></tr></thead><tbody><tr><td>account_number</td><td>string</td><td>Yes</td><td>Unique identifier for the sold-to account</td></tr><tr><td>address_1</td><td>string</td><td>Yes</td><td>Primary address line</td></tr><tr><td>address_2</td><td>string</td><td>No</td><td>Secondary address line, can be empty</td></tr><tr><td>alternate_name</td><td>string</td><td>No</td><td>Alternate name</td></tr><tr><td>city</td><td>string</td><td>Yes</td><td>City name</td></tr><tr><td>country</td><td>string</td><td>Yes</td><td>Two-letter country code (ISO 3166-1 alpha-2)</td></tr><tr><td>postal_code</td><td>string</td><td>Yes</td><td>Postal/ZIP code</td></tr><tr><td>company_name</td><td>string</td><td>No</td><td>Business or company name, can be empty</td></tr><tr><td>first_name</td><td>string</td><td>Yes</td><td>Customer's first name</td></tr><tr><td>last_name</td><td>string</td><td>Yes</td><td>Customer's last name</td></tr><tr><td>phone</td><td>string</td><td>No</td><td>Phone number with optional formatting</td></tr><tr><td>ship_to_accounts</td><td>array</td><td>yes</td><td>this array can be empty. the array should contain objects</td></tr><tr><td>state_region</td><td>string</td><td>yes</td><td>State/province/region code</td></tr></tbody></table>

{% tabs %}
{% tab title="200" %}
**`200 Successful response example`**

```json
{
  "sold_to_account": {
    "account_number": "123",
    "address_1": "448 Test Street",
    "address_2": "",
    "alternate_name": "ATTN",
    "city": "Lawrence",
    "company_name": "",
    "country": "US",
    "created_at": "2022-10-31T01:54:56.271Z",
    "first_name": "John",
    "id": 12345,
    "last_name": "Doe",
    "phone": "(770) 210-4897",
    "postal_code": "66049",
    "ship_to_accounts": [
      {
        "account_number": "123_sh",
        "address_1": "448 Test Street",
        "address_2": "",
        "alternate_name": "ATTN",
        "city": "s",
        "company_name": "",
        "country": "US",
        "created_at": "2022-10-31T01:54:56.271Z",
        "email": "test@test.com",
        "first_name": "John",
        "id": 12345,
        "last_name": "Doe",
        "phone": "(770) 210-4897",
        "postal_code": "66049",
        "sold_to_account_number": "123",
        "state_region": "KS",
        "updated_at": "2022-10-31T01:54:56.271Z"
      }
    ],
    "state_region": "KS",
    "updated_at": "2022-10-31T01:54:56.271Z"
  }
}
```

{% endtab %}

{% tab title="401 " %}
**`401 Unauthorized`**

`The client doesn’t have correct authentication credentials.`

```
{
"errors": "[API] Invalid API key or secret (unrecognized login or wrong password)"
}
```

{% endtab %}

{% tab title="403" %}
**`403 Forbidden`**

`The server is refusing to respond. This is typically caused by incorrect access.`
{% endtab %}

{% tab title="404" %}
**`404 Not Found`**

`The requested resource was not found but could be available again in the future.`
{% endtab %}

{% tab title="422" %}
**`422 Unprocessable Entity`**
{% endtab %}

{% tab title="5xx" %}
**`5xx Errors`**

`An internal error occurred in VU Admin.`
{% endtab %}
{% endtabs %}
