Skip to content

Payments

Michael Newman edited this page Aug 7, 2017 · 3 revisions

See Payments at Xero Developer for more information.

see the home page for application setup.

Get Payments

$xero->payments()->get();

Get Payment by ID

$paymentId = '682190f4-7362-11e7-8cf7-a6006ad3dba0';

$xero->payments()->get($paymentId);

Apply One Payment

$invoiceID = '3fd27838-68f5-11e7-907b-a6006ad3dba0';
$accountIdentifierType = null;  //set to null to use AccountID or 'Code' to use Account Code
$accountIdentifier = 'c993a9f3-29aa-487f-8914-fcff5b0bb9ac';
$date = '2009-09-01';
$amount = 300;
$isReconciled = false  //Optional parameter - deafult = false

$xero->payments()->applyOne(
    $invoiceID,
    $accountIdentifierType,
    $accountIdentifier,
    $date,
    $amount,
    $isReconciled
);

Apply Multiple Payments

$xml = '
<Payments>
  <Payment>
    ...
  </Payment>
</Payments>
'
$xero->payments()->apply($xml);

Credit Note Refund

$CreditNoteID = '7d879c22-4c68-4f25-a86c-bc85113039ad';
$accountIdentifierType = null; //set to null to use AccountID or 'Code' to use Account Code
$accountIdentifier = 'c993a9f3-29aa-487f-8914-fcff5b0bb9ac';
$date = '2009-09-01';
$amount = '220.50';
$reference = 'reference';
    
$xero->payments()->creditNoteRefund(
    $CreditNoteID,
    $accountIdentifierType,
    $accountIdentifier,
    $date,
    $amount,
    $reference
);

Payment Refund

$prepaymentID = '2e4a381b-8651-4265-be1d-b71bd481ecd9';
$accountIdentifierType = null; //set to null to use AccountID or 'Code' to use Account Code
$accountIdentifier = 'c993a9f3-29aa-487f-8914-fcff5b0bb9ac';
$date = '2009-09-01';
$amount = '100.10';
$reference = 'reference';
    
$xero->payments()->prepaymentRefund(
    $prepaymentID,
    $accountIdentifierType,
    $accountIdentifier,
    $date,
    $amount,
    $reference
);

Overpayment Refund

$overpaymentID = '66672531-e980-4521-b57a-bf66788668c7';
$accountIdentifierType = null; //set to null to use AccountID or 'Code' to use Account Code
$accountIdentifier = 'c993a9f3-29aa-487f-8914-fcff5b0bb9ac';
$date = '2009-09-01';
$amount = '20.15';
$reference = 'reference';
    
$xero->payments()->overpaymentRefund(
    $overpaymentID,
    $accountIdentifierType,
    $accountIdentifier,
    $date,
    $amount,
    $reference
);

Delete Payment

$paymentId = '682190f4-7362-11e7-8cf7-a6006ad3dba0';

$xero->payments()->delete($paymentId);

Request Parameters

ModifiedAfter
$xero->payments()->modifiedAfter('2017-03-28T12:00:00')->get();
Where
$xero->payments()->where('Amount>=100')->get();
Order
//Ascending
$xero->payments()->order('Amount')->get();

//Descending
$xero->payments()->order('Amount', 'DESC')->get();
Page
$xero->payments()->page(1)->get();
SummarizeErrors
$xero->payments()->summarizeErrors()->allocate( ... );
Clone this wiki locally