> ## Documentation Index
> Fetch the complete documentation index at: https://docs.localpayment.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ricevere le notifiche di pagamento

Ricevi notifiche webhook immediate per ogni pagamento su un conto virtuale, aggiorna i tuoi sistemi e conferma gli accrediti in modo automatico.

Dopo aver creato un conto virtuale e averlo associato a un cliente o a una fattura specifici nei tuoi sistemi interni, Localpayment invia automaticamente una notifica webhook al tuo server ogni volta che un pagamento viene ricevuto correttamente su quel conto.

**Importante**: un conto virtuale funge da destinazione di pagamento dedicata. Anche se sei tu a gestirne l'attribuzione interna, il numero di conto in sé può ricevere fondi da qualsiasi pagatore. La notifica di pagamento contiene i dati del pagatore effettivo, così puoi riconciliare il pagamento con l'associazione interna dei tuoi clienti.

Queste notifiche in tempo reale ti consentono di confermare automaticamente gli accrediti, aggiornare i saldi e riconciliare i pagamenti senza verifiche manuali.

***

## Prima di iniziare

Assicurati di:

* Aver creato correttamente un conto virtuale tramite l'endpoint [Creare un conto virtuale](https://docs.localpayment.com/it/reference/create-virtual-account.md).
* Aver configurato un endpoint di notifica (URL del webhook) nel tuo account esercente.
* Poter ricevere richieste HTTPS POST dai server di Localpayment.
* Disporre nel tuo backend della logica per convalidare e analizzare in modo sicuro i payload dei webhook.

***

## Come funziona

1. Un pagatore invia un bonifico al numero del conto virtuale generato in precedenza dal tuo sistema.
2. Una volta che i fondi sono stati accreditati e convalidati da Localpayment, viene inviata una notifica di PayIn all'endpoint webhook che hai configurato.
3. Il tuo sistema deve confermare la ricezione della notifica con una risposta 200 OK.
4. Puoi quindi aggiornare i tuoi registri interni per contrassegnare il conto virtuale come pagato o l'ordine corrispondente come evaso.

> [!NOTE]
>
> ###
>
> Localpayment garantisce la consegna tramite nuovi tentativi con backoff esponenziale se il tuo server non risponde con HTTP 200.

***

## Esempio di notifica (payload del webhook)

Di seguito trovi un payload di esempio per un pagamento riuscito accreditato su un conto virtuale:

```json ARG theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "transactionType": "PayIn",
  "transactionFlow": null,
  "country": "ARG",
  "data": {
      "transactionType": "PayIn",
      "externalId": "59a61a76-2480-4996-8633-528227e1db10",
      "internalId": "5aced5da-40c1-4bec-85ff-c8cd1bcb4526",
      "paymentMethod": {
          "type": "BankTransfer",
          "code": "1025",
          "flow": "DIRECT"
      },
      "country": "ARG",
      "currency": "ARS",
      "amount": 1.09,
      "accountNumber": "{{accountNumber}}",
      "confirmed": {
          "currency": "ARS",
          "fxQuote": 1,
          "amount": 1.09
      },
      "payment": {
          "currency": "ARS",
          "fxQuote": 1,
          "financingFee": 0,
          "amount": 1.09
      },
      "localTaxes": [
          {
              "code": "0001",
              "percentage": 1.2,
              "description": "IDC",
              "currency": "ARS",
              "fxSource": 1193.82,
              "fxQuote": 0,
              "amount": 0.01,
              "account": "{{accountNumber}}"
          }
      ],
      "withHoldings": [],
      "fees": {
          "description": "Fee",
          "currency": "ARS",
          "fxSource": 1170.50002,
          "fxQuote": 1,
          "amount": 0,
          "account": "{{accountNumber}}"
      },
      "status": {
          "code": "200",
          "description": "COMPLETED",
          "detail": "The payin was credited"
      },
      "beneficiary": {
          "type": "INDIVIDUAL",
          "name": "John",
          "lastName": "Doe",
          "fullName": "John Doe",
          "document": {
              "type": "CUIT",
              "id": "20314567894"
          },
          "bank": {
              "account": {
                  "number": "0000369600000000123456"
              }
          },
          "informedName": "Unknown"
      },
      "merchant": {
          "type": "MERCHANT",
          "name": "Localpayment Test",
          "lastName": ""
      },
      "payer": {
          "type": "INDIVIDUAL",
          "name": "Carlos",
          "lastName": "Mendez",
          "fullName": "Carlos Mendez",
          "document": {
              "type": "CUIT",
              "id": "20314567894"
          },
          "email": "carlos.mendez@email.com",
          "bank": {
              "name": "BANCO DE GALICIA Y BUENOS AIRES S.A.U.",
              "code": "007",
              "branch": {},
              "account": {
                  "type": "C",
                  "number": "0070055930004044654321"
              }
          }
      },
      "date": {
          "creationDate": "2025-04-30T17:26:37.186",
          "processedDate": "2025-04-30T17:26:37.363"
      },
      "errors": [],
      "referenceCode": "DHF2-XOHO-NE77",
      "tracking": {
          "id": "7L8GYKNXWJELWYGP2MPRZ5",
          "reference": "7L8GYKNXWJELWYGP2MPRZ5",
          "concept": "CVU TEST"
      }
  }
}
```

