---
updatedAt: 2026-06-15T16:48:40.000Z
agentTools:
  siteIndex: https://developers.pismo.io/llms.txt
  projectIndex: https://developers.pismo.io/pismo-docs/llms.txt
---

# Update deposit account attachment overrides

Partially updates `deposit_configs.maturity_period`, `deposit_configs.overrides` and `deposit_configs.interest_capitalization_mode` on an active deposit account attachment. The `overrides` fields are processed using three‑state `PATCH` semantics, allowing values to be added, changed, or cleared as part of the update.
  * **Omitted**: Keeps the current value
  * `null`: Removes the override; falls back through the cascade (program → product)
  * **Value**: Replaces the current override with the supplied value

**NOTES**:

* At least one of `deposit_configs.maturity_period`, `deposit_configs.overrides` or `deposit_configs.interest_capitalization_mode` must be provided. A payload carrying only `maturity_period` is valid.
* The `overrides` envelope, if provided, must contain at least one field. Sending an empty object returns `400 EIBACC0315`.
* `renewal_term` still requires `ROLLOVER` configured in `maturity_instructions` somewhere in the fallback sequence (`400 EIBACC0310` otherwise).
* `maturity_period` changes the term **in force** and takes effect immediately, recalculating the current cycle's maturity date from the attachment's `effective_date`. It's accepted in both documented forms (`unit`+`value` or `calendar_maturity_date`) and doesn't follow the three-state semantics above: `null` is a no-op, not a removal.
* `maturity_period` and `overrides.renewal_term` are independent. `renewal_term` keeps applying at rollover only and never recalculates the current cycle's maturity date.
* When `maturity_period` changes, the schedules driven by the maturity date (maturity instruction, maturity notices) are re-evaluated against the new date.
* `product_id` and `payout_account` stay fixed after attach and are ignored if included in the request body. To change the payout account, use [Update payout account for deposit account](ref:interest-bearing-v1-deposit-update-payout-account).

