---
title: "Create Address Metafield"
description: "Use POST /users/{user_id}/addresses/{address_id}/metafields to create a metafield on a user's address."
canonical: https://docs.ordering.co/api-reference/guides/create-address-metafield/
---

# Create Address Metafield

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

Use `POST /users/{user_id}/addresses/{address_id}/metafields` to create a metafield on a user's address. The current public operation is `AddressMetafield.register`.

If available, the operation requires authentication. A non-administrator can act only when `user_id` identifies the authenticated user, and the operation verifies that `address_id` belongs to that user. Metafield keys are validated per address, and `value_type` accepts `integer`, `decimal`, `boolean`, `text`, or `json` .

Metafield keys are validated dynamically for each address. See [Extra attributes (Metafields)](https://docs.ordering.co/api-reference/guides/extra-attributes/) for shared field concepts.

## OpenAPI reference

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

**Path parameters**

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

**Request body fields**

| Name         | Type    | Required |
| ------------ | ------- | -------- |
| `model`      | any     | Yes      |
| `object_id`  | integer | Yes      |
| `value`      | any     | Yes      |
| `value_type` | string  | Yes      |

**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/{address_id}/metafields)
