---
title: "Verify the holder"
description: "Holder checks before creating an Amplia Reg order: the RFB prior query, the biometric enrollment check and the phone number validation."
canonical: "https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/verify-holder"
locale: "en"
product: "Amplia Reg"
last_updated: "2026-11-17"
---

# Verify the holder

Some orders require a check of the holder's data before you [create the order](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/create-order):

| Check | When to run it |
|---|---|
| [RFB prior query](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/verify-holder#rfb-query) | Optional: the order creation runs the query when the instance has the query configured |
| [Biometric enrollment check](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/verify-holder#bio-enrollment-check) | Orders issued by videoconference for a holder without a driver's license (CNH) |
| [Phone number validation](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/verify-holder#phone-validation) | Optional: catches an invalid phone number before the order is created |

## RFB prior query

The prior query of the Brazilian Revenue Service (RFB) is a setting of the instance. If the instance has the query configured, the order
creation runs the query automatically. You do not have to call this API first. If the query rejects the data, the order creation responds
with an [error code](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/error-codes), for example `RfbQueryNotApproved` or `RfbQueryNameMismatch`.

Call this API only to check the data before you create the order. For example, you can show the reason for a rejection while the customer
fills in your form.

**.NET**

```cs
var rfbResponse = await ampliaRegService.PerformRfbQueryAsync(
	"07917307000", // Holder's CPF
	"1995-10-15", // Holder's birth date in yyyy-mm-dd format
	"08271696000100" // CNPJ (omit for e-CPF)
);
```

**REST**

```js
POST /api/rfb-query
{
	"cpf": "07917307000", // Holder's CPF
	"birthDate": "1995-10-15", // Holder's birth date in yyyy-mm-dd format
	"cnpj": "08271696000100" // CNPJ (omit for e-CPF)
}
```

**curl**

```bash
curl -X POST "https://ampliareg.yourcompany.com/api/rfb-query" \
  -H "X-Api-Key: your-app|YOUR_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @body.json
```

Content of `body.json`:

```json
{
  "cpf": "07917307000",
  "birthDate": "1995-10-15",
  "cnpj": "08271696000100"
}
```

> **Note**
>
> Send the CPF and the CNPJ without punctuation (digits only) and with their leading zeros, if any.

The response shows if the certificate can be issued with the data that you sent. If the query approves the data, the response also has
the full name that must appear on the certificate. For an organizational certificate, it also has the company name. Use these values when you
create the order. If the query rejects the data, the `failure` field has the reason in a message in Portuguese. You can show this message to the user.

Example response with approval:

```js
{
	"approved": true, // the certificate CAN be issued with the data sent
	"returnCode": "00",
	"failure": null,
	"name": "John Doe", // holder's full name that must appear on the certificate
	"organizationName": "Patorum Sistemas LTDA" // company name that must appear on the certificate
}
```

Example response with rejection:

```js
{
	"approved": false, // the certificate CANNOT be issued with the data sent
	"returnCode": "02", // two-digit code returned by the RFB prior query API; "00" means approved
	"failure": "CPF informado inexistente nas bases de dados da SRF. Emissão do certificado não permitida.",
	"name": null,
	"organizationName": null
}
```

If the RFB prior query is not configured on the instance, the API responds with the `RfbQueryIsDisabled` [error code](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/error-codes).

## Biometric enrollment check

For an order with issuance by videoconference, ask the holder if they have a driver's license (CNH). Send the answer in the
`holderHasCnh` field when you create the order. If the holder has no driver's license, call the API below to find out if the holder has a
biometric enrollment in PSBio. Without a biometric enrollment, the certificate cannot be issued by videoconference.

> **Warning**
>
> If the instance uses PSBio and the holder has no biometric enrollment, an omitted `holderHasCnh` counts as "no driver's license". In this
> case, the validation declines the videoconference order automatically. Always send `holderHasCnh` in videoconference orders.

**.NET**

```cs
var checkBioEnrollmentResponse = await ampliaRegService.CheckBioEnrollmentAsync(
	"07917307000" // Holder's CPF
);
if (!checkBioEnrollmentResponse.IsEnrolled) {
	throw new Exception("Issuance by videoconference cannot be performed!");
}
```

**REST**

```js
POST /api/bio-enrollment-check
{
	"cpf": "07917307000" // Holder's CPF
}
```

**curl**

```bash
curl -X POST "https://ampliareg.yourcompany.com/api/bio-enrollment-check" \
  -H "X-Api-Key: your-app|YOUR_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @body.json
```

Content of `body.json`:

```json
{
  "cpf": "07917307000"
}
```

Response:

```js
{
	"isEnrolled": true // whether the holder has a biometric enrollment
}
```

If the biometric integration (PSBio) is not configured on the instance, the API responds with the `PSBioDisabled` [error code](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/error-codes).

## Phone number validation

Amplia Reg sends text messages to the holder, for example issue key 2 when the order is approved. For this reason, the phone number
of the order must be valid. Order creation rejects an invalid phone number. To find the problem earlier, for example while the customer
fills in your form, check the number with the validation API.

Any API key can call this API: it does not require a specific role.

**.NET**

```cs
bool isValid = await ampliaRegService.ValidatePhoneNumberAsync("+5511999990000");
if (!isValid) {
	// Ask the customer to correct the phone number
}
```

**REST**

```plaintext
GET /api/users/phone-number/validation?phoneNumber=%2B5511999990000
```

**curl**

```bash
curl "https://ampliareg.yourcompany.com/api/users/phone-number/validation?phoneNumber=%2B5511999990000" \
  -H "X-Api-Key: your-app|YOUR_KEY"
```

The response body is `true` if the number is valid and `false` otherwise.

> **Note**
>
> Encode the number in the query string. Send the `+` of the international prefix as `%2B`. If you send `+`, the API reads it as a space.
> The .NET library does this encoding for you.

The API applies the same check that order creation applies to the `phone` and `alternativePhone` fields of `contact`. Order creation
also accepts a number that the API accepts.

* **Country code**: the number must include the country code, as in `+5511999990000`. The leading `+` is optional, but the country code
  is mandatory. Without the country code, the API reads the first digits of the number as the country code. For example, the API reads
  `11999990000` as a number from country code 1 (United States and Canada) and rejects it.
* **Numbering plan**: the number must be valid for its country, with the right length and a valid area code and prefix.
* **Paraguay**: the API also accepts Paraguayan mobile numbers (`+595 9XX XXX XXX`) when the numbering plan does not recognize them yet.
* **Formatting**: the API allows spaces, parentheses and hyphens, as in `+55 (11) 99999-0000`.

The check does not confirm that the line exists, or that it belongs to the holder.

> **Warning**
>
> An empty or missing `phoneNumber` returns `true`, because the API rejects only the numbers that it can identify as wrong. Check for
> empty values in your application.

Tips:

* **Ask for a mobile number** in the `phone` field. A valid landline passes the check. But Amplia Reg sends one-time codes by SMS,
  for example to let the holder join a videoconference or start a video identification. These codes can go only to a mobile number.
* **Send the number in E.164 format** (`+5511999990000`, digits only after the `+`). Amplia Reg stores the phone number
  as you sent it.

## See also

* [Create an order](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/create-order)
* [Pre-approved orders](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/preapproved-orders)
* [Error codes](https://docs.lacunasoftware.com/en-us/articles/amplia-reg/integration/error-codes)
