Close an account by legal representative request
If the account holder's legal representative requests an account closure, the process starts with the API.
Guide​
- Call the
closeAccount
mutation with the legal representative's user access token. - The API returns a
consentUrl
. - Send the
consentUrl
to your user so they can complete Strong Customer Authentication. - As soon as the user consents, the account status changes to
Closing
.
Account statuses
Refer to the account statuses section for an overview of what happens while an account is Closing
.
Mutation​
🔎 Open the mutation in API Explorer
Mutation
mutation closeAccount {
closeAccount(
input: {
accountId: "$YOUR_ACCOUNT_ID"
reason: { type: ClosingRequested }
consentRedirectUrl: "$YOUR_REDIRECT_URL"
}
) {
... on CloseAccountSuccessPayload {
__typename
consent {
consentUrl
}
}
}
}
Payload​
Payload
{
"data": {
"closeAccount": {
"__typename": "CloseAccountSuccessPayload",
"consent": {
"consentUrl": "https://identity.swan.io/consent?consentId=$YOUR_CONSENT_ID&env=Sandbox"
}
}
}
}