# Detach deposit from account Detach a time deposit product from an account. This endpoint generates the [Account detached](https://developers.pismo.io/events/docs/deposit-product-account-detach-1) event. # 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" } } }, "DetachRequest": { "type": "object", "required": [ "product_id" ], "properties": { "product_id": { "type": "string", "description": "Product identifier.", "example": "2c336e9d-d04f-4fd0-8f6e-25808f48d70c" }, "metadata": { "type": "object", "description": "The metadata object contains user-defined key-value pairs that offer additional context or custom information.
\nThe platform has no control over its content, but rather controlled by the user.\n", "example": { "key": "value" } } } } }, "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", "detail": "error EIBACC0008: Validation error [(Field 'Order' is invalid)]" } } } } } }, "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" } } } } } }, "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}/detach": { "post": { "tags": [ "Account attachment" ], "summary": "Detach deposit from account", "description": "Detach a time deposit product from an account.\nThis endpoint generates the [Account detached](https://developers.pismo.io/events/docs/deposit-product-account-detach-1) event.\n", "operationId": "interest-bearing-v1-deposit-detach-account", "parameters": [ { "$ref": "#/components/parameters/accountId" }, { "$ref": "#/components/parameters/authorizationTokenHeader" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DetachRequest" } } } }, "responses": { "204": { "description": "Success - No Content" }, "400": { "$ref": "#/components/responses/400BadRequest" }, "404": { "$ref": "#/components/responses/404NotFound" }, "409": { "description": "Conflict.", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/ErrorResponse" } ] }, "examples": { "invalidRequestBody": { "summary": "Bad Request.", "value": { "code": "EIBACC0114", "message": "Product is already detached" } } } } } }, "500": { "$ref": "#/components/responses/500InternalServer" } } } } }, "security": [ { "BearerAuth": [] } ] } ```