This endpoint generates an [Account attachment updated](https://developers.pismo.io/events/docs/deposit-product-account-attachment-updated-1) event that includes the active term in `data.maturity_period`. If the account has an external account ID, the event also includes it in `data.external_account_id`.

The response returns `external_account_id` whenever the account has one; it is omitted for an account with no external identifier.


# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Banking - Interest-bearing accounts",
    "version": "1.0.0",
    "description": "API for interest-bearing account functionality",
    "contact": {
      "name": "API Support",
      "url": "https://developers.pismo.io/support/"
    },
    "license": {
      "name": "Copyright Pismo"
    }
  },
  "servers": [
    {
      "url": "https://sandbox.pismolabs.io/savings-products",
      "description": "Sandbox API server for testing"
    }
  ],
  "tags": [
    {
      "name": "Account attachment",
      "description": "Endpoints that manage account attachments to interest-bearing account products"
    }
  ],
  "components": {
    "parameters": {
      "accountIdentifier": {
        "description": "Account ID. Accepts either the Pismo `account_id` or your `external_account_id`. Send the same ID used to generate the access token.\n",
        "in": "path",
        "name": "accountId",
        "required": true,
        "schema": {
          "type": "string",
          "maxLength": 60
        },
        "example": "123456"
      }
    },
    "schemas": {
      "ExternalAccountId": {
        "type": "string",
        "description": "External account ID. Returned only when the account has an external account identifier.",
        "example": "ext-acct-001"
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Error type code",
            "example": "EIBACC0003"
          },
          "details": {
            "type": "string",
            "description": "Error details",
            "example": "error EIBACC0008: Validation error [(Field 'Order' is invalid)]"
          },
          "message": {
            "description": "Error message",
            "example": "Bad Request",
            "type": "string"
          }
        }
      },
      "PayoutAccount": {
        "type": "object",
        "description": "The payout account defines where outbound payments are sent, and it is used in two operational contexts.<br>\n\n* **Capitalization flow**: When the capitalization mode is set to `PAYOUT`, the capitalized interest is directed to this account. If the mode is `REINVEST`, the payout account is not involved because the interest is added to the principal instead.\n* **Maturity instruction flow**: At maturity, this account receives principal or interest whenever the maturity instructions specify `PAY` for either `maturity_instructions.principal` or `maturity_instructions.interest`. This flow always relies on the payout account, regardless of how capitalization is configured.\n\nBoth flows reference the same payout account settings. Choosing `REINVEST` for capitalization does not remove or disable the payout account, and it remains fully available for maturity‑related payments.\n",
        "properties": {
          "label": {
            "type": "string",
            "description": "Label to identify the account\n",
            "example": "My payout account"
          },
          "type": {
            "type": "string",
            "description": "Payout account type, either `INTERNAL` or `EXTERNAL`\n",
            "enum": [
              "INTERNAL",
              "EXTERNAL"
            ],
            "example": "INTERNAL"
          },
          "internal_account_id": {
            "type": "number",
            "description": "Internal account ID for the account that receives the payments.\nRequired for type `INTERNAL` and not allowed for `EXTERNAL`.\n",
            "example": 123456
          },
          "external_account": {
            "type": "object",
            "description": "Contains user-defined key-value pairs that identify the external account receiving the payments.\nNote that external account information is client-provided.\n\nRequired for type `EXTERNAL` and not allowed for `INTERNAL`.\n",
            "example": {
              "key": "value"
            }
          }
        }
      },
      "MaturityPeriod": {
        "type": "object",
        "description": "Defines when the deposit matures. There are three usage modes:\n\n* **Relative period**: Sends `unit` + `value` (e.g. `MONTHS` + `6`).\n* **Explicit date**: Sends `calendar_maturity_date` (e.g. `2027-06-15`).\n* **Default**: Omits the field or sends `{}`. The product's configured default maturity term (`PRODUCT_DEFAULT_MATURITY_DATE_DAYS`, typically `10950` days ≈ 30 years) is applied.\n\n**NOTE**: `calendar_maturity_date` and `unit`/`value` are mutually exclusive, sending both in the same request returns a `400` validation error.\n\nIn the **attach** endpoints, the response returns exactly what was sent in the request:\n* Send `unit` + `value` returns `unit` + `value`\n* Send `calendar_maturity_date` returns `calendar_maturity_date`\n* Send nothing (default fallback applied) returns `unit=DAYS` and `value` equal to the product's configured `PRODUCT_DEFAULT_MATURITY_DATE_DAYS`\n\n**NOTE**: this behavior applies only to attach. The `GET` attachment endpoints and `PATCH /v1/deposits/accounts/{accountId}/attachment` return the resolved term, with `unit`, `value`, and `calendar_maturity_date` populated together. A `PATCH` sent in explicit‑date form is returned normalized as `{unit: DAYS, value: <days>, calendar_maturity_date: <date>}`.\n",
        "properties": {
          "unit": {
            "$ref": "#/components/schemas/MaturityPeriodUnit"
          },
          "value": {
            "$ref": "#/components/schemas/MaturityPeriodValue"
          },
          "calendar_maturity_date": {
            "$ref": "#/components/schemas/CalendarMaturityDate"
          }
        }
      },
      "MaturityPeriodUnit": {
        "type": "string",
        "description": "Time unit for the relative maturity period. It's used together with `value` and cannot coincide with `calendar_maturity_date`.\n\n- `DAYS`: Uses `value` directly. Example: `value=90` → 90 days.\n- `WEEKS`: Multiplies `value` by 7. Example: `value=4` → 28 days.\n- `MONTHS`: Calculates calendar-month with end-of-month (EOM) clamping when the target day does not exist. The maturity date falls on the same day of the month as the start date. Example: `2026-09-22` + 3 months = `2026-12-22`; `2024-01-31` + 1 month = `2024-02-29` (leap year) or `2025-02-28` (non-leap year).\n- `YEARS`: Calculates calendar-year, for example: `2024-02-29` + 1 year = `2025-02-28`. Note that there is no Feb 29 in 2025.\n\nFor `WEEKS`, `MONTHS`, and `YEARS`, the resulting calendar date is converted back to a day count to validate against the product's configured minimum or maximum term.\n",
        "enum": [
          "DAYS",
          "WEEKS",
          "MONTHS",
          "YEARS"
        ],
        "example": "MONTHS"
      },
      "MaturityPeriodValue": {
        "type": "integer",
        "description": "Number of time units until maturity. Must be greater than `0`. Mutually exclusive with `calendar_maturity_date`.\n",
        "minimum": 1,
        "example": 6
      },
      "CalendarMaturityDate": {
        "type": "string",
        "format": "date",
        "description": "Maturity date. Format is `YYYY-MM-DD`. The date must be a future date.\n\nThis date cannot coincide with `unit`/`value`, sending both in the same request returns a `400` validation error.\n",
        "example": "2027-06-15"
      },
      "MaturityInstructionsOverrideRequest": {
        "type": "object",
        "description": "Overrides the deposit’s behavior at maturity. If a field is omitted, the Pismo platform uses the value defined at the higher‑level configuration that governs this deposit.\n",
        "properties": {
          "principal": {
            "type": "string",
            "enum": [
              "ROLLOVER",
              "PAY"
            ],
            "description": "Specifies how the principal is handled once the deposit matures.",
            "example": "ROLLOVER"
          },
          "interest": {
            "type": "string",
            "enum": [
              "ROLLOVER",
              "PAY"
            ],
            "description": "Specifies how the interest is handled once the deposit matures.",
            "example": "PAY"
          },
          "reason": {
            "type": "string",
            "maxLength": 100,
            "description": "Optional audit-trail reason.",
            "example": "Customer preference at onboarding"
          }
        }
      },
      "RenewalTermOverrideRequest": {
        "type": "object",
        "description": "Specifies the recurring rollover term, not to be confused with the initial `maturity_period`.\n\nYou must provide either `unit` with `value` or `renewal_calendar_maturity_date`.\n\nA `ROLLOVER` configuration in principal or interest is required.\n\nWhen you pass `renewal_calendar_maturity_date`, the Pismo platform converts the interval from today into a day count and stores it at attach time in normalized form: `{unit: DAYS, value: <calculated>}`.\n",
        "properties": {
          "unit": {
            "type": "string",
            "enum": [
              "DAYS",
              "WEEKS",
              "MONTHS",
              "YEARS"
            ],
            "description": "Time unit of the renewal term. Required together with `value` when calendar form is not used.",
            "example": "MONTHS"
          },
          "value": {
            "type": "integer",
            "minimum": 1,
            "description": "Number of units. Required together with `unit` when calendar form is not used.",
            "example": 6
          },
          "renewal_calendar_maturity_date": {
            "type": "string",
            "format": "date",
            "description": "Explicit calendar date (`YYYY-MM-DD`), the date must be a future date, and does not coincide with `unit`+`value`.",
            "example": "2027-05-22"
          }
        }
      },
      "GracePeriodOverrideRequest": {
        "type": "object",
        "description": "Grace period override. Type-specific fields are optional pointers, when omitted, the Pismo platform follows the normal fallback sequence, moving from the account level to the program and then to the product defaults.",
        "required": [
          "waived"
        ],
        "properties": {
          "waived": {
            "type": "boolean",
            "description": "`true` = fully exempt; `false` = penalty active (customize via the fields below)."
          },
          "duration_days": {
            "type": "integer",
            "minimum": 0
          },
          "penalty_interest_days": {
            "type": "integer",
            "minimum": 0
          },
          "valid_until": {
            "type": "string",
            "format": "date-time",
            "description": "Schedules the revert of this override via EventBridge. This value must be a future date and follows the ISO 8601 standard."
          }
        }
      },
      "EarlyWithdrawalAfterOpeningOverrideRequest": {
        "type": "object",
        "description": "Override for early withdrawal after account opening.",
        "required": [
          "waived"
        ],
        "properties": {
          "waived": {
            "type": "boolean"
          },
          "applicable_within_days": {
            "type": "integer",
            "minimum": 0
          },
          "penalty_interest_days": {
            "type": "integer",
            "minimum": 0
          },
          "valid_until": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WithdrawalFeeOverrideRequest": {
        "type": "object",
        "description": "Withdrawal fee override.",
        "required": [
          "waived"
        ],
        "properties": {
          "waived": {
            "type": "boolean"
          },
          "type": {
            "type": "string",
            "enum": [
              "PERCENTAGE",
              "FIXED"
            ]
          },
          "value": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Same format as the product's `withdrawal_fee.value`.",
            "example": 1.5
          },
          "valid_until": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TieredInterestForfeitureOverrideRequest": {
        "type": "object",
        "description": "Tiered interest forfeiture override. Tiers replace the product's tiers when provided.",
        "required": [
          "waived"
        ],
        "properties": {
          "waived": {
            "type": "boolean"
          },
          "tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TieredInterestForfeitureTierRequest"
            }
          },
          "valid_until": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TieredInterestForfeitureTierRequest": {
        "type": "object",
        "required": [
          "min_days_held",
          "forfeited_interest_days"
        ],
        "properties": {
          "min_days_held": {
            "type": "integer",
            "minimum": 0
          },
          "max_days_held": {
            "type": "integer",
            "minimum": 0,
            "description": "Optional. Open-ended tier when omitted."
          },
          "forfeited_interest_days": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "SubsequentWithdrawalsOverrideRequest": {
        "type": "object",
        "description": "Subsequent withdrawals (Regulation D) override.",
        "required": [
          "waived"
        ],
        "properties": {
          "waived": {
            "type": "boolean"
          },
          "applicable_within_days": {
            "type": "integer",
            "minimum": 1
          },
          "penalty_interest_days": {
            "type": "integer",
            "minimum": 1
          },
          "window_behavior": {
            "type": "string",
            "enum": [
              "ROLLING",
              "FIXED"
            ]
          },
          "valid_until": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AttachmentOverridesPatchRequest": {
        "type": "object",
        "description": "PATCH envelope for account‑level `deposit_configs.overrides`. Fields support three‑state semantics, omission preserves the current value, `null` removes the override and restores the inherited configuration, and a provided value replaces it. The envelope must define at least one field, an empty overrides object returns a `400` error: `EIBACC0315`.\n",
        "properties": {
          "maturity_instructions": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MaturityInstructionsOverrideRequest"
              }
            ]
          },
          "renewal_term": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RenewalTermOverrideRequest"
              }
            ]
          },
          "penalties": {
            "$ref": "#/components/schemas/PenaltiesPatchRequest"
          }
        }
      },
      "PenaltiesPatchRequest": {
        "type": "object",
        "description": "PATCH envelope for `deposit_configs.overrides.penalties`. Penalty types support three‑state semantics: omit to retain the existing value, use `null` to clear the override and restore the inherited configuration, or provide a value object to replace it. `reason` is optional metadata.\n",
        "properties": {
          "reason": {
            "type": "string",
            "maxLength": 100,
            "example": "Update — Q1 2027 VIP retention package"
          },
          "grace_period": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GracePeriodOverrideRequest"
              }
            ]
          },
          "early_withdrawal_after_opening": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EarlyWithdrawalAfterOpeningOverrideRequest"
              }
            ]
          },
          "withdrawal_fee": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WithdrawalFeeOverrideRequest"
              }
            ]
          },
          "tiered_interest_forfeiture": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TieredInterestForfeitureOverrideRequest"
              }
            ]
          },
          "subsequent_withdrawals": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SubsequentWithdrawalsOverrideRequest"
              }
            ]
          }
        }
      },
      "UpdateAccountAttachmentRequest": {
        "type": "object",
        "required": [
          "deposit_configs"
        ],
        "properties": {
          "deposit_configs": {
            "type": "object",
            "description": "At least one of `maturity_period`, `overrides` or `interest_capitalization_mode` must be provided.\n",
            "properties": {
              "maturity_period": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/MaturityPeriod"
                  }
                ],
                "description": "Defines the term currently in force and recalculates the cycle’s maturity date immediately. The update takes effect at once; it does not wait for the next cycle or rollover.\n\nAccepts the same mutually exclusive forms as the attach endpoint:\n  * **Relative period**: `unit` + `value` (for example, `MONTHS` + `18`)\n  * **Explicit date**: `calendar_maturity_date` (for example, `2026‑12‑31`)\n\n* **Anchor date**: the term is always recalculated from the attachment’s `effective_date`, exactly as at attach time. The `PATCH` execution date does not shift the cycle start date, it only updates the cycle end date. Because of this anchor, shortening a term on an attachment with an old `effective_date` can produce a maturity date that is already in the past, which is rejected.\n\n* **Maturity‑date boundary**: the resolved maturity date must be today or later. Any value that resolves to a past date returns `400 EIBACC0306`, regardless of form.\n\n* **Grace‑period behavior**: updates made during the grace‑period window apply immediately to the cycle that began on the first day of that window. They are never deferred to a later rollover.\n\n* **`null` and omission**: `maturity_period` represents the term itself, not an override. `null`, an empty object, or omission all leave the persisted term unchanged. Only an explicit value recalculates the term, so an incomplete payload cannot revert the term to the product default.\n\n* **Response shape**: the response returns the resolved term with unit, value, and `calendar_maturity_date` populated together. Requests sent in explicit‑date form are normalized to {`unit`: `DAYS`, `value`: `<days>`, `calendar_maturity_date`: `<date>`}.\n\nDo not confuse this field with `overrides.renewal_term`. `renewal_term` applies only at rollover and never recalculates the current cycle’s maturity date. Both fields are independent and might appear in the same request.\n"
              },
              "interest_capitalization_mode": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "PAYOUT",
                  "REINVEST",
                  null
                ],
                "description": "Updates how capitalized interest is treated on this attachment.<br>\n\n* `PAYOUT` (explicit): Switching to this mode requires the attachment to already have a valid `payout_account`. If none is configured, the request returns `400 EIBACC0379`—set the `payout_account` first via `PATCH /v1/deposits/accounts/{accountId}`, then switch to this mode.\n* `REINVEST`: The Pismo platform adds the capitalized amount to the principal. No `payout_account` is required.\n* `Omitted`: The current mode is left unchanged.\n* `null`: Clears the account‑level value and restores the inherited behavior from the program and then the product default. When the value is missing at all levels, the Pismo platform applies `REINVEST`.\n\nThis field applies only to the capitalization flow. The maturity instruction flow always uses `payout_account` regardless of the setting.\n",
                "example": "REINVEST"
              },
              "overrides": {
                "$ref": "#/components/schemas/AttachmentOverridesPatchRequest"
              }
            }
          }
        }
      },
      "AttachmentOverridesSnapshot": {
        "type": "object",
        "description": "Representation of the persisted overrides, present only when the request defined at least one override. Sub-fields are included only when set. The `renewal_term` always returns all three fields together (`unit`, `value` and `renewal_calendar_maturity_date`), mirroring the behavior of `maturity_period`.\n",
        "properties": {
          "maturity_instructions": {
            "$ref": "#/components/schemas/MaturityInstructionsOverrideRequest"
          },
          "renewal_term": {
            "$ref": "#/components/schemas/RenewalTermResponse"
          },
          "penalties": {
            "$ref": "#/components/schemas/PenaltiesOverrideSnapshot"
          }
        }
      },
      "RenewalTermResponse": {
        "type": "object",
        "description": "Renewal term applied on each rollover. Always returns all three fields together — `unit`, `value` and `renewal_calendar_maturity_date` — regardless of the form the client used to configure it, mirroring `maturity_period`. Legacy terms persisted before the calendar date was stored return only `unit`+`value`.\n",
        "properties": {
          "unit": {
            "type": "string",
            "enum": [
              "DAYS",
              "WEEKS",
              "MONTHS",
              "YEARS"
            ],
            "example": "MONTHS"
          },
          "value": {
            "type": "integer",
            "minimum": 1,
            "example": 6
          },
          "renewal_calendar_maturity_date": {
            "type": "string",
            "format": "date",
            "description": "Returned only when the request uses the calendar format. Format = `YYYY-MM-DD`.",
            "example": "2027-05-22"
          }
        }
      },
      "PenaltiesOverrideSnapshot": {
        "type": "object",
        "description": "Persisted penalty overrides for each type. Types appear only when set. Each entry includes `waived`, the relevant type-specific fields, and an optional `valid_until` for scheduling the revert.\n",
        "properties": {
          "reason": {
            "type": "string",
            "example": "Q4 2026 VIP retention package"
          },
          "grace_period": {
            "$ref": "#/components/schemas/GracePeriodOverrideRequest"
          },
          "early_withdrawal_after_opening": {
            "$ref": "#/components/schemas/EarlyWithdrawalAfterOpeningOverrideRequest"
          },
          "withdrawal_fee": {
            "$ref": "#/components/schemas/WithdrawalFeeOverrideRequest"
          },
          "tiered_interest_forfeiture": {
            "$ref": "#/components/schemas/TieredInterestForfeitureOverrideRequest"
          },
          "subsequent_withdrawals": {
            "$ref": "#/components/schemas/SubsequentWithdrawalsOverrideRequest"
          }
        }
      },
      "AccountAttachment": {
        "type": "object",
        "properties": {
          "product_type": {
            "type": "string",
            "description": "Product type.",
            "enum": [
              "deposit",
              "savings-account"
            ]
          },
          "product_id": {
            "type": "string",
            "description": "Product identifier.",
            "example": "2c336e9d-d04f-4fd0-8f6e-25808f48d70c"
          },
          "external_account_id": {
            "$ref": "#/components/schemas/ExternalAccountId"
          },
          "interest_plan_id": {
            "type": "string",
            "description": "Interest rate plan ID. This corresponds to the ID you created using the [Create interest plan version](ref:patch-v1-interest-plan)) endpoint.",
            "example": "263d509a-d5d0-4b3a-b909-ce1b9174beff"
          },
          "maturity_period": {
            "$ref": "#/components/schemas/MaturityPeriod"
          },
          "attachment_date": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp that indicates when the attachment was created (when the attach API call was made).\nThe datetime format follows the ISO 8601 standard `yyyy-mm-ddThh:mm:ss.sssZ`.\n",
            "example": "2024-01-23T13:26:25.000Z"
          },
          "effective_date": {
            "type": "string",
            "format": "date",
            "description": "The effective date of the attachment in `YYYY-MM-DD` format\nThis is the date when the attachment becomes valid. Maturity is calculated from this date.\nFor attachments created in the past, the date defaults to the value of `attachment_date`.\n",
            "example": "2025-12-01"
          },
          "fee_model_id": {
            "type": "string",
            "description": "Fee model identifier, if applicable.",
            "example": "fee-model-123"
          },
          "payout_account": {
            "$ref": "#/components/schemas/PayoutAccount"
          },
          "interest_capitalization_mode": {
            "type": "string",
            "enum": [
              "PAYOUT",
              "REINVEST"
            ],
            "description": "Present only when this account attachment explicitly defines `interest_capitalization_mode`. If the field is missing, the effective value is `REINVEST`, inherited from the program configuration or, if the program does not specify it, from the product’s default settings.\n",
            "example": "REINVEST"
          },
          "overrides": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AttachmentOverridesSnapshot"
              }
            ],
            "description": "Optional. Only returned when at least one override is configured for the attachment."
          },
          "accrual_model": {
            "type": "string",
            "description": "Accrual model inherited from the attached product. `DEPOSIT_BASIS` or `BALANCE_BASIS`.",
            "enum": [
              "DEPOSIT_BASIS",
              "BALANCE_BASIS"
            ],
            "default": "DEPOSIT_BASIS",
            "example": "DEPOSIT_BASIS"
          },
          "balance_type": {
            "type": "string",
            "description": "Balance type inherited from the attached product. Only meaningful when `accrual_model` is `BALANCE_BASIS`.",
            "enum": [
              "VALUE_DATED_BALANCE",
              "LEDGER_BALANCE"
            ],
            "default": "VALUE_DATED_BALANCE",
            "example": "VALUE_DATED_BALANCE"
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "paths": {
    "/v1/deposits/accounts/{accountId}/attachment": {
      "patch": {
        "tags": [
          "Account attachment"
        ],
        "summary": "Update deposit account attachment overrides",
        "description": "Partially updates `deposit_configs.maturity_period`, `deposit_configs.overrides` and `deposit_configs.interest_capitalization_mode` on an active deposit account attachment. The `overrides` fields are processed using three‑state `PATCH` semantics, allowing values to be added, changed, or cleared as part of the update.\n  * **Omitted**: Keeps the current value\n  * `null`: Removes the override; falls back through the cascade (program → product)\n  * **Value**: Replaces the current override with the supplied value\n\n**NOTES**:\n\n* At least one of `deposit_configs.maturity_period`, `deposit_configs.overrides` or `deposit_configs.interest_capitalization_mode` must be provided. A payload carrying only `maturity_period` is valid.\n* The `overrides` envelope, if provided, must contain at least one field. Sending an empty object returns `400 EIBACC0315`.\n* `renewal_term` still requires `ROLLOVER` configured in `maturity_instructions` somewhere in the fallback sequence (`400 EIBACC0310` otherwise).\n* `maturity_period` changes the term **in force** and takes effect immediately, recalculating the current cycle's maturity date from the attachment's `effective_date`. It's accepted in both documented forms (`unit`+`value` or `calendar_maturity_date`) and doesn't follow the three-state semantics above: `null` is a no-op, not a removal.\n* `maturity_period` and `overrides.renewal_term` are independent. `renewal_term` keeps applying at rollover only and never recalculates the current cycle's maturity date.\n* When `maturity_period` changes, the schedules driven by the maturity date (maturity instruction, maturity notices) are re-evaluated against the new date.\n* `product_id` and `payout_account` stay fixed after attach and are ignored if included in the request body. To change the payout account, use [Update payout account for deposit account](ref:interest-bearing-v1-deposit-update-payout-account).\n\nThis endpoint generates an [Account attachment updated](https://developers.pismo.io/events/docs/deposit-product-account-attachment-updated-1) event that includes the active term in `data.maturity_period`. If the account has an external account ID, the event also includes it in `data.external_account_id`.\n\nThe response returns `external_account_id` whenever the account has one; it is omitted for an account with no external identifier.\n",
        "operationId": "interest-bearing-v1-deposit-update-account-attachment",
        "parameters": [
          {
            "$ref": "#/components/parameters/accountIdentifier"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAccountAttachmentRequest"
              },
              "examples": {
                "maturityPeriodRelativeForm": {
                  "summary": "maturity_period — relative period (unit + value)",
                  "description": "Changes the term in force to 18 months counted from the attachment's `effective_date`. A payload carrying only `maturity_period` is valid.",
                  "value": {
                    "deposit_configs": {
                      "maturity_period": {
                        "unit": "MONTHS",
                        "value": 18
                      }
                    }
                  }
                },
                "maturityPeriodCalendarForm": {
                  "summary": "maturity_period — explicit date (calendar_maturity_date)",
                  "description": "Changes the term in force by setting the maturity date explicitly. Mutually exclusive with `unit`/`value`, sending both returns `400 EIBACC0307`.",
                  "value": {
                    "deposit_configs": {
                      "maturity_period": {
                        "calendar_maturity_date": "2026-12-31"
                      }
                    }
                  }
                },
                "maturityPeriodWithOverrides": {
                  "summary": "maturity_period together with overrides",
                  "description": "The term and the overrides are independent and can be updated in the same request.",
                  "value": {
                    "deposit_configs": {
                      "maturity_period": {
                        "unit": "MONTHS",
                        "value": 18
                      },
                      "interest_capitalization_mode": "REINVEST",
                      "overrides": {
                        "maturity_instructions": {
                          "principal": "ROLLOVER",
                          "interest": "PAY",
                          "reason": "Customer opted-in via self-service"
                        },
                        "renewal_term": {
                          "unit": "MONTHS",
                          "value": 12
                        }
                      }
                    }
                  }
                },
                "overridesOnly": {
                  "summary": "overrides only — term left untouched",
                  "description": "Omitting `maturity_period` leaves the persisted term unchanged. `renewal_term` keeps applying at rollover only.",
                  "value": {
                    "deposit_configs": {
                      "overrides": {
                        "penalties": {
                          "reason": "Q4 2026 regulatory adjustment",
                          "grace_period": {
                            "waived": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountAttachment"
                },
                "examples": {
                  "relativeForm": {
                    "summary": "Term updated with unit + value",
                    "description": "Request sent `{ unit: MONTHS, value: 18 }` on an attachment whose `effective_date` is `2024-05-29`.",
                    "value": {
                      "product_type": "deposit",
                      "product_id": "2c336e9d-d04f-4fd0-8f6e-25808f48d70c",
                      "external_account_id": "ext-acct-001",
                      "interest_plan_id": "a3c73958-e2bd-4b8b-ab72-1ae6c0b5aade",
                      "maturity_period": {
                        "unit": "MONTHS",
                        "value": 18,
                        "calendar_maturity_date": "2025-11-28"
                      },
                      "attachment_date": "2024-05-29T14:00:00Z",
                      "effective_date": "2024-05-29",
                      "interest_capitalization_mode": "REINVEST"
                    }
                  },
                  "calendarForm": {
                    "summary": "Term updated with calendar_maturity_date (normalized in the response)",
                    "description": "Request sent `{ calendar_maturity_date: \"2026-12-31\" }` on an attachment whose `effective_date` is `2026-01-01`. The explicit date is converted to a day count from the anchor, so `unit` and `value` come back populated alongside it.",
                    "value": {
                      "product_type": "deposit",
                      "product_id": "2c336e9d-d04f-4fd0-8f6e-25808f48d70c",
                      "external_account_id": "ext-acct-001",
                      "interest_plan_id": "a3c73958-e2bd-4b8b-ab72-1ae6c0b5aade",
                      "maturity_period": {
                        "unit": "DAYS",
                        "value": 365,
                        "calendar_maturity_date": "2026-12-31"
                      },
                      "attachment_date": "2026-01-01T14:00:00Z",
                      "effective_date": "2026-01-01"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                },
                "examples": {
                  "emptyOverridesEnvelope": {
                    "summary": "deposit_configs.overrides must contain at least one field",
                    "value": {
                      "code": "EIBACC0315",
                      "message": "deposit_configs.overrides must contain at least one field"
                    }
                  },
                  "overrideValidUntilPast": {
                    "summary": "valid_until must be a future datetime",
                    "value": {
                      "code": "EIBACC0308",
                      "message": "valid_until must be a future datetime"
                    }
                  },
                  "renewalTermRequiresRollover": {
                    "summary": "renewal_term requires ROLLOVER in maturity_instructions",
                    "value": {
                      "code": "EIBACC0310",
                      "message": "Validation error",
                      "details": "renewal_term requires ROLLOVER configured in maturity_instructions.principal or maturity_instructions.interest (account/program override or product default)."
                    }
                  },
                  "maturityPeriodMutuallyExclusive": {
                    "summary": "maturity_period — calendar_maturity_date and unit/value are mutually exclusive",
                    "value": {
                      "code": "EIBACC0307",
                      "message": "Validation error",
                      "details": "maturity_period accepts either calendar_maturity_date OR unit+value, not both. Choose one: send calendar_maturity_date for an explicit date, or unit+value for a relative period."
                    }
                  },
                  "maturityPeriodResolvesToPastDate": {
                    "summary": "maturity_period resolves to a maturity date in the past",
                    "value": {
                      "code": "EIBACC0306",
                      "message": "Validation error",
                      "details": "maturity_period resolves to a maturity date in the past. Measured from the attachment's effective_date, the resolved date must be the current date or later."
                    }
                  },
                  "maturityPeriodInvalidFormat": {
                    "summary": "maturity_period — calendar_maturity_date is not in YYYY-MM-DD format",
                    "value": {
                      "code": "EIBACC0305",
                      "message": "Validation error",
                      "details": "calendar_maturity_date must be in YYYY-MM-DD format"
                    }
                  },
                  "maturityPeriodInvalidValue": {
                    "summary": "maturity_period — value must be a positive integer",
                    "value": {
                      "code": "EIBACC0299",
                      "message": "Validation error",
                      "details": "maturity_period value must be a positive integer (>= 1)"
                    }
                  },
                  "maturityPeriodInvalidUnit": {
                    "summary": "maturity_period — unit is not supported",
                    "value": {
                      "code": "EIBACC0298",
                      "message": "Validation error",
                      "details": "Invalid maturity_period unit. Supported values: DAYS, WEEKS, MONTHS, YEARS"
                    }
                  },
                  "maturityPeriodBelowMinTerm": {
                    "summary": "maturity_period is below the product's configured min_term",
                    "value": {
                      "code": "EIBACC0109",
                      "message": "Maturity period is below the configured MinTerm of the product"
                    }
                  },
                  "maturityPeriodAboveMaxTerm": {
                    "summary": "maturity_period is above the product's configured max_term",
                    "value": {
                      "code": "EIBACC0110",
                      "message": "Maturity period is above the configured MaxTerm of the product"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                },
                "examples": {
                  "attachmentNotFound": {
                    "summary": "Active deposit attachment not found for this account",
                    "value": {
                      "code": "EIBACC0113",
                      "message": "Product attachment not found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                },
                "examples": {
                  "attachmentNotActive": {
                    "summary": "Attachment is not active",
                    "value": {
                      "code": "EIBACC0301",
                      "message": "Attachment is not active. Only active attachments can be updated"
                    }
                  },
                  "optimisticLock": {
                    "summary": "Product attachment was modified concurrently",
                    "value": {
                      "code": "EIBACC0314",
                      "message": "Product attachment was modified concurrently; retry with the latest state"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                },
                "examples": {
                  "internalError": {
                    "summary": "Internal error",
                    "value": {
                      "code": "EIBACC0007",
                      "message": "Internal error"
                    }
                  },
                  "attachmentOverridesUpdate": {
                    "summary": "Failed to update attachment overrides",
                    "value": {
                      "code": "EIBACC0316",
                      "message": "Failed to update attachment overrides"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ]
}
```