Using the new SDK using this code in the sandbox:
$payment = new \XeroAPI\XeroPHP\Models\Accounting\Payment([
'code' => '001',
'invoice_number' => $inv_num,
'amount' => $amount
]);
$this->accounting_api->createPayment($this->getSingleTenant(), $payment);
I get the following exception
"ErrorNumber": 10,
"Type": "ValidationException",
"Message": "A validation exception occurred",
"Elements": [
{
"Date": "\/Date(1604880000000+0000)\/",
"Amount": 1.74,
"Status": "AUTHORISED",
"HasAccount": false,
"HasValidationErrors": true,
"ValidationErrors": [
{
"Message": "You must specify either an Invoice ID or Invoice Number or CreditNote ID or CreditNote Number or Prepayment ID or Overpayment ID for the payment"
},
{
"Message": "You must specify and Account code or Account ID for the payment"
},
{
"Message": "You must specify an Overpayment ID for the payment"
}
]
}
]
Do I really have a problem with my inputs, am I missing something required that is triggering this or is the API tanking on this?