# Update a client

> `PUT https://api.kustom.co/elements/v1/clients/{clientId}`

Updates client details while enforcing merchant ownership.

## Parameters

- `clientId` (string, path, required) — Client identifier

## Request body

`application/json`

- `id` (string) — Unique identifier for the client.
- `merchant_id` (string) — The ID of the merchant that owns the client.
- `allowed_origins[]` (array<string>) — Browser origins permitted to use this client.
- `name` (string) — Friendly name shown in the portal.
- `placements[]` (array<object>) — Placements configured for this client.
  - `key` (string) — Placement key configured for the client.
  - `custom_styles` (string) — Optional CSS that will be injected into the placement container.
  - `content[]` (array<object>) — Information required to render the placement.
    - `type` (string) — Type of placement content. Enum: `PAYMENT_METHOD`, `EXTERNAL_PAYMENT_METHOD`, `DELIVERY_CARRIER`, `EXPRESS_CHECKOUT`.
    - `name` (string) — The name of the content. Enum: `STRIPE_PUBLIC_API_KEY`, `STRIPE_ACCOUNT_ID`, `NONE`.
    - `value` (string) — The value of the content.
    - `imageUrl` (string) — The URL for the image to be rendered.
  - `express_config` (object) — Payload used by the backoffice portal to create an API client.
    - `push_url` (string, required) — URL that will be used for push notification when an order is completed. Should be different than checkout and confirmation URLs. (max 2000 characters)
      Example: "https://merchant.com/push"
    - `validation_url` (string) — URL that will be requested for final merchant validation. (must be https, max 2000 characters)
      Example: "https://merchant.com/validation"
    - `confirmation_url` (string, required) — URL of the merchant confirmation page. The consumer will be redirected back to the confirmation page if the authorization is successful after the customer clicks on the ‘Place Order’ button inside checkout. The special characters of the confirmation URL should be encoded, e.g. the "space" character should be written as "%20". Then, on top of that, the whole confirmation URL should be encoded. E.g. the "space" character should become "%2520". (max 2000 characters)
      Example: "https://merchant.com/confirmation.html"
    - `payment_methods[]` (array<object>) — An ordered list of payment methods and how they should be offered in the express checkout.
      - `method` (string) Enum: `AMAZON_PAY`, `APPLE_PAY`, `GOOGLE_PAY`, `KLARNA`, `PAYPAL`, `UNKNOWN`.
      - `provider` (string) Enum: `STRIPE`, `PAYPAL`.
- `created_at` (string) — Time when the client was created.
- `updated_at` (string) — Time when the client was last updated.

### Example request

```json
{
  "id": "<string>",
  "merchant_id": "<string>",
  "allowed_origins": [
    "<uri>"
  ],
  "name": "<string>",
  "placements": [
    {
      "key": "AVAILABLE_PAYMENT_METHODS",
      "custom_styles": ".hero { background: #000; }",
      "content": [
        {
          "type": "PAYMENT_METHOD",
          "name": "STRIPE_PUBLIC_API_KEY",
          "value": "MASTERCARD_DEBIT",
          "imageUrl": "https://cdn.ingrid.com/static/shipping-logos/logo-postnord-round-30.svg"
        }
      ],
      "express_config": {
        "push_url": "https://www.example.com/api/push",
        "validation_url": "https://www.example.com/api/validation",
        "confirmation_url": "https://www.example.com/confirmation.html",
        "payment_methods": [
          {
            "method": "AMAZON_PAY",
            "provider": "STRIPE"
          }
        ]
      }
    }
  ],
  "created_at": "<date-time>",
  "updated_at": "<date-time>"
}
```

## Responses

### 200

OK

`application/json`

- `id` (string) — Unique identifier for the client.
- `merchant_id` (string) — The ID of the merchant that owns the client.
- `allowed_origins[]` (array<string>) — Browser origins permitted to use this client.
- `name` (string) — Friendly name shown in the portal.
- `placements[]` (array<object>) — Placements configured for this client.
  - `key` (string) — Placement key configured for the client.
  - `custom_styles` (string) — Optional CSS that will be injected into the placement container.
  - `content[]` (array<object>) — Information required to render the placement.
    - `type` (string) — Type of placement content. Enum: `PAYMENT_METHOD`, `EXTERNAL_PAYMENT_METHOD`, `DELIVERY_CARRIER`, `EXPRESS_CHECKOUT`.
    - `name` (string) — The name of the content. Enum: `STRIPE_PUBLIC_API_KEY`, `STRIPE_ACCOUNT_ID`, `NONE`.
    - `value` (string) — The value of the content.
    - `imageUrl` (string) — The URL for the image to be rendered.
  - `express_config` (object) — Payload used by the backoffice portal to create an API client.
    - `push_url` (string, required) — URL that will be used for push notification when an order is completed. Should be different than checkout and confirmation URLs. (max 2000 characters)
      Example: "https://merchant.com/push"
    - `validation_url` (string) — URL that will be requested for final merchant validation. (must be https, max 2000 characters)
      Example: "https://merchant.com/validation"
    - `confirmation_url` (string, required) — URL of the merchant confirmation page. The consumer will be redirected back to the confirmation page if the authorization is successful after the customer clicks on the ‘Place Order’ button inside checkout. The special characters of the confirmation URL should be encoded, e.g. the "space" character should be written as "%20". Then, on top of that, the whole confirmation URL should be encoded. E.g. the "space" character should become "%2520". (max 2000 characters)
      Example: "https://merchant.com/confirmation.html"
    - `payment_methods[]` (array<object>) — An ordered list of payment methods and how they should be offered in the express checkout.
      - `method` (string) Enum: `AMAZON_PAY`, `APPLE_PAY`, `GOOGLE_PAY`, `KLARNA`, `PAYPAL`, `UNKNOWN`.
      - `provider` (string) Enum: `STRIPE`, `PAYPAL`.
