Pular para o conteúdo principal

Pre-fill the holder data

After your application creates an order, it can send the holder's address, identity document and contact. In validation, the form of the validation agent opens with this data filled in.

Before you start​

  • An API key of an application with the Sales app role. See Application roles.
  • The number of an order in the Waiting validation (WaitingValidation) status. See Create an order.
  • The holder data that your application collected. No holder field is mandatory.

When you can call the API​

The API accepts the call only while the order is in Waiting validation. Orders with the Presential and VideoConference issue types start in this status. An order with the VideoIdentification issue type gets this status when the holder completes the video identification.

After an agent starts the validation, the API rejects the call. See Common errors.

Send the holder data​

Send the request to the route of the order format, with the order number in the URL. For the ICP-Brasil format, the route is PUT /api/brazil/orders/{number}/holder/pre-fill. In .NET, call PreFillHolderAsync.

await ampliaRegService.PreFillHolderAsync("800-005-520", new UpdateHolderInformationRequest<BrazilUpdateHolderParameters>() {
Parameters = new BrazilUpdateHolderParameters() {
Address = new BrazilHolderAddressRequest() {
ZipCode = "12345678", // Postal code (CEP), digits only
Street = "Rua das Palmeiras", // Street
Number = "120",
Complement = "Sala 4",
District = "Jardim das Flores", // District
City = "São Paulo",
StateCode = "SP", // State abbreviation
Country = "Brazil",
},
Identification = "123456789", // Identity document number
IdentificationType = BrazilIdentificationTypes.Rg, // or BrazilIdentificationTypes.Cnh
IdentificationExpediter = "SSP", // Issuing agency
IdentificationFederativeUnit = "SP", // State that issued the document
},
Contact = new ContactData() {
EmailAddress = "ana.souza@example.com", // Holder's email
Phone = "+5511999990000", // Holder's phone number, with the country code
},
});

Request fields​

In .NET, the request is an UpdateHolderInformationRequest<BrazilUpdateHolderParameters>.

FieldRequiredDescription
parametersYesHolder data in the format of the order. It can be an empty object. See Fields of parameters
contactNoHolder's contact. See Fields of contact
customerAccountIdNoID of the customer account of the order. The account must be enabled and must belong to the certification authority of the order

Fields of parameters in the ICP-Brasil format​

In .NET, the class is BrazilUpdateHolderParameters. All fields are optional.

FieldDescription
addressHolder's address. See Fields of address
identificationNumber of the holder's identity document (maximum 20 characters)
identificationTypeType of the identity document: Rg or Cnh
identificationExpediterAgency that issued the identity document (maximum 10 characters)
identificationFederativeUnitAbbreviation of the state that issued the identity document, for example SP
nisHolder's NIS (PIS, PASEP or CI) number. Digits only, maximum 11
ceiHolder's CEI number. Digits only, maximum 12
caepfHolder's CAEPF number. Digits only, maximum 14

Fields of address​

In .NET, the class is BrazilHolderAddressRequest. All fields are optional.

FieldDescription
zipCodePostal code (CEP) with 8 digits and no hyphen
streetStreet (maximum 200 characters)
numberNumber (maximum 50 characters)
complementAddress complement (maximum 200 characters)
districtDistrict (maximum 200 characters)
cityCity (maximum 100 characters)
stateCodeState abbreviation, for example SP
countryCountry. Use Brazil, the value that the control panel writes

Fields of contact​

In .NET, the class is ContactData. All fields are optional.

FieldDescription
emailAddressHolder's email (maximum 200 characters)
phoneHolder's phone number with the country code, for example +5511999990000 (maximum 25 characters). See Phone number validation
alternativeEmailAddressHolder's alternative email (maximum 200 characters)
alternativePhoneHolder's alternative phone number, in the same format as phone

If the holder email validation is enabled in the instance, Amplia Reg ignores the two alternative fields.

Data that the call replaces​

The call writes all the fields of parameters at the same time. If the request omits a field, that field becomes empty in the order. Always send the full set of holder data.

The contact field has a different rule. If the request omits contact, the order keeps its current contact. If the request sends contact, the four contact fields of the order get the values that you send.

If the request omits customerAccountId, the order has no customer account after the call.

Response​

The response has HTTP status 200 and no body. In .NET, PreFillHolderAsync returns no value.

Common errors​

CodeWhen it happens
OrderNotFoundNo order has the given number
OrderAlreadyInitializedThe order left Waiting validation, for example to Waiting confirmation, or it is still in Waiting video identification
OrderInValidationByOtherAgentAn agent started the validation. The order is in In validation or Pending
OrderInConfirmationByOtherAgentThe order is in In confirmation
OrderCannotUpdateThe order is in Issued, Revoked, Canceled or Declined
InvalidStatestateCode or identificationFederativeUnit is not the abbreviation of a Brazilian state
PrimaryEmailInUseForAnotherPerson, AlternativeEmailInUseForAnotherPerson, BothEmailsInUseForAnotherPersonThe instance allows only one person for each email address, and an email in contact belongs to a different holder
CantChangeEmailThatIsVerifiedThe holder validated the email of the order, and the request sends a different emailAddress
CannotUpdateHolderContactThe order was in Pending, and the request changes the contact
CustomerAccountNotFound, CustomerAccountIsDisabledThe customer account in customerAccountId does not exist or is disabled
CertificationAuthorityMismatchThe customer account belongs to a different certification authority

If a value has an incorrect format, such as an invalid phone number, the API returns a validation error. See HTTP status codes.

Routes of the other formats​

Use the route of the order format. In .NET, PreFillHolderAsync selects the route from the class of Parameters.

FormatRouteparameters class (.NET)
ICP-BrasilPUT /api/brazil/orders/{number}/holder/pre-fillBrazilUpdateHolderParameters
ParaguayPUT /api/paraguay/orders/{number}/holder/pre-fillParaguayUpdateHolderParameters
Cabo VerdePUT /api/cabo-verde/orders/{number}/holder/pre-fillCaboVerdeUpdateHolderParameters
SSLPUT /api/ssl/orders/{number}/holder/pre-fillSslUpdateHolderParameters

See also​

View as Markdown