Skip to main content

Integration Overview

This guide walks through implementing the complete consent management workflow in your application. We’ll cover collecting consent during onboarding, linking users, checking status, and handling revocations.
All examples use the US policy with 5 required consents (including eSignAct for E-Sign Act compliance). For Global policy, exclude the eSignAct consent.

Prerequisites

Before implementing consent management, ensure you have:
  • Baanx API credentials (x-client-key and x-secret-key)
  • User registration flow in your application
  • Ability to track temporary identifiers before user creation
Create a consent set during user registration before address submission finalizes the registration.

Use Onboarding ID from Registration

The onboardingId is obtained from the email verification step of the user registration flow:
Do not generate a new onboardingId - always use the onboardingId returned from email verification (POST /v1/auth/register/email/verify). This ID links the consent to the user’s registration session.

Response

Validation Rules

The API validates that all required consents are present based on policy type:
Consents can have granted or denied status during creation. Both are valid, but the user’s overall consent status will be incomplete if required consents are denied.
After address submission finalizes registration and returns a permanent userId, link it to the consent set created in Step 1. Call this endpoint after:
  • ✅ Physical address submitted (POST /v1/auth/register/address) returns userId and accessToken
  • ✅ OR mailing address submitted (POST /v1/auth/register/mailing-address) returns userId and accessToken (US users only)
  • ✅ Registration is complete and you have the userId
The address endpoints finalize registration. Non-US users and US users with same mailing address get userId from the address endpoint. US users with different mailing addresses get userId from the mailing address endpoint.

Response

A consent set can only be linked to one user. Attempting to link again will result in a 409 Conflict error.
Retrieve a user’s consent status to validate compliance or gate features.

Short Status Check (Fast)

Get quick status summary:
Response:

Status Values

Get all consent sets with detailed records:
Use Cases:
  • Detailed consent review pages
  • User privacy dashboards
  • Compliance reporting
  • Consent preference management

Step 4: Access Audit Trail

Retrieve complete consent change history for compliance reporting.

Paginated Audit Request

Response

Pagination Parameters

Allow users to withdraw specific consents while maintaining audit trail.

Revocation Request

Response

Revocation creates a new consent record with revoked status. The original consent record is preserved for audit purposes.

Post-Revocation Handling

After revocation:
  1. User’s overall consent status may become incomplete
  2. Check consent status to determine access restrictions
  3. Prompt user to re-grant consent if needed for service access

Complete Integration Example

Here’s a full TypeScript implementation:

Usage Example

Best Practices

Always use the onboardingId returned from email verification (POST /v1/auth/register/email/verify). Do not generate a new ID - the onboardingId links the consent to the registration session.
Store the consentSetId in your session or database between consent creation (Step 4) and linking (Step 7). You’ll need it to link the consent after address submission returns the userId.
Include IP address, user agent, timestamp, and client version in metadata for comprehensive audit trails:
Implement retry logic for network failures and provide clear user feedback for validation errors:
For access control and feature gating, use the short status check (no ?full=true) for optimal performance:

Next Steps

Compliance Guide

Regulatory requirements and audit strategies

Troubleshooting

Common issues and error handling

API Reference

Complete endpoint documentation

Overview

Back to consent management overview