Run my Accounts API: Beispiel A1.2 - Rechnung einbuchen

An diesem Beispiel zeigen wir Ihnen, wie Sie eine Rechnung über das Run my Accounts API einbuchen können:

Aufruf:

POST https://service.runmyaccounts.com/api/latest/clients/{mandant}/invoices

XML:

<?xml version="1.0" encoding="UTF-8"?>
<invoice>
   <invnumber>A1.2</invnumber>
   <ordnumber />
   <status>OVERDUE</status>
   <currency>CHF</currency>
   <ar_accno>1100</ar_accno>
   <transdate>2012-08-06T00:00:00+02:00</transdate>
   <duedate>2012-08-06T00:00:00+02:00</duedate>
   <description />
   <notes />
   <intnotes />
   <taxincluded>true</taxincluded>
   <customer>
      <id>10199</id>
      <customernumber>K-001</customernumber>
      <name>Muster AG</name>
      <created>2012-02-21T00:00:00+01:00</created>
      <contactId>0</contactId>
      <salutation>Herr</salutation>
      <firstname>Hans</firstname>
      <lastname>Muster</lastname>
      <addressId>0</addressId>
      <address1>Rössliweg 1</address1>
      <address2 />
      <zipcode />
      <city>Tenna</city>
      <state />
      <country />
      <phone />
      <fax />
      <mobile />
      <email>hmuster@muster.ch</email>
      <taxnumber />
      <taxfree>false</taxfree>
      <bank_name>CREDIT SUISSE</bank_name>
      <bank_address1 />
      <bank_address2 />
      <bank_zipcode>8070</bank_zipcode>
      <bank_city>ZÜRICH</bank_city>
      <bank_country>SCHWEIZ</bank_country>
      <bank_iban>CH3304835172037151000</bank_iban>
      <bank_bic>CRESCHZZ80L</bank_bic>
   </customer>
   <incomeentries>
      <incomeentry>
         <amount>370.37</amount>
         <income_accno>3400</income_accno>
         <description>Installationen</description>
      </incomeentry>
      <incomeentry>
         <amount>555.56</amount>
         <income_accno>3400</income_accno>
         <description>Div. Software Dienstleistungen</description>
      </incomeentry>
   </incomeentries>
   <taxentries>
      <taxentry>
         <amount>74.07</amount>
         <tax_accno>2201</tax_accno>
      </taxentry>
   </taxentries>
</invoice>

JSON:

    {
       "invnumber": "A1.2",
       "ordnumber": "",
       "status": "OVERDUE",
       "currency": "CHF",
       "ar_accno": "1100",
       "transdate": "2012-08-06T00:00:00+02:00",
       "duedate": "2012-08-06T00:00:00+02:00",
       "description": "",
       "notes": "",
       "intnotes": "",
       "taxincluded": "true",
       "customer":
       {
           "id": "10199",
           "customernumber": "K-001",
           "name": "Muster AG",
           "created": "2012-02-21T00:00:00+01:00",
           "contactId": "0",
           "salutation": "Herr",
           "firstname": "Hans",
           "lastname": "Muster",
           "addressId": "0",
           "address1": "Rössliweg 1",
           "address2": "",
           "zipcode": "",
           "city": "Tenna",
           "state": "",
           "country": "",
           "phone": "",
           "fax": "",
           "mobile": "",
           "email": "hmuster@muster.ch",
           "taxnumber": "",
           "taxfree": "false",
           "bank_name": "CREDIT SUISSE",
           "bank_address1": "",
           "bank_address2": "",
           "bank_zipcode": "8070",
           "bank_city": "ZÜRICH",
           "bank_country": "SCHWEIZ",
           "bank_iban": "CH3304835172037151000",
           "bank_bic": "CRESCHZZ80L"
       },
       "incomeentries":
       {
           "incomeentry":
           [
               {
                   "amount": "370.37",
                   "income_accno": "3400",
                   "description": "Installationen"
               },
               {
                   "amount": "555.56",
                   "income_accno": "3400",
                   "description": "Div. Software Dienstleistungen"
               }
           ]
       },
       "taxentries":
       {
           "taxentry":
           {
               "amount": "74.07",
               "tax_accno": "2201"
           }
       }
    }

Antwort:

204 No Content