Fetch a list of direct debit agreements.
| arg | required? | syntax | info |
|---|---|---|---|
payeeID | Y | posint | custID of payee/supplier account which takes payments from the payer |
payerID | Y | posint | custID of payer/customer account which makes payments to the payee |
agreementID | N | list:posint | optional filter; will limit results to only contain these DD agreements |
agreementID.min | N | posint | optional filter; limits results to only include agreements with an agreementID greater or equal to this value |
billing_companyID | N | posint | optional filter; limits results to only include agreements with this billing company |
is_payee_default | N | boolean | optional filter; limits results to only include agreements that are established via the payee's preferred DD processing provider |
providerID | N | posint | optional filter; limits results to agreements that are established via this particular DD processing provider |
sort | N | set:agreementID,is_payee_default | specify the sort order for the returned results |
status | N | set:active,cancelled | optional filter; limits results to only include agreements with the specified status |
provider_ref | N | string | optional filter; limits results to only include agreements with this provider reference string |
bank_accnum | N | posint | optional filter; limits results to only include agreements linked to this bank account number |
bank_sortcode | N | posint | optional filter; limits results to only include agreements linked to this bank sort code |
optfields | N | set:paytotals | selects additional fields to be returned |
startfrom | N | unsint | optional filter; skip this many records in the return data |
List DD agreements for custID 50000
Perl example request:
POST https://live.apicontrol.co.uk/1/json
{
'payerID' => 50000,
'payeeID' => 13810,
'billing_companyID' => 2
}
Perl example response:
{
'success' => 1,
'error' => '',
'errornum' => '',
'errordiags' => '',
'results' => {
'totmatches' => '1',
'data' => [
{
'bank_sortcode' => '010203',
'provider_ref' => 'SKYCOM50000',
'status' => 'active',
'is_payee_default' => 1,
'date_cancelled' => '0000-00-00',
'date_created' => '2008-02-16',
'agreementID' => '228',
'date_lastused' => '2013-05-01',
'providerID' => '1',
'payerID' => '50000',
'payeeID' => '13810',
'bank_accnum' => '12345678',
'billing_companyID' => '2'
}
]
}
}
List DD agreements for custID 50000, but also request the paytotals data
Perl example request:
POST https://live.apicontrol.co.uk/1/json
{
'optfields' => 'paytotals',
'payerID' => 50000,
'payeeID' => 13810,
'billing_companyID' => 2
}
In the response you can see that 74 payments totalling £153.08 have been successfully taken via this direct debit and that the last successful payment was taken on 15 April 2013, and that 1 payment of £1.20 was submitted on 1 May 2013 but was declined by the bank.
Perl example response:
{
'success' => 1,
'error' => '',
'errornum' => '',
'errordiags' => '',
'results' => {
'totmatches' => '1',
'data' => [
{
'bank_sortcode' => '010203',
'paytotals' => {
'paid' => {
'tot_amount' => '153.08',
'newest_date' => '2013-04-15',
'num_entries' => '74'
},
'declined' => {
'tot_amount' => '1.20',
'newest_date' => '2013-05-01',
'num_entries' => '1'
}
},
'provider_ref' => 'SKYCOM50000',
'status' => 'active',
'is_payee_default' => 1,
'date_cancelled' => '0000-00-00',
'date_created' => '2008-02-16',
'agreementID' => '228',
'date_lastused' => '2013-05-01',
'providerID' => '1',
'payerID' => '50000',
'payeeID' => '13810',
'bank_accnum' => '12345678',
'billing_companyID' => '2'
}
]
}
}