# Enable a metafield

URL: https://docs.sparklayer.io/ignite/api/enable-a-metafield
Operation: `POST /v1/{siteEnv}/{siteId}/metafield-configuration/enable` (operationId `enableMetafield`)
OpenAPI spec: https://docs.sparklayer.io/openapi/ignite.yaml

Enables the specified key within the platform

`POST /v1/{siteEnv}/{siteId}/metafield-configuration/enable`

> This is an Ignite endpoint: your integration service implements it and SparkLayer calls it.

### Request SparkLayer sends

```http
POST /v1/live/bobs-store/metafield-configuration/enable HTTP/1.1
Host: ignite.example.com
Content-Type: application/json

{
  "key": "customer.accounting_id",
  "name": "<name>"
}
```

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `siteEnv` | string | Yes | The SparkLayer environment the request is for, such as `live`. Store it, with the site ID, when SparkLayer connects your platform. Example: `live` |
| `siteId` | string | Yes | The SparkLayer site ID the request is for, such as `bobs-store`. Store it, with the environment, when SparkLayer connects your platform. Length: min 1. Example: `bobs-store` |

### Request body (`application/json`) (required)

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | "customer.accounting_id" \| "customer.available_shipping_addresses_ids" \| "customer.billing_address_id" \| "customer.shipping_address_id" \| "customer.company_name" \| "customer.discount_percentage" \| "customer.payment_on_account" \| "customer.parent_customer_id" \| "customer.price_lists" \| "customer.sales_agent_groups" \| "product_variant.max_order_parent_quantity" \| "product_variant.max_order_quantity" \| "product_variant.min_order_parent_quantity" \| "product_variant.min_order_quantity" \| "product_variant.min_stock_level" \| "product_variant.pack_size" \| "product_variant.reserve_stock_quantity" \| "product_variant.restock_date" \| "product_variant.rrp" \| "product_variant.settings" \| "product_variant.stock_location_data" | Yes | |
| `name` | string | Yes | The readable name for the metafield |

```json
{
  "key": "customer.accounting_id",
  "name": "<name>"
}
```

### Responses your service returns

#### 204: Successful operation

#### 400: Error handling request such as an unsupported key

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `error_code` | "metafield-key-unsupported-by-platform" | | Machine-readable error code |

```json
{
  "error_code": "metafield-key-unsupported-by-platform"
}
```

#### 404: Not found

#### 500: System exception
