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

# Update payout account for deposit account

Update the payout account configuration for an attached deposit account.
The payout account specifies where interest payments and maturity proceeds are sent.


# OpenAPI definition

```json
{
  "openapi": "3.0.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": {
      "authorizationTokenHeader": {
        "name": "AuthorizationToken",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "required": true,
        "description": "Account token. Token encoded with a Pismo account ID. Tokens can expire quickly, which can result in a 401 Unauthorized error.\n",
        "example": 1234
      },
      "accountId": {
        "description": "Account ID",
        "in": "path",
        "name": "accountId",
        "required": true,
        "schema": {
          "type": "integer"
        },
        "example": 123456
      }
    },
    "schemas": {
      "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": {
        "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\n Required for type `EXTERNAL` and not allowed for `INTERNAL`\n",
            "example": {
              "key": "value"
            }
          }
        },
        "type": "object"
      },
      "UpdatePayoutAccountRequest": {
        "type": "object",
        "required": [
          "payout_account"
        ],
        "properties": {
          "payout_account": {
            "$ref": "#/components/schemas/PayoutAccount"
          }
        }
      },
      "UpdatePayoutAccountResponse": {
        "type": "object",
        "properties": {
          "payout_account": {
            "$ref": "#/components/schemas/PayoutAccount"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "The date and time when the payout account was updated",
            "example": "2024-01-23T13:26:25.000Z"
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "responses": {
      "400BadRequest": {
        "description": "Bad request",
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              ]
            },
            "examples": {
              "invalidRequestBody": {
                "summary": "Bad Request",
                "value": {
                  "code": "EIBACC0008",
                  "message": "Bad Request",
                  "details": "error EIBACC0008: Validation error [(Field 'Order' is invalid)]"
                }
              },
              "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."
                }
              },
              "calendarMaturityDateInvalidFormat": {
                "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"
                }
              },
              "calendarMaturityDateNotFuture": {
                "summary": "maturity_period — calendar_maturity_date is not a future date",
                "value": {
                  "code": "EIBACC0306",
                  "message": "Validation error",
                  "details": "calendar_maturity_date must be a future date (after today)"
                }
              }
            }
          }
        }
      },
      "404NotFound": {
        "description": "Bad request",
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              ]
            },
            "examples": {
              "invalidRequestBody": {
                "summary": "Bad Request",
                "value": {
                  "code": "EIBACC0064",
                  "message": "Product not found"
                }
              }
            }
          }
        }
      },
      "409Conflict": {
        "description": "Conflict",
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              ]
            },
            "examples": {
              "conflict": {
                "summary": "Conflict",
                "value": {
                  "code": "EIBACC0114",
                  "message": "Product is already detached"
                }
              }
            }
          }
        }
      },
      "500InternalServer": {
        "description": "Internal error",
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              ]
            },
            "examples": {
              "internalProcessingError": {
                "summary": "Internal processing error",
                "value": {
                  "code": "EIBACC0007",
                  "message": "Internal error",
                  "detail": "Internal error"
                }
              }
            }
          }
        }
      }
    }
  },
  "paths": {
    "/v1/deposits/accounts/{accountId}": {
      "patch": {
        "tags": [
          "Account attachment"
        ],
        "summary": "Update payout account for deposit account",
        "description": "Update the payout account configuration for an attached deposit account.\nThe payout account specifies where interest payments and maturity proceeds are sent.\n",
        "operationId": "interest-bearing-v1-deposit-update-payout-account",
        "parameters": [
          {
            "$ref": "#/components/parameters/accountId"
          },
          {
            "$ref": "#/components/parameters/authorizationTokenHeader"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePayoutAccountRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payout account updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatePayoutAccountResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400BadRequest"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/404NotFound"
          },
          "409": {
            "$ref": "#/components/responses/409Conflict"
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                },
                "examples": {
                  "invalidInternalAccount": {
                    "summary": "Internal account validation failed",
                    "value": {
                      "code": "EIBACC0302",
                      "message": "Internal payout account validation failed. Account does not exist"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/500InternalServer"
          }
        }
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ]
}
```