```json BRA theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "transactionType": "PayIn",
  "transactionFlow": null,
  "country": "BRA",
  "data": {
      "transactionType": "PayIn",
      "externalId": "d96a9440-afe2-453f-a3b5-155a7fb17241",
      "internalId": "d220f7cc-e2cd-4b40-95ae-59d85bf68a7e",
      "paymentMethod": {
          "type": "BankTransfer",
          "code": "1350",
          "flow": "DIRECT"
      },
      "country": "BRA",
      "currency": "BRL",
      "amount": 55554.63,
      "accountNumber": "{{accountNumber}}",
      "confirmed": {
          "currency": "BRL",
          "fxQuote": 1,
          "amount": 55554.63
      },
      "payment": {
          "currency": "BRL",
          "fxQuote": 1,
          "financingFee": 0,
          "amount": 55554.63
      },
      "localTaxes": [
          {
              "code": "0002",
              "percentage": 0.38,
              "description": "IOF",
              "currency": "BRL",
              "fxSource": 5.5813,
              "fxQuote": 0,
              "amount": 211.11,
              "account": "{{accountNumber}}"
          }
      ],
      "withHoldings": [],
      "fees": {
          "description": "Fee",
          "currency": "BRL",
          "fxSource": 5.80427174,
          "fxQuote": 1,
          "amount": 55.55,
          "account": "{{accountNumber}}"
      },
      "status": {
          "code": "200",
          "description": "COMPLETED",
          "detail": "The payin was credited"
      },
      "beneficiary": {
          "type": "INDIVIDUAL",
          "name": "Rafael",
          "lastName": "Oliveira",
          "fullName": "Rafael Oliveira",
          "document": {
              "type": "CPF",
              "id": "12345678909"
          },
          "bank": {
              "code": "450",
              "branch": {},
              "account": {
                  "number": "52415912345",
                  "alias": "cf226732-139c-4ec8-b672-8aa0fc7ee6ea",
                  "aliases": [
                      {
                          "value": "cf406732-139c-4ec8-b672-8aa0fc7ee6ea"
                      }
                  ]
              }
          }
      },
      "merchant": {
          "type": "COMPANY",
          "name": "ACME"
      },
      "payer": {
          "type": "INDIVIDUAL",
          "name": "Rafael",
          "lastName": "Oliveira",
          "fullName": "Rafael Oliveira",
          "document": {
              "type": "CPF",
              "id": "12345678909"
          },
          "email": "rafael.oliveira@email.com",
          "bank": {
              "code": "001",
              "branch": {},
              "account": {
                  "type": "C",
                  "number": "45063"
              }
          }
      },
      "date": {
          "creationDate": "2025-04-17T17:01:52.850",
          "processedDate": "2025-04-17T17:01:53.025"
      },
      "errors": [],
      "referenceCode": "5XWA-MGQ0-ZKZ6",
      "tracking": {
          "id": "E0000000022250417170028008753346",
          "reference": "",
          "concept": "11778498595"
      }
  }
}
```

```json CHL theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "transactionType": "PayIn",
  "transactionFlow": null,
  "country": "CHL",
  "data": {
      "transactionType": "PayIn",
      "externalId": "c3f819ba-240a-47cd-8cbe-e95a43e1552d",
      "internalId": "e8da1f0e-38ef-46b9-8360-4d40f78605af",
      "paymentMethod": {
          "type": "BankTransfer",
          "code": "2550",
          "flow": "DIRECT"
      },
      "country": "CHL",
      "currency": "CLP",
      "amount": 100,
      "accountNumber": "{{accountNumber}}",
      "confirmed": {
          "currency": "CLP",
          "fxQuote": 1,
          "amount": 100
      },
      "payment": {
          "currency": "CLP",
          "fxQuote": 1,
          "financingFee": 0,
          "amount": 100
      },
      "localTaxes": [],
      "withHoldings": [],
      "fees": {
          "description": "Fee",
          "currency": "CLP",
          "fxSource": 967.340406,
          "fxQuote": 1,
          "amount": 0,
          "account": "{{accountNumber}}"
      },
      "status": {
          "code": "200",
          "description": "COMPLETED",
          "detail": "The payin was credited"
      },
      "beneficiary": {
          "type": "INDIVIDUAL",
          "name": "Valentina",
          "lastName": "Rojas",
          "fullName": "Valentina Rojas",
          "document": {
              "type": "RUT",
              "id": "123456789"
          },
          "bank": {
              "name": "Banco Security",
              "code": "049",
              "branch": {},
              "account": {
                  "type": "C",
                  "number": "928630123"
              }
          }
      },
      "merchant": {
          "type": "COMPANY",
          "name": "Localpayment Test"
      },
      "payer": {
          "type": "INDIVIDUAL",
          "name": "Valentina",
          "lastName": "Rojas",
          "fullName": "Valentina Rojas",
          "document": {
              "type": "RUT",
              "id": "123456789"
          },
          "email": "valentina.rojas@email.com",
          "bank": {
              "name": "BANCO DE CRÉDITO E INVERSIONES (BCI)",
              "code": "016",
              "branch": {},
              "account": {
                  "type": "C",
                  "number": "57229123"
              }
          },
          "userReference": "Test 928630996"
      },
      "date": {
          "creationDate": "2025-07-16T16:12:50.163",
          "processedDate": "2025-07-16T16:12:50.396"
      },
      "errors": [],
      "referenceCode": "QSR5-FE1Y-DIVT",
      "tracking": {
          "id": "000739531483",
          "reference": "2025-07-16-12.10.09.237295",
          "concept": "Test 928630996"
      }
  }
}
```

