# Penny Validation Introduction

Penny validation is a method Belvo uses to confirm that a bank account exists and is owned by a specific individual or entity.

```mermaid
sequenceDiagram
    autonumber
    participant Client as Client
    participant Belvo as Belvo
    participant Provider as Provider

    Client->>Belvo: Create a customer
    Belvo-->>Client: 201 - Customer Created
    Client->>Belvo: Create a payment method
    Belvo-->>Client: 201 - Payment Method Created
    Belvo->>Provider: Send "penny" to registered bank account
    Provider-->>Belvo: CEP generated
    rect rgba(0, 0, 0, .03)
        Note over Client,Provider: Belvo validates information in CEP against information provided when creating customer
        Note over Client,Provider: Belvo updates status of Payment Method
    end
    Belvo-->>Client: Belvo sends Payment Method status
```

The general flow of Belvo’s penny validation is:

1. You create a customer and a payment method.
2. Belvo sends a “penny" (centavo) using SPEI to the account specified when you created the payment method.
3. An Electronic Payment Receipt (*Comprobante Electrónico de Pago*, CEP) is generated for the transaction and Belvo retrieves the data from the document.
4. Belvo compares the owner information from the CEP against the information that you provided when creating the customer to verify the given account.


## Penny validation for Payment Methods (API)

1. You create a customer.
2. You create a Payment Method for the customer.
3. The Payment Method status is set to `pending_agreement_acceptance` .
4. Once the agreement is accepted, the status of the Payment Method is set to `pending_validation`.
5. Belvo sends the “penny" to the account registered in Step 2.
6. An Electronic Payment Receipt (*Comprobante Electrónico de Pago*, CEP) is generated for the transaction and Belvo retrieves the data from the document.
7. Belvo compares the `documentType` and `documentNumber` provided in Step 1 against the information provided in the CEP.
  1. If the information is the same, the status of the Payment Method is set to `active`.
  2. If the information is not the same, the status of the Payment Method is set to `error`. You will receive `payment_method_registration_failed` webhook with the following failure information:

```json Penny Validation Error
{
  "eventType": "payment_method_update",
  "eventCode": "payment_method_registration_failed",
  "datetime": "2022-01-01T12:34:56.789Z",
  "details": {
    "id": "3118128a-6792-4b06-bd61-4acf6f6ad6b5", // [!code highlight]
    "reference": "your_reference_here",
    "status": "error",
    "failedReason": "account_validation_failed",
    "failedMessage": "Account owner validation was not successful"
  }
}
```


## Penny validation using Batch Imports

1. You submit your CSV for Bulk Import Direct Debit Payments.
2. If required, Belvo creates the associated customers for each row in your CSV.
3. Belvo creates a Payment Method for each new customer (that is, for any customer that was not previously registered with the same information).
4. The status of the Payment Method status is set to `pending_validation` .
5. Belvo sends the “penny" to the account registered in Step 3.
6. An Electronic Payment Receipt (*Comprobante Electrónico de Pago*, CEP) is generated for the transaction and Belvo retrieves the data from the document.
7. Belvo compares the `documentType` and `documentNumber` provided when creating the customer against the information provided in the CEP.
  1. If the information is the same, the status of the Payment Method is set to `active`.
  2. If the information is not the same, the status of the Payment Method is set to `failed`. In our UI, you will see the failure reason (`validation_failed`) along with a message detailing the reason behind the failure (`Account owner validation was not successful`).