- `created_at` (string) — Time when the client was created.
- `updated_at` (string) — Time when the client was last updated.

```json
{
  "id": "<string>",
  "merchant_id": "<string>",
  "allowed_origins": [
    "<uri>"
  ],
  "name": "<string>",
  "placements": [
    {
      "key": "AVAILABLE_PAYMENT_METHODS",
      "custom_styles": ".hero { background: #000; }",
      "content": [
        {
          "type": "PAYMENT_METHOD",
          "name": "STRIPE_PUBLIC_API_KEY",
          "value": "MASTERCARD_DEBIT",
          "imageUrl": "https://cdn.ingrid.com/static/shipping-logos/logo-postnord-round-30.svg"
        }
      ],
      "express_config": {
        "push_url": "https://www.example.com/api/push",
        "validation_url": "https://www.example.com/api/validation",
        "confirmation_url": "https://www.example.com/confirmation.html",
        "payment_methods": [
          {
            "method": "AMAZON_PAY",
            "provider": "STRIPE"
          }
        ]
      }
    }
  ],
  "created_at": "<date-time>",
  "updated_at": "<date-time>"
}
```

### 400

Bad Request

`*/*`

- `message` (string)
- `additional_context` (object)
  - `key` (string) — Any additional property. The key is free-form; the value has this shape.
- `code` (string) Enum: `CLIENT_NOT_FOUND`, `ORIGIN_NOT_ALLOWED`, `HTTP_CLIENT_ERROR`, `HTTP_SERVER_ERROR`, `DOMAIN_NOT_WHITELISTED`, `PLACEMENT_CONFIG_MISSING`, `ARGUMENT_NOT_VALID`, `CONSTRAINT_VIOLATION`, `PROFILE_DOESNT_BELONG_TO_MERCHANT`, `MERCHANT_NOT_FOUND`.

```json
{
  "message": "<string>",
  "additional_context": {
    "key": "<string>"
  },
  "code": "CLIENT_NOT_FOUND"
}
```

### 401

Unauthorized

`*/*`

- `message` (string)
- `additional_context` (object)
  - `key` (string) — Any additional property. The key is free-form; the value has this shape.
- `code` (string) Enum: `CLIENT_NOT_FOUND`, `ORIGIN_NOT_ALLOWED`, `HTTP_CLIENT_ERROR`, `HTTP_SERVER_ERROR`, `DOMAIN_NOT_WHITELISTED`, `PLACEMENT_CONFIG_MISSING`, `ARGUMENT_NOT_VALID`, `CONSTRAINT_VIOLATION`, `PROFILE_DOESNT_BELONG_TO_MERCHANT`, `MERCHANT_NOT_FOUND`.

```json
{
  "message": "<string>",
  "additional_context": {
    "key": "<string>"
  },
  "code": "CLIENT_NOT_FOUND"
}
```

### 502

Bad Gateway

`*/*`

- `message` (string)
- `additional_context` (object)
  - `key` (string) — Any additional property. The key is free-form; the value has this shape.
- `code` (string) Enum: `CLIENT_NOT_FOUND`, `ORIGIN_NOT_ALLOWED`, `HTTP_CLIENT_ERROR`, `HTTP_SERVER_ERROR`, `DOMAIN_NOT_WHITELISTED`, `PLACEMENT_CONFIG_MISSING`, `ARGUMENT_NOT_VALID`, `CONSTRAINT_VIOLATION`, `PROFILE_DOESNT_BELONG_TO_MERCHANT`, `MERCHANT_NOT_FOUND`.

```json
{
  "message": "<string>",
  "additional_context": {
    "key": "<string>"
  },
  "code": "CLIENT_NOT_FOUND"
}
```
