createPayment

Create a new Payment

Create a new Payment.

Request

Field Description Additional info
payment accountingDate Date the payment was made
payment type String identifying the type of the payment Value one of:

  • purchases
  • sales
  • sales_refund
  • sales_orphan_refund
payment description
payment amount The total amount paid in pounds
payment entityId The id of the customer or supplier
payment paymentMethod The id of the customer or supplier
payment bankAccount The account code of the bank account being paid into
invoices A list of invoice elements
invoice id The internal id of the invoice
invoice amount The amount to pay the invoice off by Optional, if not specified, will try to allocate as much of the amount as possible

Response

Field Description Additional info
payment_id The internal id of the payment

Example

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:cb="https://secure.clearbooks.co.uk/api/soap/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
  <env:Header>
    <cb:authenticate apiKey="yourApiKey" />
  </env:Header>
  <env:Body>
    <env:createPayment env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
      <payment
        type="purchases"
        project="1"
        accountingDate="2008-09-17"
        amount="1"
        entityId="1"
        paymentMethod="5"
        bankAccount="7502001"
        xsi:type="cb:Payment">
        <description xsi:type="xsd:string">My Payment</description>
        <invoices enc:itemType="cb:PaymentInvoice"
          xsi:type="cb:ArrayOfPaymentInvoice">
          <invoice id="167" xsi:type="cb:PaymentInvoice" />
        </invoices>
      </payment>
    </env:createPayment>
  </env:Body>
</env:Envelope>

Response

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
  xmlns:cb="https://secure.clearbooks.co.uk/api/soap/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
  <env:Body xmlns:rpc="http://www.w3.org/2003/05/soap-rpc">
    <env:createPaymentResponse
      env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
      <createPaymentReturn
        payment_id="25"
        xsi:type="cb:PaymentReturn" />
    </env:createPaymentResponse>
  </env:Body>
</env:Envelope>