# subscriptions.merges.decide

Merge suggested duplicate plans, or keep them separate so they are not suggested again, for one group or many at once. Requires each group's expectedRevision and an idempotencyKey. Changes no accounting entries and can be undone.

`POST /api/v1/accounting/subscriptions.merges.decide`

Permissions: `accounting:read`, `accounting:write` · Roles: admin, finance · Idempotency key required

MCP tool: `accounting_subscriptions_merges_decide`

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `decision` | enum | Yes | What you decided. One of: `merge`, `dismiss`. |
| `groups` | array of objects | Yes | 1–50 items. |
| `groups[].id` | string (ID) or null | Yes | The record's ID. |
| `groups[].currency` | string | Yes | Three-letter currency code, such as CAD or USD. |
| `groups[].memberKeys` | array of strings | Yes | 2–20 items; each 1–120 characters; each Matches ^[a-z0-9 ]+$. |
| `groups[].expectedRevision` | integer | Yes | The record's current revision, from the last time you read it. If someone changed the record since, the request is refused with a conflict so you can reload and check before trying again. 0 to 9007199254740991. |
| `idempotencyKey` | string | Yes | Any unique text you generate once per intended change, so a retried request only happens once. Send it as the Idempotency-Key header instead if you prefer; if you send both they must match. 8–200 characters. |

## Example request

```bash
curl https://app.getoatmilk.com/api/v1/accounting/subscriptions.merges.decide \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "decision": "merge",
  "groups": [
    {
      "id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
      "currency": "CAD",
      "memberKeys": [
        "example",
        "example"
      ],
      "expectedRevision": 3
    }
  ]
}'
```

Reference page: https://app.getoatmilk.com/docs/api/subscriptions.merges.decide