```json COL theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "transactionType": "PayIn",
  "transactionFlow": null,
  "country": "COL",
  "data": {
      "transactionType": "PayIn",
      "externalId": "cf194632-7ec4-4a44-9b92-9bbacad5349a",
      "internalId": "b97ac13c-1acb-4bc0-8b2a-067945e26161",
      "paymentMethod": {
          "type": "BankTransfer",
          "code": "2006",
          "flow": "DIRECT"
      },
      "country": "COL",
      "currency": "COP",
      "amount": 1000,
      "accountNumber": "{{accountNumber}}",
      "confirmed": {
          "currency": "COP",
          "fxQuote": 1.0,
          "amount": 1000.0
      },
      "payment": {
          "currency": "COP",
          "fxQuote": 1.0,
          "financingFee": 0.0,
          "amount": 1000.0
      },
      "localTaxes": [],
      "withHoldings": [],
      "fees": {
          "description": "Fee",
          "currency": "COP",
          "fxSource": 3705.82,
          "fxQuote": 1.0,
          "amount": 1.0,
          "account": "{{accountNumber}}"
      },
      "status": {
          "code": "200",
          "description": "COMPLETED",
          "detail": "The payin was credited"
      },
      "beneficiary": {
          "type": "INDIVIDUAL",
          "name": "Andres",
          "lastName": "Herrera",
          "fullName": "Andres Herrera",
          "document": {
              "type": "CC",
              "id": "1020456789"
          },
          "bank": {
              "name": "BANCO DE BOGOTÁ",
              "code": "1001",
              "account": {
                  "type": "KEY",
                  "number": "@XXXXXXXOXX0000"
              }
          }
      },
      "merchant": {
          "type": "COMPANY",
          "name": "Test company",
          "lastName": ""
      },
      "payer": {
          "type": "INDIVIDUAL",
          "name": "Andres",
          "lastName": "Herrera",
          "fullName": "Andres Herrera",
          "document": {
              "type": "CC",
              "id": "1020456789"
          },
          "email": "andres.herrera@email.com",
          "bank": {
              "name": "BANCO POPULAR",
              "code": "1002",
              "account": {
                  "type": "BREB",
                  "number": "signer:wTUTnHK5mLAQXLgVuhoANKGaKTdgRFmrx7@breb"
              }
          }
      },
      "date": {
          "creationDate": "2026-02-25T18:53:25Z",
          "processedDate": "2026-02-25T18:53:26Z"
      },
      "errors": [],
      "referenceCode": "V0ZO-AIPV-NOD9",
      "tracking": {
          "id": "20260225900504001TFY123451234501234",
          "reference": "20260225900504001TFY123451234501234",
          "concept": "Test payment"
      }
  }
}
```

