To create an invoice and update the related installments, follow these steps:
Create the invoice;
Identify the linked installments;
Modify the payment method.
Create the invoice
To create an invoice via API, perform a POST request to "Invoice" using the API specified below:
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.
This API returns the list of installments associated with the invoice.
At this point, you can update the payment method for the installments.
Modify the Payment Method
To update the status of the installments, perform a PUT request on Payment Management to modify the Payment-Method using the following API:
The payload to use should include an updated value for the method field. For example:
"method": {
"id": 5
},
{
"id": 36693553,
"voucher": {
"type": "CustomerInvoice",
"id": 370,
"voucherNumber": null,
"date": "2025-02-28",
"voucherText": null
},
"type": "Invoice",
"amount": 183.0,
"amountInBaseCurrency": 183.0,
"date": null,
"owner": {
"entityNumber": 1,
"type": "Customer"
},
"bankAccount": null,
"rates": [
{
"id": 83914480,
"dueDate": "2025-03-30",
"amount": 183.0,
"amountInBaseCurrency": 183.0,
"paidAmount": 0.0,
"status": {
"id": 1
},
"method": {
"id": 5
},
"matches": [],
"invoiceNumber": "370",
"voucherLineText": "Cliente 1, nr. 251 del 28.02.25",
"distintaDocumentLink": null,
"electronicBankDocumentType": null,
"electronicBankDocumentLink": null,
"exportDate": null,
"exportId": null,
"exported": false
}
],
"currency": "EUR",
"tenderContractNumber": null
}
Related Contents