Closing non-BaaS subaccounts
The parent account can close via the API a non-BaaS subaccount that was created incorrectly or will not be used.
Closing is irreversible and is only available when the subaccount meets the eligibility criteria in this guide.
Before you start
The parent account must meet two requirements:
- have the IP Whitelist enabled, with the application's IP authorized;
- enable subaccount closing management through the Asaas interface.
Requests originating from unauthorized IPs are rejected.
1. Enable closing via the API
In the Asaas interface:
- go to Integrations;
- go to Security;
- find Subaccount closing validation via API;
- click Enable closing;
- confirm the action with the token sent to the authorized device.
ImportantThe Subaccount closing validation via API panel is not displayed for customers who operate with Asaas BaaS. Closing BaaS subaccounts is done through a separate process.
To disable the feature, click Disable closing in the same panel and confirm the action with the authentication token.
2. Check whether the subaccount can be closed
Before making the request, confirm that the subaccount:
- belongs to the parent account that will close it;
- does not operate as BaaS;
- has never logged in;
- was created less than 48 hours ago;
- is not already closed.
%%{init: {"flowchart": {"nodeSpacing": 28,"rankSpacing": 32,"diagramPadding": 8,"padding": 10}}}%%
flowchart TD
A["Configure IP Whitelist"] --> B["Enable closing"]
B --> C["Check the subaccount criteria"]
C --> D{"Meets all<br/>criteria?"}
D --> DSim(("Yes"))
D --> DNao(("No"))
DSim --> E["Close the subaccount"]
E --> F["Confirm HTTP 200"]
classDef inicio fill:#DBEAFE,stroke:#2563EB,color:#1E3A8A,stroke-width:3px,font-size:17px
classDef decisao fill:#FEF3C7,stroke:#D97706,color:#78350F,stroke-width:3px,font-size:17px
classDef validacao fill:#E0F2FE,stroke:#0284C7,color:#0C4A6E,stroke-width:2px,font-size:17px
classDef sucesso fill:#DCFCE7,stroke:#16A34A,color:#14532D,stroke-width:3px,font-size:17px
classDef respostaSim fill:#22C55E,stroke:#15803D,color:#FFFFFF,stroke-width:3px,font-size:16px
classDef respostaNao fill:#EF4444,stroke:#B91C1C,color:#FFFFFF,stroke-width:3px,font-size:16px
class A inicio
class B,C,E validacao
class D decisao
class F sucesso
class DSim respostaSim
class DNao respostaNao
linkStyle default stroke:#94A3B8,stroke-width:2px
linkStyle 3 stroke:#22C55E,stroke-width:4px
linkStyle 4 stroke:#EF4444,stroke-width:4px
If any criterion is not met, this closing flow cannot be used.
3. Close the subaccount
Authenticate the request with the parent account's credential and provide the subaccount id:
DELETE /v3/accounts/{id}See the full reference for the Close non-BaaS subaccount endpoint.
AttentionClosing is irreversible. After closing a subaccount, it cannot be reactivated.
A new subaccount may be created in the future using the same or similar data.
Free closingNon-BaaS subaccounts closed within 48 hours of creation are not charged the creation fee, when applicable. To qualify, the subaccount must meet the criteria for closing non-BaaS subaccounts, including never having logged in. After this period, closing through this flow is no longer allowed.
Check the amounts applicable to your contract in Account Settings > Fees.
How to validate the closing
When the operation completes successfully, the API will return HTTP 200.
If the request is rejected, mainly check whether:
- the source IP is registered in the parent account's Whitelist;
- closing management is enabled;
- the
idbelongs to a subaccount of the parent account; - the subaccount is non-BaaS;
- the subaccount has never logged in;
- it was created less than 48 hours ago;
- the subaccount has not already been closed.
Next steps
Updated 18 days ago
