Skip to main content

Create a multi-consent

Multiple consent allows you to group multiple consents for sensitive operations into a single consent, so your user can consent to multiple operations at the same time.

Guide​

  1. For each sensitive operation the user initiates, retrieve the consentId.
  2. Confirm that all child consents must have the status Created. Otherwise, the API returns a ConsentsNotAllInCreatedStatusRejection rejection.
  3. Call the CreateMultiConsent mutation.
  4. Send the consentUrl to your user to grant multiple consent.
  5. Your end user now needs to perform Strong Customer Authentication.
Same user

All child consents must be from the same user represented by a user access token, or with the same project access token impersonating that user.

Mutation​

🔎 Open the mutation in API Explorer

mutation MultipleConsent {
createMultiConsent(
input: {
redirectUrl: "$YOUR_REDIRECT_URL"
orderedConsentIds: [
{ consentId: "$CONSENT_ID_1" }
{ consentId: "$CONSENT_ID_2" }
{ consentId: "$CONSENT_ID_3" }
]
}
) {
... on CreateMultiConsentSuccessPayload {
__typename
consent {
consentUrl
}
}
}
}

Payload​

Make sure to send the consentUrl (line 6) to your user.

{
"data": {
"createMultiConsent": {
"__typename": "CreateMultiConsentSuccessPayload",
"consent": {
"consentUrl": "$YOUR_CONSENT_URL"
}
}
}
}

Choose order of consents​

You can choose the order in which to perform child consents with the order parameter. The order begins with 0 and continues 1, 2, and so forth.

🔎 Open the mutation in API Explorer

mutation ChooseOrder {
createMultiConsent(
input: {
orderedConsentIds: [
{ consentId: "$CONSENT_ID_1", order: 1 }
{ consentId: "$CONSENT_ID_2", order: 1 }
{ consentId: "$CONSENT_ID_3", order: 1 }
{ consentId: "$CONSENT_ID_4", order: 1 }
{ consentId: "$CONSENT_ID_5", order: 1 }
{ consentId: "$CONSENT_ID_6", order: 0 }
{ consentId: "$CONSENT_ID_7", order: 2 }
{ consentId: "$CONSENT_ID_8", order: 1 }
{ consentId: "$CONSENT_ID_9", order: 1 }
]
redirectUrl: "$YOUR_REDIRECT_URL"
}
) {
... on CreateMultiConsentSuccessPayload {
__typename
consent {
consentUrl
}
}
... on ConsentsNotAllInCreatedStatusRejection {
__typename
consentIds
message
}
... on ConsentsNotFoundRejection {
__typename
ids
message
}
... on ValidationRejection {
__typename
message
}
... on ConsentsAlreadyLinkedToMultiConsentRejection {
__typename
consentIds
message
}
}
}