PIX uses PIX keys to send payments from one end to another. The PIX key is previously created by the end user and is attached to a bank account by the payee, replacing the payee’s bank account data on TED or DOC transactions.
The key can be represented by the payee’s document number, phone number, email address, or even a random key generated by the payee’s bank itself.
That’s why the items[].destination.key is a flexible field - it can be filled with all the possible key formats. The application checks whether the provided data matches one of the expected data formats mentioned above, and it does that by passing the data through a set of validations based on the following rules:
Key type | Regular Expression (ECMAScript (JavaScript)) | Example |
---|---|---|
CPF | ^[0-9]{11}$ | 12345678901 |
CNPJ | ^[0-9]{14}$ | 12345678901234 |
Phone | ^\+[1-9][0-9]\d{1,14}$ | +5511987654321 |
^[a-z0-9.!#$&'*+\/=?^_ {}~-]+@[a-z0-9?(?:.a-z0-9?)]*$` | [email protected] | |
Random | [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} | 123e4567-e89b-12d3-a456-426655440000 |
Country code required for Phone PIX keys
When providing a phone number as a key, it MUST be provided with the country IDD (International Direct Dialing) at the beginning of the number.
For Brazillian phone numbers, for example, the field should start with “+55”.