newton.identity.<domain>.*. The KYC domain is the first implemented domain. A generic newton.identity.get(field_name) accessor works across any domain for ad-hoc field access.
For the full Rego syntax reference including all Newton extensions, see the Rego Syntax Guide.
KYC Data Fields
The following fields are available from the KYC identity data passed into the policy engine:| Field | Type | Description |
|---|---|---|
status | string | One of: created, pending, completed, approved, failed, expired, declined, needs review |
selected_country_code | string | The country code selected by the user during the KYC process |
address_subdivision | string | The state/subdivision from the document address |
address_country_code | string | The country from the document address |
birthdate | string | The user’s birthdate as a YYYY-MM-DD string |
expiration_date | string | The expiration date of the identity document |
issue_date | string | The issuance date of the identity document |
issuing_authority | string | The country or state that issued the document |
KYC Built-in Functions
| Function | Description |
|---|---|
newton.identity.kyc.check_approved | Check that the identity data has been approved |
newton.identity.kyc.address_in_countries | Check that the document country is in an allowed list |
newton.identity.kyc.address_in_subdivision | Check that the document address is in an allowed list of subdivisions |
newton.identity.kyc.address_not_in_subdivision | Check that the document address is not in an excluded list of subdivisions |
newton.identity.kyc.age_gte | Check that the user is at least a minimum age |
newton.identity.kyc.not_expired | Check that the identity document has not expired |
newton.identity.kyc.valid_for | Check that the document remains valid for a minimum number of days |
newton.identity.kyc.issued_since | Check that the document was issued at least a minimum number of days ago |
newton.identity.kyc.check_approved
Requires identity_data.status to equal "approved".
Signature:
| Type | Description |
|---|---|
bool | true if identity_data.status is "approved", otherwise false |
newton.identity.kyc.address_in_countries
Requires identity_data.address_country_code to be found within the provided list of country codes.
Signature:
| Argument | Type | Description |
|---|---|---|
country_code_array | string[] | Array of 2-letter ISO country codes to check against |
| Type | Description |
|---|---|
bool | true if the address country is within the list, otherwise false |
newton.identity.kyc.address_in_subdivision
Requires the ISO subdivision location code (combining address_country_code and address_subdivision) to be found within the provided list.
Signature:
| Argument | Type | Description |
|---|---|---|
iso_code_array | string[] | Array of XX-XX or XX-XXX ISO subdivision codes to match against |
| Type | Description |
|---|---|
bool | true if the address is within the list, otherwise false |
newton.identity.kyc.address_not_in_subdivision
Requires the ISO subdivision location code to not be found within the provided list. Useful for excluding specific subdivisions while allowing all others in a country (avoids submitting a long allowlist).
Signature:
| Argument | Type | Description |
|---|---|---|
iso_code_array | string[] | Array of XX-XX or XX-XXX ISO subdivision codes to exclude |
| Type | Description |
|---|---|
bool | true if the address is not in the list, otherwise false |
newton.identity.kyc.age_gte
Requires identity_data.birthdate to be at least the required number of years ago, relative to reference_date.
Signature:
| Argument | Type | Description |
|---|---|---|
min_age | number | Minimum age in years (must be positive) |
| Type | Description |
|---|---|
bool | true if the user’s age meets the minimum, otherwise false |
newton.identity.kyc.not_expired
Requires identity_data.expiration_date to be after the current date (reference_date).
Signature:
| Type | Description |
|---|---|
bool | true if the document expiration date is in the future, otherwise false |
newton.identity.kyc.valid_for
Requires identity_data.expiration_date to be at least the required number of days in the future, relative to reference_date.
Signature:
| Argument | Type | Description |
|---|---|---|
min_days | number | Minimum number of days the document must still be valid (must be positive) |
| Type | Description |
|---|---|
bool | true if the document will be valid for at least min_days, otherwise false |
newton.identity.kyc.issued_since
Requires identity_data.issue_date to be at least the required number of days in the past, relative to reference_date.
Signature:
| Argument | Type | Description |
|---|---|---|
min_days | number | Minimum number of days since the document was issued (must be positive) |
| Type | Description |
|---|---|
bool | true if the document was issued at least min_days ago, otherwise false |
Generic Field Accessor
newton.identity.get
Works across any identity domain. Returns the raw field value by name. Returns undefined if the field does not exist.
Signature:
| Argument | Type | Description |
|---|---|---|
field_name | string | The field name to look up |
| Type | Description |
|---|---|
| any / undefined | The field value, or undefined if the field does not exist |
Error Handling
- Address functions (
address_in_countries,address_in_subdivision,address_not_in_subdivision) return an error (and the rule evaluates toundefined) when:- Provided an empty array
- Provided full country/state names instead of ISO codes
- The stored country code or subdivision is empty
- Date functions (
age_gte,valid_for,issued_since) return an error if given negative numbers or if dates cannot be parsed.
undefined, which Newton treats as a denial.
Next Steps
Integration Guide
Step-by-step walkthrough for integrating Newton VC
SDK & Contract Reference
SDK methods and contract function signatures