Run my Accounts API: Erstellen und mutieren von Kunden

Kunden im Run my Accounts Kundenstamm können Sie wie folgt übers API erstellen oder mutieren:

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

Genaue Definition der Anfrage in XML finden sich bei 'Liste der Kunden'. Der Kunde wird über die Kundennummer (<customernumber>) identifiziert. Ist diese noch nicht bekannt, wird der Kunde neu erstellt, ansonsten wir der Kunde mutiert.

Beispiele

XML Aufruf:

POST /api/latest/clients/apitest/customers?api_key=XXXXXX HTTP/1.1
User-Agent: Wget/1.13.4 (darwin11.3.0)
Accept: */*
Host: service.runmyaccounts.com:80
Connection: Keep-Alive
Content-Type: application/xml
Content-Length: 782

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><customer><customernumber>K-001</customernumber><name>Muster AG</name><created>2012-02-21T00:00:00+01:00</created><salutation>Herr</salutation><firstname>Hans</firstname><lastname>Muster</lastname><address1>Rössliweg 1</address1><address2></address2><zipcode></zipcode><city>Tenna</city><state></state><country></country><phone></phone><fax></fax><mobile></mobile><email>hmuster@muster.ch</email><taxnumber></taxnumber><bank_name>CREDIT SUISSE</bank_name><bank_address1></bank_address1><bank_address2></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>

Antwort: 204 No Content

JSON Aufruf:

POST /api/latest/clients/apitest/customers?api_key=XXXXXX HTTP/1.1
User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
Host: service.runmyaccounts.com:80
Accept: */*
Content-Type: application/json
Content-Length: 333

{"customernumber":"K-201202291308","name":"JSON der Erste","created":"2012-02-29T00:00:00+01:00","salutation":"","firstname":"","lastname":"","address1":"","address2":"","zipcode":"","city":"","state":"","country":"","phone":"","fax":"","mobile":"","email":"nsamuelsson@runmyaccounts.com","taxnumber":"","bank_iban":"","bank_bic":""}

Antwort: 204 No Content