Dieses Dokument beschreibt die REST-Schnittstellen für Kauf-Daten.
| User Story | Ein User kann eine Kauf anlegen |
| HTTP | POST |
| URL | http://api.123poi.com/data/poi/api/purchase/ |
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:poi="http://api.123poi.com/poi/"
xmlns:falkgeo="http://api.123poi.com/geo/" xmlns:data="http://api.123poi.com/data/"
xmlns:user="http://api.123poi.com/user/" xmlns:tour="http://api.123poi.com/tour/"
xmlns:destination="http://api.123poi.com/destination/"
xmlns:purchase="http://api.123poi.com/purchase/">
<content type="application/xml">
<purchase:purchase>
<purchase:type>type</purchase:type>
<purchase:deviceInfos>
<purchase:deviceInfo>
<purchase:metadata>metadata_1381229866046</purchase:metadata>
</purchase:deviceInfo>
<purchase:deviceInfo>
<purchase:metadata>metadata_1381229866047</purchase:metadata>
</purchase:deviceInfo>
</purchase:deviceInfos>
<purchase:productId>product_1381231405874</purchase:productId>
</purchase:purchase>
</content>
</entry>
| User Story | Ein User kann einem Schritt mehrere PurchaseDaten anlegen |
| HTTP | POST |
| URL | http://api.123poi.com/data/poi/api/purchase/add |
Als Ergebnis bekommt er eine ein Liste aller seiner Käufe übermittelt.
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:poi="http://api.123poi.com/poi/"
xmlns:falkgeo="http://api.123poi.com/geo/" xmlns:data="http://api.123poi.com/data/"
xmlns:user="http://api.123poi.com/user/" xmlns:tour="http://api.123poi.com/tour/"
xmlns:destination="http://api.123poi.com/destination/"
xmlns:purchase="http://api.123poi.com/purchase/">
<content type="application/xml">
<purchase:purchases>
<purchase:purchase>
<purchase:type>type</purchase:type>
<purchase:deviceInfos>
<purchase:deviceInfo>
<purchase:metadata>metadata_2381229866046</purchase:metadata>
</purchase:deviceInfo>
</purchase:deviceInfos>
<purchase:productId>product_2381231405874</purchase:productId>
</purchase:purchase>
<purchase:purchase>
<purchase:type>type</purchase:type>
<purchase:deviceInfos>
<purchase:deviceInfo>
<purchase:metadata>metadata_3381229866046</purchase:metadata>
</purchase:deviceInfo>
</purchase:deviceInfos>
<purchase:productId>product_3381231405874</purchase:productId>
</purchase:purchase>
</purchase:purchases>
</content>
</entry>
| User Story | Ein User kann ein Kauf-Daten ändern |
| HTTP | PUT |
| URL | http://api.123poi.com/data/poi/api/purchase/ |
Beim Ändern von Purchase-Daten werden weitere DeviceInfos angehängt. Die Produkt-Id oder der Type kann nicht geändert werden.
Die Struktur entspricht dem Anlegen von Purchase-Daten.
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:poi="http://api.123poi.com/poi/"
xmlns:falkgeo="http://api.123poi.com/geo/" xmlns:data="http://api.123poi.com/data/"
xmlns:user="http://api.123poi.com/user/" xmlns:tour="http://api.123poi.com/tour/"
xmlns:destination="http://api.123poi.com/destination/"
xmlns:purchase="http://api.123poi.com/purchase/">
<content type="application/xml">
<purchase:purchase>
<purchase:deviceInfos>
<purchase:deviceInfo>
<purchase:metadata>metadata_1381229866048</purchase:metadata>
</purchase:deviceInfo>
</purchase:deviceInfos>
</purchase:purchase>
</content>
</entry>
| User Story | Ein User kann einen Kauf abfragen. |
| HTTP | GET |
| URL | http://api.123poi.com/data/product/api/purchase/ |
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:product="http://api.123poi.com/product/"
xmlns:poi="http://api.123poi.com/poi/" xmlns:exif="http://api.123poi.com/exif/"
xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:data="http://api.123poi.com/data/"
xmlns:purchase="http://api.123poi.com/purchase/" xmlns:media="http://search.yahoo.com/mrss/"
xmlns:falkmedia="http://api.123poi.com/media/" xmlns:falkgeo="http://api.123poi.com/geo/">
<openSearch:totalResults>1</openSearch:totalResults>
<openSearch:startIndex>0</openSearch:startIndex>
<openSearch:itemsPerPage>1</openSearch:itemsPerPage>
<openSearch:Query role="request" poi:access="VISIBLE"/>
<updated>2013-10-10T13:26:00.199Z</updated>
<link href="http://testapi.123poi.com/data/poi/api/purchase/1" rel="self"/>
<title type="text">Anzeigen von Käufen</title>
<subtitle type="text"/>
<id>http://testapi.123poi.com/data/poi/api/purchase/1</id>
<author>
<name>Falk POI API</name>
</author>
<openSearch:searchtime>41</openSearch:searchtime>
<entry>
<id>http://testapi.123poi.com/data/poi/api/purchase/1</id>
<title type="text">product_1381231405874</title>
<updated>2013-10-10T13:26:00.202Z</updated>
<content type="application/xml">
<purchase:purchase xmlns:logo="http://api.123poi.com/logo/"
xmlns:critique="http://api.123poi.com/critique/"
xmlns:event="http://api.123poi.com/event/" xmlns:tour="http://api.123poi.com/tour/"
xmlns:user="http://api.123poi.com/user/"
xmlns:destination="http://api.123poi.com/destination/">
<purchase:purchaseId>1</purchase:purchaseId>
<user:user>
<user:id>7</user:id>
<user:name>Test user7</user:name>
</user:user>
<purchase:type>type</purchase:type>
<user:customer>
<user:id>8</user:id>
<user:name>Test customer 1</user:name>
</user:customer>
<purchase:productId>product_1381231405874</purchase:productId>
<purchase:creationDate>1381411289064</purchase:creationDate>
<purchase:creationDateFormatted>2013-10-10 15:21:29
+0200</purchase:creationDateFormatted>
<purchase:lastUpdate>1381411376041</purchase:lastUpdate>
<purchase:lastUpdateFormatted>2013-10-10 15:22:56
+0200</purchase:lastUpdateFormatted>
</purchase:purchase>
</content>
</entry>
</feed>
| User Story | Ein User kann all sein Käufe abfragen. |
| HTTP | GET |
| URL | http://api.123poi.com/data/product/api/purchase/all |
Es kommen Informationen zu all seinen Käufen zurück.