# Cancel account Cancel all operations for the specified account, and withdraw the remaining balance. This endpoint generates the following events. - [Interest account cancellation succeeded](https://developers.pismo.io/events/docs/interest-engine-interest-account-cancellation-success-1) when account cancellation operation succeeds - [Interest account cancellation failed](https://developers.pismo.io/events/docs/interest-engine-interest-account-cancellation-failure-1) when account cancellation fails For more information, refer to the [Interest-bearing accounts](doc:interest-bearing-accounts) guide. # OpenAPI definition ```json { "openapi": "3.1.0", "info": { "title": "Banking - Interest operations", "version": "1.0.0", "description": "API to handle interest bearing account operations", "contact": { "name": "API Support", "url": "https://developers.pismolabs.io/pismo-docs/docs/support" }, "license": { "name": "Copyright Pismo", "identifier": "Pismo" } }, "servers": [ { "url": "https://sandbox.pismolabs.io/interest-engine", "description": "Sandbox API server for integration" } ], "tags": [ { "name": "Interest engine", "description": "Endpoints for handling interest bearing account operations" } ], "components": { "parameters": { "Authorization": { "name": "authorization", "in": "header", "description": "Authorization", "required": true, "example": "Bearer ac194ce4-ecbe-4007-91bd-94babf388e7278f243bc-4ad8-4ead-a2c3-f42a548fe760", "schema": { "type": "string" } }, "ContentType": { "name": "content-type", "in": "header", "description": "Content type", "required": true, "example": "application/json", "schema": { "type": "string" } }, "XProgramId": { "name": "x-program-id", "in": "header", "description": "Program ID", "required": true, "example": "1233", "schema": { "type": "string" } } }, "schemas": { "AccountId": { "type": "string", "format": "number", "description": "Account ID", "example": "15001" }, "DocumentNumber": { "type": "string", "minLength": 11, "maxLength": 14, "description": "Applicable only to Brazil. Government-issued CPF (Cadastro de Pessoas FĂ­sicas) document number. Must be numeric with 11-14 digits. **Required** when providing the `has_asset_registration` object. \n", "example": "48162822038" }, "InterestAccountCancellationRequest": { "title": "InterestAccountCancellationRequest", "type": "object", "properties": { "account_id": { "$ref": "#/components/schemas/AccountId" }, "document_number": { "$ref": "#/components/schemas/DocumentNumber" }, "external_account_cancellation_id": { "$ref": "#/components/schemas/ExternalAccountCancellationId" } }, "required": [ "account_id", "external_account_cancellation_id" ] }, "ExternalAccountCancellationId": { "type": "string", "minLength": 1, "maxLength": 64, "description": "External Identificator managed and used by requester to track the account cancellation request.", "example": "07d84f793027" }, "InterestAccountCancellationResponse": { "title": "InterestAccountCancellationResponse", "type": "object", "properties": { "external_account_cancellation_id": { "$ref": "#/components/schemas/ExternalAccountCancellationId" } }, "required": [ "external_account_cancellation_id" ] } }, "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } }, "responses": { "400BadRequest": { "description": "Bad request" }, "401Unauthorized": { "description": "Unauthorized" }, "500InternalServerError": { "description": "Internal server error" }, "404NotFound": { "description": "Not found" } } }, "security": [ { "BearerAuth": [] } ], "paths": { "/v1/interest/account/cancellation": { "post": { "summary": "Cancel account", "description": "Cancel all operations for the specified account, and withdraw the remaining balance.\n\nThis endpoint generates the following events.\n- [Interest account cancellation succeeded](https://developers.pismo.io/events/docs/interest-engine-interest-account-cancellation-success-1) when account cancellation operation succeeds\n- [Interest account cancellation failed](https://developers.pismo.io/events/docs/interest-engine-interest-account-cancellation-failure-1) when account cancellation fails\n\nFor more information, refer to the [Interest-bearing accounts](https://developers.pismo.io/pismo-docs/docs/interest-bearing-accounts) guide.\n", "tags": [ "Interest engine" ], "operationId": "post-v1-interest-account-cancellation", "parameters": [ { "$ref": "#/components/parameters/XProgramId" }, { "$ref": "#/components/parameters/ContentType" }, { "$ref": "#/components/parameters/Authorization" } ], "requestBody": { "description": "Requested body of authorization", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InterestAccountCancellationRequest" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InterestAccountCancellationResponse" } } } }, "400": { "$ref": "#/components/responses/400BadRequest" }, "401": { "$ref": "#/components/responses/401Unauthorized" }, "404": { "$ref": "#/components/responses/404NotFound" }, "500": { "$ref": "#/components/responses/500InternalServerError" } } } } } } ```