# SetPlacementTargets

> Replace the products and collections a discount placement targets. Write access, discounts toolset, MCP tool set_placement_targets.

**Access:** [Write](https://developer.missin.co.uk/get-started/authentication.md#access-levels)

## Variables

| Variable | Type | Required | Accepts | Description |
|---|---|---|---|---|
| `input` | `SetPlacementTargetsInput!` | yes | Input object, below |  |

## Input types

### SetPlacementTargetsInput

| Field | Type | Required | Accepts | Description |
|---|---|---|---|---|
| `connectionId` | `UUID!` | yes |  | Must name the placement's own connection — the one its targets narrow. |
| `placementId` | `UUID!` | yes |  |  |
| `targets` | `[PlacementTargetBindInput!]!` | yes | Input object, below. at most 1000 items | Replaces the placement's set wholesale. Empty means whole-store. |

### PlacementTargetBindInput

| Field | Type | Required | Accepts | Description |
|---|---|---|---|---|
| `externalId` | `String!` | yes | 1 to 512 characters | The provider's own id for the object, in its own namespace. |
| `snapshot` | `JSON` | no | Object, fields below | Title/price captured at bind time, so a chip renders without a live API call. |
| `targetType` | `PlacementTargetType!` | yes | One of `COLLECTION`, `PRICE`, `PRODUCT` |  |
| `valueAmount` | `Float` | no | 0 to 5000 | Amount in this connection's currency. Null inherits the discount's declared value. |

#### `PlacementTargetBindInput.snapshot`

| Field | Type | Required | Accepts | Description |
|---|---|---|---|---|
| `title` | string | yes | at most 512 characters |  |
| `subtitle` | string | no | at most 512 characters |  |
| `amount` | number | no |  |  |
| `currencyCode` | string | no | exactly 3 characters |  |

## Call it

```bash curl
curl https://api.missin.co.uk/graphql/v1 \
  -H "Authorization: Bearer $MISSIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"operationName":"SetPlacementTargets","variables":{"input":{"connectionId":"00000000-0000-0000-0000-000000000000","placementId":"00000000-0000-0000-0000-000000000000","targets":[]}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"fac7d43d643abcc132fda548aaefb1d44dfd38c87d65ffa5a313d2643e257a9d"}}}'
```

## Document

```graphql
mutation SetPlacementTargets($input: SetPlacementTargetsInput!) { __typename setPlacementTargets(input: $input) { __typename placementId targetCount userErrors { __typename code field message } } }
```

Source: https://developer.missin.co.uk/reference/discounts/set-placement-targets
