Create Payment

Create a new Payment.

Request

Field Type Description  
payment accountingDate string Date the payment was made optional
payment type string String identifying the type of the payment. Value one of: purchases, sales optional
payment description string optional
payment amount float The total amount paid in pounds optional
payment entityId integer The id of the customer or supplier optional
payment paymentMethod integer The id of the payment method optional
payment bankAccount string The account code of the bank account being paid into optional
invoices[ ] array An array of invoice elements optional
invoices[ ][id] integer The internal id of the invoice optional
invoices[ ][amount] float The amount to pay the invoice off by. Optional, if not specified, will try to allocate as much of the amount as possible optional

Response

Field Type Description  
payment_id integer The internal id of the payment optional

Examples

Request

<?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>