Run my Accounts API: Erstellen einer neuen Kreditorrechnung

Hier erfahren Sie, wie Sie einen neuen Kreditor über das API von Run my Accounts erfassen können:

POST https://service.runmyaccounts.com/api/{version}/clients/{mandantenname}/payables

Genau Definition der Anfrage in XML finden sich bei 'Ansicht eines Kreditors'.

Der Lieferant kann in der Rechnung über zwei Varianten gesetzt werden:

1. Vollständiges <vendor> Element:

Falls der Lieferant noch nicht existiert (id: vendornumber), so wird er neu erstellt. Bestehende Lieferanten werden automatisch mutiert, deshalb ist es in dem Fall wichtig immer alle Lieferantendaten mitzuliefern.

XML:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payable>
  <invnumber>K-001</invnumber>
  <currency>CHF</currency>
  <transdate>2013-07-30T00:00:00+02:00</transdate>
  <duedate>2013-08-13T00:00:00+02:00</duedate>
  <description></description>
  <notes></notes>
  <intnotes></intnotes>
  <taxincluded>true</taxincluded>
  <exchangerate>1.0</exchangerate>
  <vendor>
    <vendornumber>L-66</vendornumber>
    <name>ABC Lieferant</name>
    <created>2013-01-01T00:00:00+01:00</created>
    <salutation>Herr</salutation>
    <firstname>Hans</firstname>
    <lastname>Muster</lastname>
    <terms>14</terms>
    <address1>Seestrasse 63</address1>
    <address2></address2>
    <zipcode>8000</zipcode>
    <city>Zürich</city>
    <state>Zürich</state>
    <country>Schweiz</country>
    <phone>044 000 00 01</phone>
    <fax></fax>
    <mobile></mobile>
    <email>hans.muster@abc.ch</email>
    <taxnumber></taxnumber>
    <arap_accno>2000</arap_accno>
    <payment_accno>1020</payment_accno>
    <bank_name>CREDIT SUISSE</bank_name>
    <bank_address1>PARADEPLATZ</bank_address1>
    <bank_address2></bank_address2>
    <bank_zipcode>8000</bank_zipcode>
    <bank_city>ZüRICH</bank_city>
    <bank_country></bank_country>
    <bank_iban>CH57 0483 5053 9150 6000 1</bank_iban>
    <bank_bic>CRESCHZZ81Z</bank_bic>
  </vendor>
  <parts>
    <part>
      <partnumber>ART-1</partnumber>
      <quantity>1</quantity>
      <sellprice>200</sellprice>
    </part>
  </parts>
</payable>

JSON:

    {
       "invnumber": "K-001",
       "currency": "CHF",
       "transdate": "2013-07-30T00:00:00+02:00",
       "duedate": "2013-08-13T00:00:00+02:00",
       "description": "",
       "notes": "",
       "intnotes": "",
       "taxincluded": "true",
       "exchangerate": "1.0",
       "vendor":
       {
           "vendornumber": "L-66",
           "name": "ABC Lieferant",
           "created": "2013-01-01T00:00:00+01:00",
           "salutation": "Herr",
           "firstname": "Hans",
           "lastname": "Muster",
           "terms": "14",
           "address1": "Seestrasse 63",
           "address2": "",
           "zipcode": "8000",
           "city": "Zürich",
           "state": "Zürich",
           "country": "Schweiz",
           "phone": "044 000 00 01",
           "fax": "",
           "mobile": "",
           "email": "hans.muster@abc.ch",
           "taxnumber": "",
           "arap_accno": "2000",
           "payment_accno": "1020",
           "bank_name": "CREDIT SUISSE",
           "bank_address1": "PARADEPLATZ",
           "bank_address2": "",
           "bank_zipcode": "8000",
           "bank_city": "ZüRICH",
           "bank_country": "",
           "bank_iban": "CH57 0483 5053 9150 6000 1",
           "bank_bic": "CRESCHZZ81Z"
       },
       "parts":
       {
           "part":
           {
               "partnumber": "ART-1",
               "quantity": 1,
               "sellprice": 200
           }
       }
    }

2. Angabe des Lieferanten über die Lieferantennummer (<vendornumber>)

Falls der Lieferant über die Lieferantenschnittstelle erstellt wurde oder schon existiert, kann in der Rechnung einfach die vendornumber angegeben werden:

XML:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<payable>
  <invnumber>K-001</invnumber>
  <currency>CHF</currency>
  <transdate>2013-07-30T00:00:00+02:00</transdate>
  <duedate>2013-08-13T00:00:00+02:00</duedate>
  <description></description>
  <notes></notes>
  <intnotes></intnotes>
  <taxincluded>true</taxincluded>
  <exchangerate>1.0</exchangerate>
  <paymentAccno>1020</paymentAccno>
  <vendornumber>L-66</vendornumber>
  <parts>
    <part>
      <partnumber>ART-1</partnumber>
      <quantity>1</quantity>
      <sellprice>200</sellprice>
    </part>
  </parts>
</payable>

JSON:

    {
       "invnumber": "K-001",
       "currency": "CHF",
       "transdate": "2013-07-30T00:00:00+02:00",
       "duedate": "2013-08-13T00:00:00+02:00",
       "description": "",
       "notes": "",
       "intnotes": "",
       "taxincluded": "true",
       "exchangerate": "1.0",
       "paymentAccno": "1020",
       "vendornumber": "L-66",
       "parts":
       {
           "part":
           {
               "partnumber": "ART-1",
               "quantity": 1,
               "sellprice": 200
           }
       }
    }