Skip to main content

Close a account

Request

ENDPOINT
/account/ACCOUNT_KEY/cancel
METHOD
PATCH

Response

STATUS
200
Response Body
{
"account_block_reason": null,
"account_branch": "0001",
"account_credentials": [{
"account_id": 3493,
"created_at": "2023-01-04T11:10:53",
"credential_type": {
"created_at": "2019-06-18T13:19:30",
"enumerator": "observer",
"id": 3,
"translation_path": "account.CredentialType.observer"
},
"credential_type_id": 3,
"id": 3456,
"is_active": true,
"person_key": "10ffdcef-6ac7-4ca0-9932-8a0e49ff5972",
"updated_at": null
},
{
"account_id": 3493,
"created_at": "2023-01-04T11:10:53",
"credential_type": {
"created_at": "2019-06-18T13:19:30",
"enumerator": "requester",
"id": 2,
"translation_path": "account.CredentialType.requester"
},
"credential_type_id": 2,
"id": 3457,
"is_active": true,
"person_key": "78269442-caa1-4767-a049-0291b0321063",
"updated_at": null
}
],
"account_digit": "9",
"account_documents": [],
"account_events": [{
"account_id": 3493,
"created_at": "2023-01-04T11:10:53",
"id": 5284,
"new_account_status": {
"created_at": "2019-10-11T18:58:31",
"enumerator": "blocked",
"id": 3,
"translation_path": "account.AccountStatus.blocked"
},
"new_account_status_id": 3,
"old_account_status": null,
"old_account_status_id": null
},
{
"account_id": null,
"created_at": null,
"id": null,
"new_account_status": {
"created_at": "2019-10-11T18:58:31",
"enumerator": "closed",
"id": 2,
"translation_path": "account.AccountStatus.closed"
},
"new_account_status_id": null,
"old_account_status": {
"created_at": "2019-10-11T18:58:31",
"enumerator": "blocked",
"id": 3,
"translation_path": "account.AccountStatus.blocked"
},
"old_account_status_id": null
}
],
"account_key": "91e42ceb-53f7-4dc5-ab75-db30b1de491f",
"account_name": "Default",
"account_number": "2765703",
"account_status": {
"created_at": "2019-10-11T18:58:31",
"enumerator": "closed",
"translation_path": "account.AccountStatus.closed"
},
"account_type": {
"created_at": "2019-03-15T13:09:15",
"enumerator": "checking",
"translation_path": "account.AccountType.checking"
},
"automatic_transfer_management_status": {
"created_at": "2022-10-27T13:48:18",
"enumerator": "master"
},
"automatic_transfers": [],
"balance": 0.0,
"blocked_balance": 0.0,
"blocked_balance_events": [],
"created_at": "2023-01-04T11:10:53",
"destinations": [],
"fee": 0.0,
"internal_webhooks": [],
"investment_available_amount": 0.0,
"investment_configuration": null,
"is_system_account": false,
"owner_document_number": "23426525852",
"owner_name": "Murilo Almeida",
"owner_person_key": "10ffdcef-6ac7-4ca0-9932-8a0e49ff5972",
"permitted_person_keys": ["10ffdcef-6ac7-4ca0-9932-8a0e49ff5972",
"10ffdcef-6ac7-4ca0-9932-8a0e49ff5972",
"78269442-caa1-4767-a049-0291b0321063"
],
"requester_key": "78269442-caa1-4767-a049-0291b0321063",
"requester_name": "Salgadinhos Show (BAAS)",
"setup_fee": null,
"transactional_limit": null,
"url": "https://storage.googleapis.com/sandbox-doc-api/documents/e054a511-a8db-4c6e-abbe-f376f36fb39c/e054a511-a8db-4c6e-abbe-f376f36fb39c.pdf",
"webhook_enabled": true
}
Attention!

It is important that the PDF of the account closure receipt returned in the "url" field be presented to the client.

PATH PARAMS

FieldTypeDescription
account_key *stringAccount key.

Response

STATUS
400
Response Body
{
"data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}

Errors

CodeStatus codeDescription
ACC000006404Account not found for the given key {account_key}
QIT000003403The agent does not have enough roles.
ACC000127500Failed to create account cancelling term
ACC000011423Closed accounts can not perform this action.
ACC000123400Account balance cannot be greater than 0.
ACC000124400Can't perform this action. There'are few unpaid future transactions
ACC000125400Can't perform this action. There'are few unpaid bankslip fees
ACC000126400There'are few accepted or registered bankslips yet