Close a account
Request
ENDPOINT
/account/ACCOUNT_KEY/cancelMETHOD
PATCHResponse
STATUS
200Response 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
| Field | Type | Description |
|---|---|---|
account_key * | string | Account key. |
Response
STATUS
400Response Body
{
"data": "{\"title\": \"Bad Request\", \"description\": \"Invalid request body.\", \"translation\": \"Corpo da requisição inválido.\", \"extra_fields\": {}, \"code\": \"LEG000069\"}"
}
Errors
| Code | Status code | Description |
|---|---|---|
| ACC000006 | 404 | Account not found for the given key {account_key} |
| QIT000003 | 403 | The agent does not have enough roles. |
| ACC000127 | 500 | Failed to create account cancelling term |
| ACC000011 | 423 | Closed accounts can not perform this action. |
| ACC000123 | 400 | Account balance cannot be greater than 0. |
| ACC000124 | 400 | Can't perform this action. There'are few unpaid future transactions |
| ACC000125 | 400 | Can't perform this action. There'are few unpaid bankslip fees |
| ACC000126 | 400 | There'are few accepted or registered bankslips yet |
Webhook
Attention!
QI Tech webhooks must not be mapped strictly. Additional fields may be included in the webhook payloads returned by our APIs.
Resending Webhooks
You can view and resend webhooks by following the detailed instructions in the documentation: Resending Webhooks.
Below is the webhook triggered when an account is closed.
WEBHOOK_TYPE
baas.account.status_changeWebhook Body
{
"webhook_type": "baas.account.status_change",
"webhook_datetime": "2021-10-22T20:30:23.459Z",
"data": {
"account_key":"91e42ceb-53f7-4dc5-ab75-db30b1de491f",
"account_status":"closed"
}
}