```json CRI-CRC theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "transactionType": "PayIn",
  "transactionFlow": null,
  "country": "CRI",
  "data": {
    "transactionType": "PayIn",
    "externalId": "bc56ff3e-5291-40e9-89e1-ef258b6095a9",
    "internalId": "c06bbea8-48d1-4659-9664-633b7f9f080d",
    "paymentMethod": {
      "type": "BankTransfer",
      "code": "1420",
      "flow": "DIRECT"
    },
    "country": "CRI",
    "currency": "CRC",
    "amount": 500,
    "accountNumber": "{{accountNumber}}",
    "confirmed": {
      "currency": "CRC",
      "fxQuote": 1.0,
      "amount": 500.0
    },
    "payment": {
      "currency": "CRC",
      "fxQuote": 1.0,
      "financingFee": 0.0,
      "amount": 500.0
    },
    "localTaxes": [],
    "withHoldings": [],
    "grossingUps": [],
    "fees": {
      "description": "Fee",
      "currency": "CRC",
      "fxSource": 453.811158,
      "fxQuote": 1.0,
      "amount": 0.0,
      "account": "{{accountNumber}}"
    },
    "status": {
      "code": "200",
      "description": "COMPLETED",
      "detail": "The payin was credited"
    },
    "beneficiary": {
      "type": "COMPANY",
      "name": "LP MERGE SRL",
      "document": {
        "type": "CEJ",
        "id": "3100000001"
      },
      "bank": {
        "account": {
          "number": "CR99000000000000000001"
        }
      }
    },
    "merchant": {
      "type": "COMPANY",
      "name": "LP MERGE SRL"
    },
    "payer": {
      "type": "INDIVIDUAL",
      "name": "John",
      "lastName": "Doe",
      "document": {
        "type": "CI",
        "id": "01-0100-0001"
      },
      "email": "NA",
      "bank": {
        "name": "Banco Nacional de Costa Rica",
        "code": "0102",
        "branch": {
          "code": "",
          "name": ""
        },
        "account": {
          "number": "CR99000000000000000002"
        }
      }
    },
    "date": {
      "creationDate": "2026-06-22T14:46:18Z",
      "processedDate": "2026-06-22T14:46:19Z"
    },
    "errors": [],
    "referenceCode": "IQCT-J9P2-WZRG",
    "tracking": {
      "id": "2026062210222010504969350",
      "reference": "26736337",
      "concept": "Steph_test_____"
    }
  }
}
```

```json CRI-USD theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "transactionType": "PayIn",
  "transactionFlow": null,
  "country": "CRI",
  "data": {
    "transactionType": "PayIn",
    "externalId": "bc56ff3e-5291-40e9-89e1-ef258b6095a9",
    "internalId": "c06bbea8-48d1-4659-9664-633b7f9f080d",
    "paymentMethod": {
      "type": "BankTransfer",
      "code": "1421",
      "flow": "DIRECT"
    },
    "country": "CRI",
    "currency": "USD",
    "amount": 500,
    "accountNumber": "{{accountNumber}}",
    "confirmed": {
      "currency": "USD",
      "fxQuote": 1.0,
      "amount": 500.0
    },
    "payment": {
      "currency": "USD",
      "fxQuote": 1.0,
      "financingFee": 0.0,
      "amount": 500.0
    },
    "localTaxes": [],
    "withHoldings": [],
    "grossingUps": [],
    "fees": {
      "description": "Fee",
      "currency": "USD",
      "fxSource": 453.811158,
      "fxQuote": 1.0,
      "amount": 0.0,
      "account": "{{accountNumber}}"
    },
    "status": {
      "code": "200",
      "description": "COMPLETED",
      "detail": "The payin was credited"
    },
    "beneficiary": {
      "type": "COMPANY",
      "name": "LP MERGE SRL",
      "document": {
        "type": "CEJ",
        "id": "3100000001"
      },
      "bank": {
        "account": {
          "number": "CR99000000000000000001"
        }
      }
    },
    "merchant": {
      "type": "COMPANY",
      "name": "LP MERGE SRL"
    },
    "payer": {
      "type": "INDIVIDUAL",
      "name": "John",
      "lastName": "Doe",
      "document": {
        "type": "CI",
        "id": "01-0100-0001"
      },
      "email": "NA",
      "bank": {
        "name": "Banco Nacional de Costa Rica",
        "code": "0102",
        "branch": {
          "code": "",
          "name": ""
        },
        "account": {
          "number": "CR99000000000000000002"
        }
      }
    },
    "date": {
      "creationDate": "2026-06-22T14:46:18Z",
      "processedDate": "2026-06-22T14:46:19Z"
    },
    "errors": [],
    "referenceCode": "IQCT-J9P2-WZRG",
    "tracking": {
      "id": "2026062210222010504969350",
      "reference": "26736337",
      "concept": "Steph_test_____"
    }
  }
}
```

