---
title: "Create User Address"
description: "Use POST /users/{user_id}/addresses to create an address for a user. The current public operation is Address.register."
canonical: https://docs.ordering.co/api-reference/guides/add-user-address/
---

# Create User Address

> **API operation:** [Open the endpoint in the API reference](https://docs.ordering.co/api-reference/#tag/users/POST/users/{user_id}/addresses)

Use `POST /users/{user_id}/addresses` to create an address for a user. The current public operation is `Address.register`.

If available, the operation requires authentication. Administrators and agents can act for another user; other authenticated callers must match `user_id`. The operation derives the user to store from the route. When `default` is true, existing addresses for that user are cleared as the default.

```javascript
const response = await ordering.users(userId).addresses(addressData).save();
```

This SDK syntax may vary by package version; confirm the package and version before using it. See [User address model](https://docs.ordering.co/api-reference/guides/addresses-model/) for representative fields.

## OpenAPI reference

**Operation:** `POST /users/{user_id}/addresses`

**Path parameters**

| Name      | Type    | Required | Description |
| --------- | ------- | -------- | ----------- |
| `user_id` | integer | Yes      | —           |

**Header parameters**

| Name            | Type   | Required | Description |
| --------------- | ------ | -------- | ----------- |
| `X-Socket-Id-X` | string | No       | —           |

**Request body fields**

| Name              | Type    | Required |
| ----------------- | ------- | -------- |
| `address`         | any     | No       |
| `address_notes`   | any     | No       |
| `cellphone`       | any     | No       |
| `city`            | any     | No       |
| `country`         | any     | No       |
| `country_code`    | any     | No       |
| `default`         | boolean | No       |
| `external_id`     | any     | No       |
| `internal_number` | any     | No       |
| `lastname`        | any     | No       |
| `locality`        | any     | No       |
| `location`        | string  | No       |
| `middle_name`     | any     | No       |
| `name`            | any     | No       |
| `neighborhood`    | any     | No       |
| `phone`           | any     | No       |
| `route`           | any     | No       |
| `second_lastname` | any     | No       |
| `state`           | any     | No       |
| `state_code`      | any     | No       |
| `street_number`   | any     | No       |
| `sublocality`     | any     | No       |
| `user_id`         | number  | Yes      |
| `zipcode`         | any     | No       |

**Responses**

| Code | Description                           |
| ---- | ------------------------------------- |
| 200  | OK (Envelope)                         |
| 400  | Bad Request (ErrorResponse)           |
| 401  | Unauthorized                          |
| 404  | Not Found                             |
| 429  | Too Many Requests (ErrorResponse)     |
| 500  | Internal Server Error (ErrorResponse) |
| 503  | Service Unavailable (ErrorResponse)   |

[Open this operation in the API reference](https://docs.ordering.co/api-reference/#tag/users/POST/users/{user_id}/addresses)
