> ## 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.

# Conto virtuale con intento di pagamento - Argentina

Assegna un CVU a ogni transazione in Argentina. Il pagamento viene confermato solo se il pagatore trasferisce l'importo esatto entro la finestra di scadenza.

Il conto virtuale con intento di pagamento assegna a ogni transazione un CVU (Cuenta Virtual Uniforme) legato a un importo e a una scadenza specifici. A differenza di un conto virtuale standard, che accetta qualsiasi deposito, questo prodotto conferma il PayIn solo se il pagatore trasferisce esattamente l'importo indicato prima della data di scadenza.

## Prima di iniziare

Assicurati di avere:

> [card] [Credenziali API](https://docs.localpayment.com/it/docs/api-keys-and-environments.md)
>
> Credenziali API valide e un token di accesso per l'autenticazione.

> [card] [Configurazione del conto](https://docs.localpayment.com/it/docs/make-your-first-test-payment.md)
>
> Configurazione corretta del conto per il paese di destinazione e verifica dell'azienda.

> [card] [Whitelist degli IP](https://docs.localpayment.com/it/docs/dashboard-whitelist-your-ips.md)
>
> Inserisci gli indirizzi IP dei tuoi server nella whitelist per l'accesso all'API.

> [card] [Endpoint del webhook](https://docs.localpayment.com/it/docs/webhooks.md)
>
> Configura un URL di webhook per ricevere le notifiche di pagamento.

***

## Come funziona

Il flusso si differenzia dal conto virtuale CVU standard per un aspetto fondamentale: **a ogni pagamento viene assegnato un CVU vincolato a un importo specifico**.

1. Il tuo sistema chiama `POST /api/payin/` con `paymentMethod.code: "1060"` e l'importo previsto.
2. Localpayment restituisce un CVU univoco, i dati bancari del beneficiario e una data di scadenza.
3. Mostri al pagatore il CVU, l'importo esatto e la scadenza.
4. Il pagatore avvia un bonifico bancario verso il CVU dalla propria app bancaria o dal proprio e-wallet.
5. Quando il bonifico arriva con l'importo esatto prima della scadenza, Localpayment conferma il PayIn e invia un webhook al tuo sistema.

***

## Passaggio 1: creare un intento di pagamento

Invia una richiesta `POST` all'endpoint [Creare un payin](https://docs.localpayment.com/it/reference/payins.md).

### Richiesta

| Parametro | Tipo | Descrizione | Obbligatorio |
| - | - | - | - |
| `externalId` | string | Identificativo univoco di questa transazione nel tuo sistema. Usa il formato UUID4. | ✅ |
| `accountNumber` | string | Il tuo numero di conto Localpayment. | ✅ |
| `country` | string | Deve essere `ARG`. | ✅ |
| `currency` | string | Deve essere `ARS`. | ✅ |
| `amount` | number | L'importo **esatto** che il pagatore deve trasferire. | ✅ |
| `paymentMethod.type` | string | Deve essere `BankTransfer`. | ✅ |
| `paymentMethod.code` | string | Deve essere `1060`. | ✅ |
| `paymentMethod.flow` | string | Deve essere `DIRECT`. | ✅ |
| `payer.type` | string | `INDIVIDUAL` o `COMPANY`. | ✅ |
| `payer.name` | string | Nome del pagatore. | ✅ |
| `payer.lastName` | string | Cognome del pagatore. Obbligatorio quando `type` è `INDIVIDUAL`. | ✅ |
| `payer.document.type` | string | Tipo di documento, ad es. `DNI` o `CUIT`. | ✅ |
| `payer.document.id` | string | Numero del documento. | ✅ |
| `payer.email` | string | Indirizzo e-mail del pagatore. | |
| `merchant` | object | Dati dell'esercente/azienda. | ✅ |

#### Esempio di richiesta

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
curl --request POST \
     --url https://api.stage.localpayment.com/api/payin/ \
     --header 'Authorization: Bearer <your_access_token>' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '{
  "externalId": "550e8400-e29b-41d4-a716-446655440000",
  "accountNumber": "{{yourAccountNumber}}",
  "country": "ARG",
  "currency": "ARS",
  "amount": 5000.00,
  "conceptCode": "0003",
  "comment": "Add any relevant information related to the transaction",
  "paymentMethod": {
    "type": "BankTransfer",
    "code": "1060",
    "flow": "DIRECT"
  },
  "merchant": {
    "type": "COMPANY",
    "name": "Merchant Name",
    "document": {
      "type": "CUIT",
      "id": "30000000000"
    },
    "email": "merchant@example.com",
    "phone": {
      "countryCode": "54",
      "areaCode": "11",
      "number": "87654321"
    },
    "address": {
      "street": "Street",
      "number": "938",
      "city": "Buenos Aires",
      "state": "Buenos Aires",
      "country": "ARG",
      "zipCode": "1000"
    }
  },
  "payer": {
    "type": "INDIVIDUAL",
    "name": "Jane",
    "lastName": "Doe",
    "document": {
      "type": "CUIT",
      "id": "20000000000"
    },
    "email": "jane.doe@example.com",
    "phone": {
      "countryCode": "54",
      "areaCode": "11",
      "number": "12345678"
    },
    "address": {
      "street": "Street",
      "number": "1234",
      "city": "Buenos Aires",
      "state": "Buenos Aires",
      "country": "ARG",
      "zipCode": "1000"
    },
    "birthdate": "1990-01-01",
    "nationality": "ARG"
  }
}'
```

#### Risposta riuscita

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "transactionType": "PayIn",
  "externalId": "550e8400-e29b-41d4-a716-446655440000",
  "internalId": "5aced5da-40c1-4bec-85ff-c8cd1bcb4526",
  "paymentMethod": {
    "type": "BankTransfer",
    "code": "1060",
    "flow": "DIRECT"
  },
  "country": "ARG",
  "currency": "ARS",
  "amount": 5000.00,
  "accountNumber": "{{yourAccountNumber}}",
  "confirmed": {
    "currency": "ARS",
    "fxQuote": 1,
    "amount": 5000.00
  },
  "payment": {
    "currency": "ARS",
    "fxQuote": 1,
    "financingFee": 0,
    "amount": 5000.00
  },
  "localTaxes": [],
  "withHoldings": [],
  "grossingUps": [],
  "fees": {
    "description": "Fee",
    "currency": "ARS",
    "fxSource": 1,
    "fxQuote": 1,
    "amount": 0,
    "account": "{{yourAccountNumber}}"
  },
  "status": {
    "code": "100",
    "description": "INPROGRESS",
    "detail": "The payin is pending the confirmation"
  },
  "merchant": {
    "type": "COMPANY",
    "name": "Merchant Name",
    "document": {
      "type": "CUIT",
      "id": "30000000000"
    },
    "email": "merchant@example.com",
    "phone": {
      "countryCode": "54",
      "areaCode": "11",
      "number": "87654321"
    },
    "address": {
      "street": "Street",
      "number": "938",
      "city": "Buenos Aires",
      "state": "Buenos Aires",
      "country": "ARG",
      "zipCode": "1000"
    }
  },
  "payer": {
    "type": "INDIVIDUAL",
    "name": "Jane",
    "lastName": "Doe",
    "document": {
      "type": "CUIT",
      "id": "20000000000"
    },
    "email": "jane.doe@example.com",
    "phone": {
      "countryCode": "54",
      "areaCode": "11",
      "number": "12345678"
    },
    "address": {
      "street": "Street",
      "number": "1234",
      "city": "Buenos Aires",
      "state": "Buenos Aires",
      "country": "ARG",
      "zipCode": "1000"
    },
    "birthdate": "1990-01-01",
    "nationality": "ARG"
  },
  "wireInstructions": {
    "beneficiary": {
      "type": "COMPANY",
      "name": "LOCALPAYMENT S.R.L.",
      "document": {
        "type": "CUIT",
        "id": "30716132028"
      },
      "bank": {
        "code": "000",
        "branch": {
          "code": "036"
        },
        "account": {
          "number": "0000000000000000000000"
        }
      }
    },
    "referenceCode": "5aced5da-40c1-4bec-85ff-c8cd1bcb4526"
  },
  "date": {
    "creationDate": "2024-01-15T10:30:00Z",
    "processedDate": "2024-01-15T10:30:01Z",
    "expirationDate": "2024-01-22T10:30:00Z"
  },
  "errors": []
}
```

#### Campi principali della risposta

| Campo | Descrizione |
| - | - |
| `wireInstructions.beneficiary.bank.account.number` | Il CVU univoco su cui il pagatore deve trasferire i fondi. |
| `wireInstructions.beneficiary.bank.name` | Nome della banca ricevente. |
| `date.expirationDate` | Scadenza entro cui il pagatore deve completare il bonifico. |
| `status.code` | `100` (INPROGRESS) alla creazione. Passa a `200` (COMPLETED) o `300` (REJECTED), notificato tramite webhook. |

#### Risposta di errore

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "externalId": "550e8400-e29b-41d4-a716-446655440000",
  "internalId": "5aced5da-40c1-4bec-85ff-c8cd1bcb4526",
  "status": {
    "code": "300",
    "description": "REJECTED",
    "detail": "Invalid param + [document.id] + verification failed"
  },
  "errors": [
    {
      "code": "300",
      "detail": "Invalid param + [document.id] + verification failed"
    }
  ]
}
```

***

## Passaggio 2: mostrare le istruzioni di pagamento al pagatore

Una volta ricevuta la risposta, mostra al pagatore quanto segue:

* **CVU**: il valore di `wireInstructions.beneficiary.bank.account.number`
* **Importo**: l'importo esatto della tua richiesta. Il pagatore deve inviare esattamente questa cifra.
* **Scadenza**: la scadenza indicata in `date.expirationDate`
* **Nome del beneficiario**: il valore di `wireInstructions.beneficiary.name` (Localpayment S.R.L. come intestatario registrato del conto)

> [!NOTE]
>
> ###
>
> Se il pagatore trasferisce un importo diverso, il bonifico viene accreditato come un normale PayIn su conto virtuale e non conferma l'intento di pagamento.

***

## Passaggio 3: gestire le notifiche di pagamento

A differenza di un conto virtuale standard (in cui ricevi un webhook solo quando un pagamento viene accreditato), il pagamento con intento genera **due eventi webhook**:

1. **Notifica di creazione** (`INPROGRESS`): viene inviata subito dopo la creazione dell'intento di pagamento e contiene in `wireInstructions` il CVU assegnato e la data di scadenza. Il tuo sistema può usarla per confermare l'assegnazione del CVU.
2. **Notifica di completamento** (`COMPLETED`): viene inviata quando il bonifico del pagatore è stato elaborato e l'importo esatto è stato ricevuto prima della scadenza.

### Notifica di completamento (COMPLETED)

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "transactionType": "PayIn",
  "externalId": "550e8400-e29b-41d4-a716-446655440000",
  "internalId": "5aced5da-40c1-4bec-85ff-c8cd1bcb4526",
  "paymentMethod": {
    "type": "BankTransfer",
    "code": "1060",
    "flow": "DIRECT"
  },
  "country": "ARG",
  "currency": "ARS",
  "amount": 5000.00,
  "accountNumber": "{{yourAccountNumber}}",
  "confirmed": {
    "currency": "ARS",
    "fxQuote": 1.0,
    "amount": 5000.00
  },
  "payment": {
    "currency": "ARS",
    "fxQuote": 1.0,
    "financingFee": 0.0,
    "amount": 5000.00
  },
  "localTaxes": [
    {
      "code": "0001",
      "percentage": 1.2,
      "description": "IDC",
      "currency": "ARS",
      "fxSource": 1,
      "fxQuote": 0.0,
      "amount": 60.00,
      "account": "{{yourAccountNumber}}"
    }
  ],
  "withHoldings": [],
  "grossingUps": [],
  "fees": {
    "description": "Fee",
    "currency": "ARS",
    "fxSource": 1,
    "fxQuote": 1,
    "amount": 0.0,
    "account": "{{yourAccountNumber}}"
  },
  "status": {
    "code": "200",
    "description": "COMPLETED",
    "detail": "The payin was credited"
  },
  "merchant": {
    "type": "COMPANY",
    "name": "Merchant Name",
    "document": {
      "type": "CUIT",
      "id": "30000000000"
    },
    "email": "merchant@example.com",
    "phone": {
      "countryCode": "54",
      "areaCode": "11",
      "number": "87654321"
    },
    "address": {
      "street": "Street",
      "number": "938",
      "city": "Buenos Aires",
      "state": "Buenos Aires",
      "country": "ARG",
      "zipCode": "1000"
    }
  },
  "payer": {
    "type": "INDIVIDUAL",
    "name": "Jane",
    "lastName": "Doe",
    "document": {
      "type": "CUIT",
      "id": "20000000000"
    },
    "email": "jane.doe@example.com",
    "phone": {
      "countryCode": "54",
      "areaCode": "11",
      "number": "12345678"
    },
    "address": {
      "street": "Street",
      "number": "1234",
      "city": "Buenos Aires",
      "state": "Buenos Aires",
      "country": "ARG",
      "zipCode": "1000"
    },
    "birthdate": "1990-01-01",
    "nationality": "ARG"
  },
  "wireInstructions": {
    "beneficiary": {
      "type": "COMPANY",
      "name": "LOCALPAYMENT S.R.L.",
      "document": {
        "type": "CUIT",
        "id": "30716132028"
      },
      "bank": {
        "code": "000",
        "branch": {
          "code": "036"
        },
        "account": {
          "number": "0000000000000000000000"
        }
      }
    },
    "referenceCode": "5aced5da-40c1-4bec-85ff-c8cd1bcb4526"
  },
  "date": {
    "creationDate": "2024-01-15T10:30:00Z",
    "processedDate": "2024-01-15T10:38:22Z",
    "expirationDate": "2024-01-22T10:30:00Z"
  },
  "errors": []
}
```

***

## Test in Stage

Usa l'endpoint [Simulare un pagamento su un conto virtuale](https://docs.localpayment.com/it/docs/simulate-virtual-account-payment.md) per eseguire test end-to-end in Stage senza effettuare bonifici bancari reali.

Simula un pagamento riuscito usando `paymentMethod.code: "1060"` e lo stesso `externalId` restituito nella risposta di creazione.

***

## Demo

![](https://mintcdn.com/localpayment-1fee3d41/x0nXcqwNUmbD9R8W/images/docs/7946615aa9fa0357401cf5415179c6a3aeb14b407e6db588ad906ed268bdb917-Payment_Intent_Argentina.gif?s=0433b105db0501bd049d1bbd0fd1e475)

***

## Passaggi successivi

> [card] [Ricevere le notifiche di pagamento](https://docs.localpayment.com/it/docs/receive-payment-notifications.md)
>
> Configura il tuo endpoint del webhook e scopri come verificare e gestire le notifiche PayIn per i pagamenti su conti virtuali.

> [card] [Recuperare lo stato della transazione](https://docs.localpayment.com/it/docs/get-virtual-account-status.md)
>
> Interroga periodicamente l'endpoint di stato della transazione per verificare lo stato attuale di un intento di pagamento.

> [card] [Simulare un pagamento](https://docs.localpayment.com/it/docs/simulate-virtual-account-payment.md)
>
> Testa la tua integrazione end-to-end in Stage senza bonifici bancari reali.

> [card] [Panoramica dei conti virtuali](https://docs.localpayment.com/it/docs/virtual-accounts-overview.md)
>
> Scopri tutti i prodotti dei conti virtuali e i relativi casi d'uso.


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