> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# customsCodeSettingsUpdate

> Turn the store's custom customs code on or off. It runs for checkout duty quotes and outbound customs forms. Turning it on runs the code already deployed for the store, so there is nothing to pass but `enabled`; it fails with BAD_USER_INPUT (400) when no code is deployed. Turning it off keeps the code. The change is audited as an API edit, as in the app. Returns the settings after the change. Not found when the store doesn't have custom customs code available.

**Required scopes:** [`returns_write`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-returns_write)

## Arguments

**enabled** `Boolean!` *required*

true to run the deployed code, false to stop running it.

## Returns

**customsCodeSettingsUpdate** `[CustomsCodeSettings!](/docs/api-reference/v3/reference/returns/customs-code-settings)` *required*

Whether the store's custom customs code runs. The code reshapes the line items used for duty quotes at checkout and for outbound customs forms. It is written in the Redo app; the API only turns it on or off and never returns its source.

**fields**

**codeAvailable** `Boolean!` *required*

Whether the store has usable code deployed that `enabled` can turn on. When false, turning it on fails.

**deployedArtifactId** `String`

The id of the deployed code. Null when none is deployed.

**deployedAt** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

When the deployed code went live. Null when none is deployed.

**deployedContract** `String`

The customs contract version the deployed code is written against. Null when none is deployed.

**enabled** `Boolean!` *required*

Whether the code is turned on in the store's settings. It only runs when `running` is also true.

**productMetafieldKeys** `[String!]!` *required*

Product metafield keys the code can read as `item.productMetafields`.

**running** `Boolean!` *required*

Whether customs is running the store's code right now: it is `enabled` and usable code is deployed. When false, customs uses the line items as they are.

**variantMetafieldKeys** `[String!]!` *required*

Variant metafield keys the code can read as `item.variantMetafields`.

## Example

```graphql theme={null}
mutation {
  customsCodeSettingsUpdate(enabled: true) {
    codeAvailable
    deployedArtifactId
    deployedAt
    deployedContract
    enabled
    productMetafieldKeys
    running
    variantMetafieldKeys
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.