Mandate required before flow progression

Blocking Flow Pattern: Mandate Required Before Progression

Use this pattern when your platform must ensure that a customer signs a mandate before continuing. This may be used in a customer onboarding flow, eg. A customer must complete a mandate before they continue.

It is recommended that you use a new tab redirect to the URL here. While it can be rendered in an iframe, you will not be able to listen to front-end events.

1. Create a mandate:

PUT /customers/id/directdebitmandates

Capture the redirectUrl from the response.

Example payload: https://app.adfin.com/dd-mandate/WmWd0Tg6RiwVTGnSVQ

2. Redirect the user to the signing page.

Use the redirectURI provided in the mandate request. This is the adfin URI where a user will sign the mandate.

3. Gate progression:

On return or when the user clicks "next" or "continue":

  1. Call GET /customers/id/directdebitmandates
  2. Proceed only if the status is PENDING or ACTIVE.
  3. If status is CREATED, block and prompt to complete signing. This should be handled in your UI with the user.