```json MEX (SPEI) theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "transactionType": "PayIn",
  "transactionFlow": null,
  "country": "MEX",
  "data": {
      "transactionType": "PayIn",
      "externalId": "c2eabb54-6314-414d-9bdc-1004fba09737",
      "internalId": "72b3e90d-22ec-4afd-a360-f3a08301c660",
      "paymentMethod": {
          "type": "BankTransfer",
          "code": "1630",
          "flow": "DIRECT"
      },
      "country": "MEX",
      "currency": "MXN",
      "amount": 1000,
      "accountNumber": "{{accountNumber}}",
      "confirmed": {
          "currency": "MXN",
          "fxQuote": 1,
          "amount": 1000
      },
      "payment": {
          "currency": "MXN",
          "fxQuote": 1,
          "financingFee": 0,
          "amount": 1000
      },
      "localTaxes": [],
      "withHoldings": [],
      "fees": {
          "description": "Fee",
          "currency": "MXN",
          "fxSource": 1,
          "fxQuote": 1,
          "amount": 50,
          "account": "{{accountNumber}}"
      },
      "status": {
          "code": "200",
          "description": "COMPLETED",
          "detail": "The payin was credited"
      },
      "beneficiary": {
          "type": "INDIVIDUAL",
          "name": "Juan",
          "lastName": "Perez",
          "fullName": "Juan Perez",
          "document": {
              "type": "RFC",
              "id": "PEPJ800101XXX"
          },
          "bank": {
              "account": {
                  "number": "646011319800123456"
              }
          },
          "informedName": "LPV3_PayinVA"
      },
      "merchant": {
          "type": "COMPANY",
          "name": "Test Merchant"
      },
      "payer": {
          "type": "INDIVIDUAL",
          "name": "Alejandra",
          "lastName": "Guzman",
          "fullName": "Alejandra Guzman",
          "document": {
              "type": "RFC",
              "id": "KCWV771228TS4"
          },
          "email": "alejandra.guzman@email.com",
          "bank": {
              "name": "Sistema de Transferencias y Pagos",
              "code": "646",
              "branch": {},
              "account": {
                  "type": "C",
                  "number": "646011319800123456"
              }
          }
      },
      "date": {
          "creationDate": "2024-02-19T20:18:30.373",
          "processedDate": "2024-02-19T20:18:30.601"
      },
      "errors": [],
      "referenceCode": "C2VV-MVVN-QHFI",
      "tracking": {
          "id": "lpv3_1111-19feb2024-2400",
          "reference": "999999",
          "concept": "concepto pago LPV3_4707"
      }
  }
}
```

```json MEX (TEF) theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "transactionType": "PayIn",
  "transactionFlow": null,
  "country": "MEX",
  "data": {
      "transactionType": "PayIn",
      "externalId": "3fb782c0-9c26-47b8-a66d-6c127934403e",
      "internalId": "b7f7284f-1684-4ec9-a932-5da2aed7e159",
      "paymentMethod": {
          "type": "BankTransfer",
          "code": "1680",
          "flow": "DIRECT"
      },
      "country": "MEX",
      "currency": "MXN",
      "amount": 1000.01,
      "accountNumber": "{{accountNumber}}",
      "confirmed": {
          "currency": "MXN",
          "fxQuote": 1,
          "amount": 1000.01
      },
      "payment": {
          "currency": "MXN",
          "fxQuote": 1,
          "financingFee": 0,
          "amount": 1000.01
      },
      "localTaxes": [],
      "withHoldings": [],
      "fees": {
          "description": "Fee",
          "currency": "MXN",
          "fxSource": 18.76902,
          "fxQuote": 1,
          "amount": 0,
          "account": "{{accountNumber}}"
      },
      "status": {
          "code": "200",
          "description": "COMPLETED",
          "detail": "The payin was credited"
      },
      "beneficiary": {
          "type": "COMPANY",
          "name": "My Company",
          "document": {
              "type": "RUC",
              "id": "200123456789"
          },
          "bank": {
              "name": "{{bankName}}",
              "code": "{{bankCode}}",
              "account": {
                  "number": "000000000000000009"
              }
          },
          "informedName": "My Company"
      },
      "merchant": {
          "type": "COMPANY",
          "name": "Localpayment Test",
          "lastName": ""
      },
      "payer": {
          "type": "COMPANY",
          "name": "John",
          "lastName": "Doe",
          "document": {
              "type": "RFC",
              "id": ""
          },
          "email": "NA",
          "bank": {
              "name": "BANCO INBURSA",
              "code": "036",
              "account": {
                  "type": "CLABE",
                  "number": "00000000000000000001"
              }
          }
      },
      "date": {
          "creationDate": "2025-08-21T15:15:05.113",
          "processedDate": "2025-08-21T15:15:05.346"
      },
      "errors": [],
      "referenceCode": "AHB3-2LHB-8RG1",
      "tracking": {
          "id": "1234-2025",
          "reference": "999999",
          "concept": "Test payment"
      }
  }
}
```

