API/RetailServices/CreateLedgerCardline

From Emersion
Jump to: navigation, search

Purpose

The CreateLedgerCardline function allows you to submit a misc credit or debit against a customer and have it arrive against their account as an unallocated cardline. This cardline can be collected by their next invoice for payment.

Inputs

 <soapenv:Header/>
  <soapenv:Body>
     <ret:CreateLedgerCardlineRequest>
        <ret:AccountID>392407</ret:AccountID>
        <ret:TransactionDate>31-01-2013 14:30:00</ret:TransactionDate>
        <ret:Amount>12.95</ret:Amount>
        <ret:Tax>1.98</ret:Tax>
        <ret:Description>Cardline from external API</ret:Description>
     </ret:CreateLedgerCardlineRequest>
  </soapenv:Body>


Important notes:

181. Customer ID must be someone whom is managed by your certificate account

182. Transaction date must be in the format DD-MM-YYYY hh:mm:ss

183. Amount can be positive or negative for debits or credits respectively

184. Tax can be zero, or the appropriate positive / negative amount for a debit or credit respectively

185. Description is mandatory

186. A non required element ‘LedgerCodeID’ can be provided if you do not wish to use the defaults – this maps to the integer code of the ledger code you wish to use.

Output

 <SOAP-ENV:Body>
     <ns1:CreateLedgerCardlineResponse>
        <ns1:result>1558997</ns1:result>
     </ns1:CreateLedgerCardlineResponse>
  </SOAP-ENV:Body>


A successful insert of the cardline should provide you with the ledger cardline ID that was created. Any errors or validation problems should result in an exception or a soap fault.


Error String

187. You can only operate on accounts that are your direct children.

188. Amount supplied was either missing or zero. Amount must have a positive or negative value.

189. Amount has greater than 2 decimal places, this is not valid.

190. Tax Amount has greater than 2 decimal places, this is not valid.

191. Description is a mandatory field

192. Ledger code could not be established from your input. Either specify a correct integer, or leave blank and the system will choose.

193. Could not create new cardline, error was: ".$ex->getMessage()