Skip to main content

Get information about an onboarding

Use the onboardings query to get information about your onboardings, allowing you to monitor progress or share information with your end user.

Queries are highly customizable, so use the onboardings query to retrieve any information that will help you follow along with your users. You can also use it retrieve onboarding IDs.

After getting information about an onboarding, you might want to update that onboarding if it is still ongoing. Refer to the guides to update an individual or company onboarding.

Prerequisites

To monitor onboarding progress, you must have at least one existing onboarding, either individual or company. The onboarding can have any status.

Guide​

  1. Call the onboardings query.
  2. Add all the query options you'd like to monitor.
    • For this exercise, add: createdAt, email, info > type, onboardingUrl, onboardingState, statusInfo > status, id, and totalCount.
    • To statusInfo > status, add a rejection as well: OnboardingInvalidStatusInfo with errors, field, and status.
  3. You can only get information for up to 100 onboardings at a time. Add pagination to tailor your response to the information you need.

Query​

🔎 Open the query in API Explorer

query MonitorOnboarding {
onboardings {
edges {
node {
createdAt
email
info {
type
}
onboardingUrl
onboardingState
statusInfo {
status
... on OnboardingInvalidStatusInfo {
__typename
errors {
field
errors
}
status
}
}
id
}
}
totalCount
}
}

Payload​

Review the sample payload with two Ongoing onboardings, one Invalid and one Valid, as well as one Completed onboarding with the status Finalized.

{
"data": {
"onboardings": {
"edges": [
{
"node": {
"createdAt": "2023-06-20T14:10:39.286Z",
"email": "alberto.moreno@mimarca.io",
"info": {
"type": "Company"
},
"onboardingUrl": "https://api.banking.swan.io/projects/$PROJECT_ID/onboardings/$ONBOARDING_ID?lang=es",
"onboardingState": "Ongoing",
"statusInfo": {
"status": "Invalid",
"__typename": "OnboardingInvalidStatusInfo",
"errors": [
{
"field": "individualUltimateBeneficialOwners[0].birthDate",
"errors": [
"Missing"
]
}
]
},
"id": "$ONBOARDING_ID"
}
},
{
"node": {
"createdAt": "2023-06-20T14:00:20.207Z",
"email": "sofia.ramos@mybrand.io",
"info": {
"type": "Individual"
},
"onboardingUrl": "https://api.banking.swan.io/projects/$PROJECT_ID/onboardings/$ONBOARDING_ID?lang=en",
"onboardingState": "Ongoing",
"statusInfo": {
"status": "Valid"
},
"id": "$ONBOARDING_ID",
}
},
{
"node": {
"createdAt": "2023-08-01T09:01:17.050Z",
"email": "malika.ngomao@mybrand.io",
"info": {
"type": "Individual"
},
"onboardingUrl": "https://api.banking.swan.io/projects/$PROJECT_ID/onboardings/$ONBOARDING_ID?lang=fr",
"onboardingState": "Completed",
"statusInfo": {
"status": "Finalized"
},
"id": "$ONBOARDING_ID",
}
},
],
"totalCount": 3
}
}
}