HomeGuidesRecipesAPI ReferenceChangelog
Log In
Guides

Generating Terms and Conditions Hashes for Compliance

📘

This feature is not active by default for all Merchants

To activate the feature, please get in touch with Unblock.

Unblock requires both users and corporate administrators to accept the latest Terms and Conditions, Privacy Policy, and Terms of Service to ensure compliance. If you are not using the Sumsub SDK for KYC and are managing Terms and Conditions acceptance within your own platform, you need to implement a mechanism to record user acceptance and provide proof of the accepted document versions to Unblock.

To achieve this, you must generate SHA256 hashes of the current legal documents and include these hashes when creating or updating user entities via the Unblock API. These hashes serve as proof that your users have agreed to the specific versions of the legal documents at the time of account creation or update.

How to Generate the Hashes

Follow these steps to generate the required SHA256 hashes for the Terms and Conditions, Privacy Policy, and Terms of Service documents.

  1. Fetch the Current Documents: Download the latest versions of the legal documents from the following URLs:

    Note: The S3 URLs point to the PDF documents used for hash generation. The getunblock.com URLs are provided for you to easily access and review the user-facing versions of these documents.

  2. Use the Provided Script (or your own): Utilize the following Javascript script (or implement a similar process in your preferred language) to generate the SHA256 hashes for each downloaded document.

    import { createHash } from "crypto"
    
    const prepareDoc = (doc) => {
        let tc = doc.trim();
        tc = tc.replace(/\s+/g, "");
        return tc
    }
    
    const getTermsAndConditions = async () => {
        const url = "https://getunblock.com/epmap-terms-of-service"; // Current one
        const response = await fetch(url);
        return response.text();
    
    }
    
    const getTermsOfService = async () => {
        const url = "<https://getunblock.com/terms-of-service>"; // Current one
        const response = await fetch(url);
        return response.text();
    }
    
    const getPrivacyPolicy = async () => {
        const url = "<https://www.getunblock.com/ub-privacy-and-policy>"; // Current one
        const response = await fetch(url);
        return response.text();
    }
    
    const hashLegalDocument = (legalDoc) => {
        const tc = prepareDoc(legalDoc);
        const hasher = createHash("sha256");
        hasher.update(tc);
        return hasher.digest("base64");
    }
    
    const hashLegalDocuments = async () => {
        const [termsAndConditions, termsOfService, privacyPolicy] = await Promise.all([
            getTermsAndConditions(),
            getTermsOfService(),
            getPrivacyPolicy()
        ])
    
        const termsAndConditionsHash = hashLegalDocument(termsAndConditions);
        const termsOfServiceHash = hashLegalDocument(termsOfService);
        const privacyPolicyHash = hashLegalDocument(privacyPolicy);
    
        return {
            termsAndConditionsHash,
            termsOfServiceHash,
            privacyPolicyHash
        }
    }
    

    Important: This script is a sample for demonstration purposes. You may need to adapt it to your specific development environment and language. Ensure your implementation correctly fetches the document content and generates SHA256 hashes in base64 format.

Using the Hashes in API Calls

These generated hashes must be included in the following API endpoints when creating or updating user entities:

Populate the following fields in the request body of these endpoints with the corresponding generated hashes:

  • accepted_terms_and_conditions_hash
  • accepted_privacy_policy_hash
  • accepted_terms_of_service_hash

Important Considerations

  • Document Updates: Unblock will notify you in advance of any changes to the legal documents. It is your responsibility to regenerate the document hashes using the updated documents and update these hashes in your system whenever new document versions are released.
  • Compliance Responsibility: Ensuring user entities have accepted the latest Terms and Conditions, Privacy Policy, and Terms of Service is a crucial compliance requirement for using the Unblock API. Failure to provide correct and up-to-date hashes may impact your compliance status and potentially the functionality of your integration.