```json MEX (SPID) theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "transactionType": "PayIn",
  "transactionFlow": null,
  "country": "MEX",
  "data": {
    "transactionType": "PayIn",
    "externalId": "1f6b6f3a-3c3f-4e08-ba14-ac0d2a521ad5",
    "internalId": "43aa5b5b-7566-4630-b86f-afb8486ccab4",
    "paymentMethod": {
      "type": "BankTransfer",
      "code": "1698",
      "flow": "DIRECT"
    },
    "country": "MEX",
    "currency": "USD",
    "amount": 3,
    "accountNumber": "{{accountNumber}}",
    "confirmed": {
      "currency": "USD",
      "fxQuote": 1,
      "amount": 3
    },
    "payment": {
      "currency": "USD",
      "fxQuote": 1,
      "financingFee": 0,
      "amount": 3
    },
    "localTaxes": [],
    "withHoldings": [],
    "fees": {
      "description": "Fee",
      "currency": "USD",
      "fxSource": 1,
      "fxQuote": 1,
      "amount": 0.01,
      "account": "{{accountNumber}}"
    },
    "status": {
      "code": "200",
      "description": "COMPLETED",
      "detail": "The payin was credited"
    },
    "beneficiary": {
      "type": "COMPANY",
      "name": "Test Company",
      "document": {
        "type": "RFC",
        "id": "XXX010101000"
      },
      "bank": {
        "account": {
          "number": "000111111111111111"
        }
      },
      "informedName": "Company name"
    },
    "merchant": {
      "type": "COMPANY",
      "name": "Localpayment Test"
    },
    "payer": {
      "type": "INDIVIDUAL",
      "name": "John",
      "lastName": "Doe",
      "document": {
        "type": "RFC",
        "id": "XXX010101000"
      },
      "email": "NA",
      "bank": {
        "name": "{{bankName}}",
        "code": "{{bankCode}}",
        "branch": {
          "code": "",
          "name": ""
        },
        "account": {
          "type": "C",
          "number": "000111111111111111"
        }
      }
    },
    "date": {
      "creationDate": "2026-01-26T15:10:03Z",
      "processedDate": "2026-01-26T15:10:03Z"
    },
    "errors": [],
    "referenceCode": "XXXX-XXXX-XXXX",
    "tracking": {
      "id": "111XXX1X1",
      "reference": "XXXX",
      "concept": "TEST"
    }
  }
}
```

```json PER theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
    "transactionType": "PayIn",
    "transactionFlow": null,
    "country": "PER",
    "data": {
        "transactionType": "PayIn",
        "externalId": "ff9178f7-fcda-1e38-acaa-3cbe2c5d4976",
        "internalId": "902127f8-35b3-47a7-b24a-1e39411740e5",
        "paymentMethod": {
            "type": "BankTransfer",
            "code": "6100",
            "flow": "DIRECT"
        },
        "country": "PER",
        "currency": "PEN",
        "amount": 5,
        "accountNumber": "{{accountNumber}}",
        "confirmed": {
            "currency": "PEN",
            "fxQuote": 1,
            "amount": 5
        },
        "payment": {
            "currency": "PEN",
            "fxQuote": 1,
            "financingFee": 0,
            "amount": 5
        },
        "localTaxes": [
            {
                "code": "0006",
                "percentage": 0.005,
                "description": "ITF",
                "currency": "PEN",
                "fxSource": 3.742498,
                "fxQuote": 0,
                "amount": 0,
                "account": "{{accountNumber}}"
            }
        ],
        "withHoldings": [],
        "fees": {
            "description": "Fee",
            "currency": "PEN",
            "fxSource": 3.386033,
            "fxQuote": 1,
            "amount": 1,
            "account": "{{accountNumber}}"
        },
        "status": {
            "code": "200",
            "description": "COMPLETED",
            "detail": "The payin was credited"
        },
        "beneficiary": {
            "type": "INDIVIDUAL",
            "name": "Lucia",
            "lastName": "Torres",
            "fullName": "Lucia Torres",
            "document": {
                "type": "DNI",
                "id": "45678901"
            },
            "bank": {
                "account": {
                    "number": "92250610000000101234"
                }
            }
        },
        "merchant": {
            "type": "COMPANY",
            "name": "Localpayment Test"
        },
        "payer": {
            "type": "INDIVIDUAL",
            "name": "Lucia",
            "lastName": "Torres",
            "fullName": "Lucia Torres",
            "document": {
                "type": "DNI",
                "id": "45678901"
            },
            "email": "lucia.torres@email.com",
            "bank": {
                "name": "INTERBANK (BANCO INTERNACIONAL DEL PERÚ)",
                "code": "003",
                "branch": {},
                "account": {
                    "type": "C",
                    "number": "00310701315123456789"
                }
            }
        },
        "date": {
            "creationDate": "2025-10-20T16:07:50Z",
            "processedDate": "2025-10-20T16:07:50Z"
        },
        "errors": [],
        "referenceCode": "6WXD-CXLO-U8UN",
        "tracking": {
            "id": "2025102011074908084191797675",
            "reference": "00100000297079044806",
            "concept": ""
        }
    }
}
```

## Campi del webhook per l'abbinamento

La notifica webhook contiene campi specifici che fungono da identificativi. Usa la tabella seguente per abbinare il pagamento in entrata ai tuoi registri interni.

