Hi,
Yes, you are note able to use the same paymentReference twice. The api follows the same rules as the UI:
Create a payment:
Trying to create another payment, setting the same reference:
To change the status, you need to release the payment:
The status is set depending on the outstanding amount of the document the payment is applied to:
Balanced: The credit and debit totals are equal for the newly created customer ledger and it can be released. To change the status of the document to Balanced, clear the Hold check box.
Open: The document is released, but the application amount is less than the payment amount.
Closed: The document has been released and closed (application amount is equal to the payment amount).
If the amount is payed in full it goes to closed after releasing:
FinancialPeriod and Cash account are mandatory, however, if omitted they are filled in with the default value, for period it will be the current financial period. For cash account it is the customers default payments default cash account:
... View more