The following example I have created an invoice 000273 with 125:- and a credit with 4:- If I create a payment in the UI and add both the invoice and the credit and release both the invoice and the credit is closed. If I do the same in API, The following happens 1. the credit is closed 2. the invoice is open 3. the payment is not released even if I got back OK 200, it is in status Open but release button is not availabe only Void. POST https://integration.visma.net/API/controller/api/v1/customerpayment {
"referenceNumber": null,
"type": { "value": "Payment" },
"hold": { "value": false },
"applicationDate": null,
"applicationPeriod": null,
"paymentRef": null,
"customer": { "value": "10002" },
"location": { "value": "Primär" },
"paymentMethod": null,
"cashAccount": null,
"currency": null,
"paymentAmount": { "value": 125.0 },
"invoiceText": null,
"branch": null,
"ordersToApply": null,
"paymentLines": [
{
"cashDiscountTaken": null,
"balanceWriteOff": null,
"writeOffReasonCode": null,
"crossRate": null,
"operation": "Insert",
"documentType": { "value": "Invoice" },
"refNbr": { "value": "000273" },
"amountPaid": { "value": 125.0 }
}
]
} PUT https://integration.visma.net/API/controller/api/v1/customerpayment/400129 {
"referenceNumber": null,
"type": { "value": "Payment" },
"hold": null,
"applicationDate": null,
"applicationPeriod": null,
"paymentRef": null,
"customer": null,
"location": null,
"paymentMethod": null,
"cashAccount": null,
"currency": null,
"paymentAmount": null,
"invoiceText": null,
"branch": null,
"ordersToApply": null,
"paymentLines": [
{
"cashDiscountTaken": null,
"balanceWriteOff": null,
"writeOffReasonCode": null,
"crossRate": null,
"operation": "Insert",
"documentType": { "value": "CreditNote" },
"refNbr": { "value": "000274" },
"amountPaid": { "value": 4.0 }
},
{
"cashDiscountTaken": null,
"balanceWriteOff": null,
"writeOffReasonCode": null,
"crossRate": null,
"operation": "Update",
"documentType": { "value": "Invoice" },
"refNbr": { "value": "000273" },
"amountPaid": { "value": 121.0 }
}
]
} https://integration.visma.net/API/controller/api/v1/customerpayment/400129/action/release { "type": { "value": "Payment" } } - Why is the balance on the payment 8:- - Why is the payment not released, I read about the void status in the api doc but do not understand it. - Why is the invoice closed when I do this in the ui and not using the API. - Please provide a safe way for me to code this without hickups Thanks
... View more