Finalize an onboarding
You can finalize onboardings in several ways:
- Using the API.
- Your end users can also finalize their own onboardings using the onboarding URLs you create for individuals or companies.
- If you're using Swan's Web Banking interface, they can finalize their onboarding themselves with the app.
Prerequisites
To finalize an onboarding using the API:
- You must have a user access token for the user whose onboarding you're finalizing, and the user must have accessed their authentication URL at least one time.
- The onboarding status must be
Ongoing (Valid)
.
If you need to update an onboarding before finalizing it, follow the guides for updating an individual or company onboarding.
Guide​
Finalize an onboarding using the API.
- First, retrieve the ID for the onboarding you're finalizing.
- Call the
finalizeOnboarding
mutation. - Enter the onboarding ID retrieved in step 1.
- Add optional messages to the success payload, either for validation or in case of rejection.
- Confirm you're using the user access token to run the mutation.
Mutation​
🔎 Open the mutation in API Explorer
Notice the request to include the account ID and account holder ID, as well as the onboarding status, in the success payload.
mutation finalizeOnboarding {
finalizeOnboarding(input: { onboardingId: "$ONBOARDING_ID" }) {
... on FinalizeOnboardingSuccessPayload {
__typename
onboarding {
account {
id
holder {
id
}
}
statusInfo {
status
}
}
}
... on OnboardingNotCompletedRejection {
__typename
}
... on ValidationRejection {
__typename
message
}
}
}
Payload​
Notice the ID for the newly-created account and account holder, as well as the onboarding status Finalized
.
{
"data": {
"finalizeOnboarding": {
"__typename": "FinalizeOnboardingSuccessPayload",
"onboarding": {
"account": {
"id": "$NEW_ACCOUNT_ID",
"holder": {
"id": "$NEW_ACCOUNT_HOLDER_ID"
}
},
"statusInfo": {
"status": "Finalized"
}
}
}
}
}