Create the invoice
To create an invoice via API, perform a POST request to "Invoice" using the API specified below:
https://rest.reviso.com/v2/invoices/drafts
with the following payload.
{
"lines": [
{
"description": "Prodotto 04",
"discountPercentage": 0.00,
"lineNumber": 1,
"marginInBaseCurrency": 1000.00,
"marginPercentage": 100.00,
"product": {
"recommendedCostPrice": 0.0,
"productNumber": "04"
},
"quantity": 1.0000000000,
"sortKey": 1,
"totalNetAmount": 100.00,
"totalGrossAmount": 122.00,
"totalVatAmount": 22.00,
"unitCostPrice": 0.0000000000,
"unitNetPrice": 100.0000000000,
"manuallyEditedSalesPrice": true,
"vatInfo": {
"vatAccount": {
"vatCode": "V022"
},
"vatRate": 22.00000000
},
"movementChainId": "c7912096-81f3-42ec-8979-69bc7fad5e81"
}
],
"vatCodeGroups": [
{
"vatAccount": {
"vatCode": "V022"
},
"vatRate": 22.00000000,
"totalNetAmount": 100.00,
"totalVatAmount": 22.00,
"totalGrossAmount": 122.00
}
],
"costPriceInBaseCurrency": 0.00,
"currency": "EUR",
"deductionInfo": {
"deductionAmount": 0.00
},
"customer": {
"splitPayment": false,
"customerNumber": 1
},
"date": "2025-02-27",
"dueDate": "2025-02-27",
"exchangeRate": 100.000000,
"grossAmount": 1220.00,
//"id": 196,
"layout": {
"isDefault": false,
"layoutNumber": 9
},
"marginInBaseCurrency": 1000.00,
"marginPercentage": 100.00,
"netAmount": 1000.00,
"netAmountInBaseCurrency": 1000.00,
"numberSeries": {
"prefix": "FVL",
"allowGaps": false,
"entrySubtype": {
"entrySubtypeNumber": 10,
"entryType": "customerInvoice",
"hideInUi": false,
"isNumberSeriesCreationAllowed": true,
"isVoucherCreationAllowed": true,
"isAcrossAccountingYears": false,
"name": "Electronic Invoice"
},
"entryType": "customerInvoice",
"name": "Fattura vendita elettronica",
"peeks": [
{
"accountingYear": {
"year": "2020"
},
"nextVoucherNumber": 1
},
{
"accountingYear": {
"year": "2019"
},
"nextVoucherNumber": 1
},
{
"accountingYear": {
"year": "2018"
},
"nextVoucherNumber": 1
},
{
"accountingYear": {
"year": "2017"
},
"nextVoucherNumber": 1
}
],
"systemGenerated": false,
"isOrdered": false,
"sequenceType": "continious",
"numberSeriesNumber": 26
},
"paymentTerms": {
"daysOfCredit": 30,
"name": "30gg data fattura",
"paymentTermsType": "net",
"paymentTermsNumber": 11
},
"pdf": {
"download": "https://rest.reviso.com/v2/invoices/drafts/196/pdf"
},
"project": {
"projectNumber": 1
},
"recipient": {
"address": "Via Cliente, 10",
"attention": {
"customerContactNumber": 2
},
"city": "MILANO",
"country": "Italia",
"name": "Cliente 1",
"vatZone": {
"enabledForCustomer": true,
"enabledForSupplier": true,
"isDomestic": true,
"isExemptVatZone": false,
"isProjectAccount": false,
"name": "Domestic",
"textId": "SHARED_RECEIVABLESVATZONE_DENMARK",
"vatZoneNumber": 1
},
"zip": "20100"
},
"roundingAmount": 0.00,
"vatAmount": 220.00,
"vatIncluded": true,
"deliveryDetails": {
"deliveryStartDateTime": "2025-02-27T09:53:39Z",
"carrierInfo": {}
},
"number": 151,
"paymentType": {
"fields": [],
"paymentTypeNumber": 21
},
"priceList": {
"number": 0
},
"paymentManagementDocument": {
"paymentManagementDocumentId": 33156700
},
"salesDocumentType": "invoice",
"deliveryStatus": "notDelivered"
}
Identify the linked installments
After creating the invoice, perform a GET request on Invoice, filtering by the "id" of the invoice to retrieve the "paymentManagementDocumentId".
API Endpoint:
https://rest.reviso.com/v2/invoices/drafts/<id>
Next, perform a GET request on Payment Management, filtering by the retrieved paymentManagementDocumentId to obtain the installments linked to the invoice.
API Endpoint:
https://rest.reviso.com/payment-management/documents/<paymentManagementDocumentId>
This API returns the list of installments associated with the invoice.
Identify the payment voucherId
Perform a GET request on voucher, filtering by CustomerPayment to retrieve the payment voucherId.
API Endpoint:
https://rest.reviso.com/vouchers/?filter=voucherType$eq:customerpayment
Identify the payment rateid
Perform a GET request on Payment Management, filtering by the payment voucherId to identify the corresponding rateid.
API Endpoint
https://rest.reviso.com/payment-management/documents?filter=voucher.id$eq:<id>
Create the match between the invoice and the payment
Perform a PUT request on Payment Management, specifying the PaymentManagementDocumentId of the invoice and the rateid of the related installments.
API Endpoint
Where "idrate" is the one retrieved from the GET request on Payment Management.
For example:
https://rest.reviso.com/payment-management/documents/16711300/rates/53405163/matches
The payload to use is as follows:
[
{
"matchedAmount":120.00,
"matchedAmountInBaseCurrency":120.00,
"targetPaymentRate":
{
"id": 53247068,
"currency": "EUR"
}
}
]
Where the id corresponds to the idrate of the voucher.
Related contents
Create a sales invoice and modify the payment method on the installments
Create a sales voucher and modify the payment method on the installments.