Interface ISocureClient
Abstraction over the Socure identity verification API. Workflow-oriented methods that avoid leaking Socure-specific payload shapes into use cases. Backed by StubSocureClient in development, real HTTP client when credentials are available.
public interface ISocureClient
Methods
RunDocvStepupAssessmentAsync(Guid, string, string?, string?, string?, Address?, string?, CancellationToken)
Starts a fresh DocV step-up evaluation for a user who landed on Resubmit (DC-301).
Backed by the docv_stepup workflow, which only emits ACCEPT/REJECT — caps retries
at one by construction. Returns a brand-new transaction token + DocV URL; the caller
persists these on a new DocVerificationChallenge row.
Task<Result<IdProofingAssessmentResult>> RunDocvStepupAssessmentAsync(Guid userId, string email, string? phoneNumber = null, string? givenName = null, string? familyName = null, Address? address = null, string? diSessionToken = null, CancellationToken cancellationToken = default)
Parameters
userIdGuidInternal user ID for correlation.
emailstringUser's email address.
phoneNumberstringUser's phone number (drives Socure's SMS link), or null.
givenNamestringThe user's first name, or null.
familyNamestringThe user's last name, or null.
addressAddressThe user's mailing address from household data, or null.
diSessionTokenstringDevice Intelligence session token from the frontend SDK, or null to use config fallback.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<Result<IdProofingAssessmentResult>>
An assessment result whose Outcome should be DocumentVerificationRequired with a non-null DocvSession.
RunIdProofingAssessmentAsync(Guid, string, string, string?, string?, string?, string?, string?, string?, Address?, string?, CancellationToken)
Performs an ID proofing risk assessment based on user-provided identity data. Returns whether the user matched, needs document verification, or failed.
Task<Result<IdProofingAssessmentResult>> RunIdProofingAssessmentAsync(Guid userId, string email, string dateOfBirth, string? idType, string? idValue, string? ipAddress = null, string? phoneNumber = null, string? givenName = null, string? familyName = null, Address? address = null, string? diSessionToken = null, CancellationToken cancellationToken = default)
Parameters
userIdGuidInternal user ID for correlation.
emailstringUser's email address.
dateOfBirthstringUser's date of birth (yyyy-MM-dd).
idTypestringType of government ID provided (ssn, itin, etc.), or null.
idValuestringThe ID value, or null.
ipAddressstringThe user's IP address from the HTTP request, or null.
phoneNumberstringThe user's phone number, or null.
givenNamestringThe user's first name, or null.
familyNamestringThe user's last name, or null.
addressAddressThe user's mailing address from household data, or null.
diSessionTokenstringDevice Intelligence session token from the frontend SDK, or null to use config fallback.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<Result<IdProofingAssessmentResult>>
A result indicating the assessment outcome.
StartDocvSessionAsync(Guid, string, CancellationToken)
Starts a Socure DocV session for document capture. Generates a short-lived transaction token. Called just-in-time when the user is ready to start document capture.
Task<Result<SocureDocvSession>> StartDocvSessionAsync(Guid userId, string email, CancellationToken cancellationToken = default)
Parameters
userIdGuidInternal user ID.
emailstringUser's email address.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<Result<SocureDocvSession>>
A session containing the DocV transaction token and URL.