| Campo | Descrizione |
| - | - |
| `accountNumber` | Numero di conto dell'esercente. |
| `amount` | Importo ricevuto. |
| `payer.name ` e  `payer.lastName` | Nome completo del pagatore. |
| `payer.document.id` | Numero del documento d'identità nazionale del pagatore (se disponibile). |
| `payer.bank.account.number` | Numero del conto di origine usato dal pagatore. |
| `beneficiary.name` e `beneficiary.document.id` | Nome e documento d'identità del titolare del conto virtuale. |
| `beneficiary.bank.account.number` | Il numero di conto locale del conto virtuale che ha ricevuto il pagamento (CVU per l'Argentina, CLABE per il Messico, CCI per il Perù, ecc.). Usa questo campo per abbinare il pagamento in entrata al conto virtuale specifico nei tuoi registri. |
| `referenceCode` | Un riferimento generato da Localpayment nel formato `XXXX-XXXX-XXXX` (tre blocchi alfanumerici di quattro caratteri). Usalo solo come riferimento leggibile. Per l'idempotenza e la deduplicazione, usa `internalId` o `externalId`. |
| `tracking.id` | Identificativo generato dal circuito di pagamento o dalla banca del pagatore. Il formato varia in base al paese. Per Bre-B in Colombia, è il riferimento di riconciliazione determinante. |
| `tracking.reference` | Anch'esso generato dal circuito o dalla banca. Non è garantito che sia presente o univoco tra i diversi circuiti. In Messico è un riferimento bancario più breve inserito dal pagatore; in Perù può essere vuoto. |
| `tracking.concept` | Destinato a contenere la descrizione del pagamento. Spesso contiene stringhe generate dal sistema anziché testo libero del pagatore. Usalo solo come contesto aggiuntivo. |
| `date.creationDate` e `date.processedDate` | L'oggetto `date` fornisce i timestamp UTC che tracciano la transazione dalla sua creazione nel sistema (`creationDate`) al regolamento finanziario definitivo (`processedDate`). |

## Usare i riferimenti di pagamento

I pagatori possono aggiungere un riferimento (ad es. un numero d'ordine) al proprio bonifico. Questo dato compare nell'oggetto `tracking` del webhook e consente un abbinamento diretto.

> [!WARNING]
>
> ###
>
> **Importante**
>
> * **Disponibilità:** l'oggetto `tracking` è **disponibile solo nei webhook**, non nei report delle transazioni né nell'API.
> * Per il **Messico (SPID)**, l'`externalId` corrisponde alla chiave di tracciamento (Clave de Rastreo) del Banco de México, ed è quindi il campo determinante per la riconciliazione.

### Esempio di oggetto tracking

```json ARG theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
"tracking": {
    "id": "7L8GYKNXWJELWYGP2MPRZ5",
    "reference": "7L8GYKNXWJELWYGP2MPRZ5",
    "concept": "CVU TEST"
}
```

```json BRA theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
"tracking": {
    "id": "E0000000022250417170028001234567",
    "reference": "",
    "concept": "11778498533"
}
```

```json CHL theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
"tracking": {
    "id": "000739531234",
    "reference": "2025-07-16-12.10.09.237212",
    "concept": "Test 928630123"
}
```

```json COL theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
"tracking": {
            "id": "20260225900504001TFY123451234500001",
            "reference": "20260225900504001TFY123451234500001",
            "concept": "Transfer via BRE-B"
        }
```

```json MEX (SPEI and TEF) theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
"tracking": {
    "id": "lpv3_1111-19feb2024-24123",
    "reference": "999999",
    "concept": "concepto pago LPV3_4707"
}
```

```json PER theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
"tracking": {
    "id": "20251020110749080841911234567",
    "reference": "00100000297079041234",
    "concept": ""
}
```

***

## Identificativi principali nella notifica

La notifica include diversi campi di riferimento e di tracciamento generati da soggetti diversi. Conoscere l'origine e l'affidabilità di ciascuno ti aiuta a definire una strategia di riconciliazione affidabile.

### referenceCode

Generato da Localpayment. Segue sempre il formato `XXXX-XXXX-XXXX` (tre blocchi alfanumerici di quattro caratteri) in tutti i paesi e su tutti i circuiti, a conferma che la notifica proviene da Localpayment.

`referenceCode` è un riferimento Localpayment leggibile, non una chiave di idempotenza. Per la deduplicazione e l'idempotenza, usa `internalId` o `externalId`.

### tracking.id

Generato dal circuito di pagamento o dalla banca del pagatore, non da Localpayment. Il formato varia in base al paese:

| Paese | Formato |
| - | - |
| Argentina | Chiave alfanumerica lunga (ad es. `7L8GYKNXWJELWYGP2MPRZ5`) |
| Brasile (PIX) | Numero E (ad es. `E0000000022250417170028008753346`) |
| Cile | Numerico breve (ad es. `000739531483`) |
| Colombia (Bre-B) | ID della transazione sulla rete Bre-B, riferimento di riconciliazione determinante |
| Messico | Chiave assegnata dalla banca di origine |
| Perù | Numerico breve, univocità non garantita |

Non considerare `tracking.id` univoco su tutti i circuiti. Usalo come identificativo principale lato circuito per Bre-B in Colombia; per gli altri paesi, consideralo un riferimento di supporto.

### `tracking.reference`

Anch'esso generato dal circuito o dalla banca. Il contenuto e la disponibilità variano:

* **Argentina, Cile, Colombia**: replica `tracking.id`.
* **Messico (SPEI/TEF)**: un riferimento bancario più breve che il pagatore inserisce al momento del bonifico.
* **Perù**: può essere vuoto o contenere `"NO REF"`.

Non fare affidamento su `tracking.reference` come identificativo garantito o univoco.

### `tracking.concept`

Destinato a contenere la descrizione del pagamento. In pratica, questo campo contiene spesso stringhe generate dal sistema o segnaposto anziché testo libero del pagatore:

| Paese | Valore tipico |
| - | - |
| Cile | `"Sin mensaje"` |
| Colombia (Bre-B) | `"Transfer via BRE-B"` (generato dal circuito) |
| Perù | `"payin generated by virtual account"` |

Non usare `tracking.concept` come campo chiave e non dare per scontato che contenga testo libero inserito dal pagatore. Consideralo solo un contesto aggiuntivo.

***

## Specifiche per paese

Quando usi i conti virtuali, devi considerare alcuni dettagli importanti specifici per paese. Possono influire sul modo in cui vengono elaborate le notifiche di pagamento e su come riconcili le transazioni. Di seguito trovi un riepilogo delle differenze note in alcuni mercati:

<table>
  <thead>
    <tr>
      <th>
        Paese / Metodo di pagamento
      </th>

      <th>
        Considerazioni sui webhook
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        **Costa Rica (SINPE)**
      </td>

      <td>
        * Il campo `tracking.concept` contiene la descrizione inserita dal pagatore al momento del bonifico. Questo valore può essere **troncato dalla banca di origine**, motivo per cui potresti vedere dei trattini bassi finali (ad es. `"Steph_test_____"`).
      </td>
    </tr>

    <tr>
      <td>
        **Colombia (Bre-B)**
      </td>

      <td>
        * `paymentMethod.code` è sempre `"2006"` per i payin su conti virtuali Bre-B.
        * `payer.bank.account.type` è sempre `"BREB"`: conferma che il pagatore ha inviato i fondi tramite la rete Bre-B.
        * `beneficiary.bank.account.type` è sempre `"KEY"`: la chiave Bre-B ricevente assegnata al tuo conto virtuale.
        * Bre-B regola i pagamenti in tempo reale: l'unico stato del payin è `"200" COMPLETED`. Non esistono stati intermedi.
        * `tracking.id` e `tracking.reference` contengono l'ID della transazione sulla rete Bre-B: usali come riferimento determinante per la riconciliazione.
        * `tracking.concept` può contenere una descrizione inserita dal pagatore, ma spesso riporta una stringa generata dal sistema (ad es. `"Transfer via BRE-B"`). Non considerarlo un testo libero inserito con certezza dal pagatore.
      </td>
    </tr>

    <tr>
      <td>
        **Messico (SPID)**
      </td>

      <td>
        * I bonifici SPID sono **disponibili esclusivamente per pagatori di tipo azienda (Company)**.
        * Il campo `externalId` corrisponde alla **chiave di tracciamento (Clave de Rastreo)** assegnata dal Banco de México.
        * Usa `externalId` come riferimento determinante per la riconciliazione.
      </td>
    </tr>

    <tr>
      <td>
        **Perù**
      </td>

      <td>
        * Alcuni istituti finanziari **non** restituiscono il nome completo del pagatore. Per i dettagli, consulta: [Istituti finanziari che non forniscono il nome completo del pagatore](#financial-institutions-without-payer-full-name-availability).
      </td>
    </tr>
  </tbody>
</table>

### Istituti finanziari che non forniscono il nome completo del pagatore

* **Perù**: alcuni istituti finanziari peruviani non forniscono il nome completo del pagatore nei dettagli della transazione. Poiché questa informazione non è presente nei dati di regolamento inviati da questi istituti, potresti non riuscire a identificare correttamente il pagatore.

> [accordion] Elenco degli istituti finanziari
>
> * 007 – CITIBANK DEL PERU S.A.
> * 056 – BANCO SANTANDER PERU S.A.
> * 805 – CAJA MUNICIPAL DE AHORRO Y CRÉDITO SULLANA
> * 813 – CAJA MUNICIPAL DE AHORRO Y CRÉDITO TACNA

***

## Gestire la notifica

Il tuo server deve elaborare ogni notifica come segue:

1. **Verifica la firma della richiesta**.
2. **Convalida **`internalId`** o **`externalId` per garantire l'idempotenza; non elaborare mai due volte la stessa notifica.
3. **Aggiorna il tuo sistema** per contrassegnare come pagati la fattura, l'e-wallet o l'ordine corrispondenti.
4. **Restituisci **`HTTP 200 OK` per confermare la ricezione.

***

## Confermare la ricezione della notifica

Localpayment considera il webhook consegnato correttamente solo quando il tuo server risponde con:

```http theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
HTTP/1.1 200 OK
Content-Type: application/json
```

Se non riceve alcuna conferma, Localpayment invia di nuovo la notifica più volte, a intervalli crescenti.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.