function payment.create

Records a record of a payment on the system and increases the customer's account balance accordingly. This does not actually transact any money; it is assumed that payment will already have been made separetely. This function is purely for making a record of the transaction.

This function can also be used to create a refund record; this will decrease the customer's account balance.

Arguments:

argrequired?syntaxinfo
payerIDYposintcustID of account that is making payment (the customer account)
payeeIDYposintcustID of account that is receiving payment (the supplier/parent account)
payee_companyIDgrp1posintbilling company ID of billing company raising the invoice
payee_companygrp1stringname of billing company; alternative to using payee_companyID
amountYfloat.2dp 
typeYenum:payment|refundDetermines whether you are recording a payment or a refund
methodYenum:card|cheque|standing order|bacs|cash|postal order|direct debitthe payment/refund method
refNstringshort reference string that appears on the customer's account history, eg cheque number, last 4 digits of card number, etc
cardauth_twincheckNstringbanking payment cross reference number
cardauth_secresponseNstringbanking payment security response message

Further argument information

payee_companyID

Within a parent account (identified by payeeID) there may be several billing companies, eg one for ISP services, one for telecoms services, etc (see [billing_companies] element of login object on the payee account to see which companies exist, and see [custof] element of client login object to see which billing companies can receive payments from this client).

You must supply this argument, or the payee_company argument. You cannot supply both.

type

Set the type argument to 'payment' if the customer is making a payment (this is the most common scenario and is probably what you want). The customer's account balance will be increased by the appropriate amount.

Set the type argument to 'refund' if a refund has been made back to the customer. The customer's account balance will be reduced by the appropriate amount.

method

Records the method by which the payment or refund was made. Set this to 'card' for online credit or debit card payments.

Example

Perl example request:

POST https://live.apicontrol.co.uk/1/json
my $api = new CCclient($u, $p, $live); # this must be logging in to the parent account of the one receiving payment
my %args =
  (
    'payeeID' => $api->custID,
    'payerID' => 16526,
    'payee_company' => 'skycom',
    'type' => 'payment',
    'amount' => '20.00',
    'method' => 'card',
    'ref' => '8233',
  );

my $res = $api->payment_create(%args);

XML example request:

POST https://live.apicontrol.co.uk/1/json

The response includes the following information:

Perl example response:

{
  'success' => '1',
  'errordiags' => '',
  'paymentID' => '92229',
  'error' => undef,
  'errornum' => '',
  'seq' => '35',
  'results' => [],
  'oldbalancepence' => '-3521'
};

XML example response: