OmniSeller:SW6 Plugin: Unterschied zwischen den Versionen

Aus HTK Wiki
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
 
(13 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:


<div class="mw-parser-output">
<div class="mw-parser-output">
<div class="mw-parser-output">
== das OmniSeller Plugin für Zusatzfunktionen in Shopware6 ==
== das OmniSeller Plugin für Zusatzfunktionen in Shopware6 ==
<div class="mw-parser-output">
<div class="mw-parser-output">
=== Hintergründe ===
=== Hintergründe ===
<div>Uns erreichen zunehmend Anfragen zur Ausleitung von bestimmten Sage100/ERP Daten in Richtung Shopware, um dort zusätzliche Funktionen &nbsp;wie z.B. Kundenstamm-Import, kundenspezifische Preise oder Erstellungsmöglichkeiten von Verkaufsstatistiken abbilden zu können.</div> <div>&nbsp;</div> <div>Dieses Plugin soll ein paar dieser Punkte abbilden.</div> <div>Technisch erweitert dieses Plugin die von Shopware existierende REST-API.</div> <div>Es werden spezifische Endpunkte zur Verfügung gestellt, die dann angesprochen werden können.</div> <div>Eine Übersicht hierzu finden Sie unten.</div> <div>&nbsp;</div> </div>
<div>Uns erreichen zunehmend Anfragen zur Ausleitung von bestimmten Sage100/ERP Daten in Richtung Shopware, um dort zusätzliche Funktionen &nbsp;wie z.B. Kundenstamm-Import, kundenspezifische Preise oder Erstellungsmöglichkeiten von Verkaufsstatistiken abbilden zu können.</div> <div>&nbsp;</div> <div>Dieses Plugin soll ein paar dieser Punkte abbilden.</div> <div>Technisch erweitert dieses Plugin die von Shopware existierende REST-API.</div> <div>Es werden spezifische Endpunkte zur Verfügung gestellt, die dann angesprochen werden können.</div> <div>Eine Übersicht hierzu finden Sie unten.</div> <div>&nbsp;</div> </div> <div class="mw-parser-output"><div class="mw-parser-output"><div class="mw-parser-output"><div class="mw-parser-output"><div class="mw-parser-output"><div class="mw-parser-output"><div class="mw-parser-output"><div class="mw-parser-output">
 
<div class="mw-parser-output"><div class="mw-parser-output">
<div class="mw-parser-output">
<div class="mw-parser-output"><div class="mw-parser-output">
<div class="mw-parser-output">
=== Inhalte/API Endpunkte ===
=== Inhalte/API Endpunkte ===


Zeile 36: Zeile 31:
&nbsp;
&nbsp;


==== Statistik Import: ====
==== Statistik Import ====


{| border="1" cellpadding="1" cellspacing="1" style="width: 500px;"
{| border="1" cellpadding="1" cellspacing="1" style="width: 500px;"
Zeile 54: Zeile 49:


&nbsp;
&nbsp;
<div class="mw-parser-output"><div class="mw-parser-output"><div class="mw-parser-output"><div class="mw-parser-output"><div class="mw-parser-output"><div class="mw-parser-output"><div class="mw-parser-output"><div class="mw-parser-output"><div class="mw-parser-output">
==== B2BPreise ====
einfacher Request für Versionserfragung und Test ob Plugin installiert/aktiv


<div class="mw-parser-output">
{{{!}} style="width: 500px;" border="1" cellspacing="1" cellpadding="1"
<div class="mw-parser-output"><div class="mw-parser-output"><div class="mw-parser-output">
{{!}}-
==== B2BPreise ====
{{!}} style="width: 102px;" {{!}} Route
{{!}} style="width: 385px;" {{!}} /api/v3/omniseller/b2bpricesCheck
{{!}}-
{{!}} style="width: 102px;" {{!}} Request-Tpye
{{!}} style="width: 385px;" {{!}} GET
{{!}}-  
{{!}} style="width: 102px;" {{!}} Request-Json
{{!}} style="width: 385px;" {{!}} &nbsp;
{{!}}-  
{{!}} style="width: 102px;" {{!}} Response-Json
{{!}} style="width: 385px;" {{!}} <div><div>{</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;"Installation":&nbsp;"OK",</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;"version":&nbsp;"1.0.2"</div>
<div>}</div></div>
{{!}}}
&nbsp;


Anlegen von B2B-Preise
Anlegen von B2B-Preise


{| border="1" cellpadding="1" cellspacing="1" style="width: 500px;"
{{{!}} style="width: 500px; height: 604px;" border="1" cellspacing="1" cellpadding="1"
|-
{{!}}- style="height: 28px;"  
| style="width: 102px;" | Route
{{!}} style="width: 103.271px; height: 28px;" {{!}} Route
| style="width: 385px;" | /api/v3/omniseller/b2bprices
{{!}} style="width: 389.729px; height: 28px;" {{!}} /api/v3/omniseller/b2bprices
|-
{{!}}- style="height: 28px;"
| style="width: 102px;" | Request-Tpye
{{!}} style="width: 103.271px; height: 28px;" {{!}} Request-Tpye
| style="width: 385px;" | POST
{{!}} style="width: 389.729px; height: 28px;" {{!}} POST
|-
{{!}}- style="height: 362px;"
| style="width: 102px;" | Request-Json
{{!}} style="width: 103.271px; height: 362px;" {{!}} Request-Json
| style="width: 385px;" | <div>[{<br/> &nbsp; &nbsp; &nbsp; &nbsp; "Company": "123",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "CustID": "D12345",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "Item": "08154711",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "Variation": "0",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "Ref": "",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "Price": "123,45",</div> <div>&nbsp; &nbsp; &nbsp; &nbsp; "Discount": "10,00",<br/> &nbsp; &nbsp; }</div> <div>]</div>  
{{!}} style="width: 389.729px; height: 362px;" {{!}} <div>[</div>
|-
<div>&nbsp; &nbsp;&nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; "Company": "123",<br>&nbsp; &nbsp; &nbsp; &nbsp; "CustID": "D12345",</div>
| style="width: 102px;" | Response-Json
<div>&nbsp; &nbsp; &nbsp; &nbsp; "Email":"example@htk.de",<br>&nbsp; &nbsp; &nbsp; &nbsp; "Item": "08154711",<br>&nbsp; &nbsp; &nbsp; &nbsp; "Variation": "0",<br>&nbsp; &nbsp; &nbsp; &nbsp; "Ref": "",</div>
| style="width: 385px;" | <div>{</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;"status":&nbsp;"FINISHED",</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;"successful":&nbsp;1,</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;"inserts":&nbsp;0,</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;"updates":&nbsp;1,</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;"errors":&nbsp;0</div> <div>}</div>  
<div>&nbsp; &nbsp; &nbsp; &nbsp; "AbMenge":"0",<br>&nbsp; &nbsp; &nbsp; &nbsp; "Price": "123,45",</div>
|}
<div>&nbsp; &nbsp; &nbsp; &nbsp; "Discount": "10,00",</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; "IsBruttoPrice": true,</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; "AllowDiscount": true,</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; "UploadID": 1234657890<br>&nbsp; &nbsp; }</div>
<div>]</div>
{{!}}- style="height: 158px;"
{{!}} style="width: 103.271px; height: 158px;" {{!}} Response-Json
{{!}} style="width: 389.729px; height: 158px;" {{!}} <div>{</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;"status":&nbsp;"FINISHED",</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;"successful":&nbsp;1,</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;"inserts":&nbsp;0,</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;"updates":&nbsp;1,</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;"errors":&nbsp;0</div>
<div>}</div>
{{!}}}
&nbsp;
 
Ein Delete Request, der alle Einträge löscht, die eine alte UploadID haben. Bereinigt alte Einträge unmittelbar nach einer vollständigen B2BPrice Synchronisation


{{{!}} style="width: 500px; height: 197px;" border="1" cellspacing="1" cellpadding="1"
{{!}}- style="height: 28px;"
{{!}} style="width: 103.271px; height: 28px;" {{!}} Route
{{!}} style="width: 389.729px; height: 28px;" {{!}} /api/v3/omniseller/b2bpricesdeleteold
{{!}}- style="height: 28px;"
{{!}} style="width: 103.271px; height: 28px;" {{!}} Request-Tpye
{{!}} style="width: 389.729px; height: 28px;" {{!}} POST
{{!}}- style="height: 28px;"
{{!}} style="width: 103.271px; height: 28px;" {{!}} Request-Body
{{!}} style="width: 389.729px; height: 28px;" {{!}} "1234567890"
{{!}}- style="height: 113px;"
{{!}} style="width: 103.271px; height: 113px;" {{!}} Response-Json
{{!}} style="width: 389.729px; height: 113px;" {{!}} <div><div>{</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; "message":"Es wurden xx Einträge gelöscht",</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; "success":true</div>
<div>}</div></div>
{{!}}}
&nbsp;
&nbsp;


Ein Delete Request, der alle Einträge löscht, die seit mindestens&nbsp;24 Stunden&nbsp;nicht mehr geupdated wurden. Bereinigt alte Einträge unmittelbar nach einer vollständigen B2BPrice Synchronisation
Es können auch gezielt einzelne Preise gelöscht werden:
 
{| border="1" cellpadding="1" cellspacing="1" style="width: 500px;"
|-
| style="width: 102px;" | Route
| style="width: 385px;" | /api/v3/omniseller/b2bpricesDeleteOld
|-
| style="width: 102px;" | Request-Tpye
| style="width: 385px;" | POST
|-
| style="width: 102px;" | Request-Json
| style="width: 385px;" | &nbsp;
|-
| style="width: 102px;" | Response-Json
| style="width: 385px;" | <div><div>{</div> <div>&nbsp; &nbsp; &nbsp; &nbsp; "message":"Es wurden xx Einträge gelöscht",</div> <div>&nbsp; &nbsp; &nbsp; &nbsp; "success":true</div> <div>}</div> </div>
|}


{{{!}} style="width: 500px;" border="1" cellspacing="1" cellpadding="1"
{{!}}-
{{!}} style="width: 102px;" {{!}} Route
{{!}} style="width: 385px;" {{!}} /api/v3/omniseller/b2bpricesDeleteSpecific
{{!}}-
{{!}} style="width: 102px;" {{!}} Request-Tpye
{{!}} style="width: 385px;" {{!}} POST
{{!}}-
{{!}} style="width: 102px;" {{!}} Request-Json
{{!}} style="width: 385px;" {{!}} <div>[&nbsp; &nbsp; &nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp;{<br>&nbsp; &nbsp;&nbsp; "Company": "123",<br>&nbsp; &nbsp;&nbsp; "CustID": "D12345",<br>&nbsp; &nbsp;&nbsp; "Item": "08154711",<br>&nbsp; &nbsp;&nbsp; "Variation": "0"<br>&nbsp; &nbsp; }</div>
<div>]</div>
{{!}}-
{{!}} style="width: 102px;" {{!}} Response-Json
{{!}} style="width: 385px;" {{!}} <div>{</div>
<div>&nbsp;&nbsp;&nbsp; "status":"FINISHED",</div>
<div>&nbsp;&nbsp;&nbsp; "successful":1,</div>
<div>&nbsp;&nbsp;&nbsp; "errors":0,</div>
<div>&nbsp; &nbsp; "deleted":1</div>
<div>}</div>
{{!}}-
{{!}} style="width: 102px;" {{!}} &nbsp;
{{!}} style="width: 385px;" {{!}} &nbsp;
{{!}}}
&nbsp;
&nbsp;
<div class="mw-parser-output">&nbsp;</div>


Es können auch gezielt einzelne Preise gelöscht werden:
==== Kundenimport ====


{| border="1" cellpadding="1" cellspacing="1" style="width: 500px;"
{| border="1" cellpadding="1" cellspacing="1" style="width: 500px;"
|-
|-
| style="width: 102px;" | Route
| style="width: 102px;" | Route
| style="width: 385px;" | /api/v3/omniseller/b2bpricesDeleteSpecific
| style="width: 385px;" | /api/v3/omniseller/customersImport
|-
|-
| style="width: 102px;" | Request-Tpye
| style="width: 102px;" | Request-Tpye
Zeile 108: Zeile 166:
|-
|-
| style="width: 102px;" | Request-Json
| style="width: 102px;" | Request-Json
| style="width: 385px;" | <div>[{<br/> &nbsp; &nbsp; &nbsp; &nbsp; "Company": "123",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "CustID": "D12345",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "Item": "08154711",<br/> &nbsp; &nbsp; &nbsp; &nbsp; "Variation": "0"<br/> &nbsp; &nbsp; }</div> <div>]</div>  
| style="width: 385px;" | <div><div>[{<br/> &nbsp;&nbsp; &nbsp;"Kto_Aktiv":"1",<br/> &nbsp;&nbsp; &nbsp;"Kto":"D10000",<br/> &nbsp;&nbsp; &nbsp;"AdressID":"12345",<br/> &nbsp;&nbsp; &nbsp;"EUUStID":"DE 12345677",<br/> &nbsp;&nbsp; &nbsp;"EULand":"DE",<br/> &nbsp;&nbsp; &nbsp;"Sprache":"DE",<br/> &nbsp;&nbsp; &nbsp;"Rabattgruppe":"R1",<br/> &nbsp;&nbsp; &nbsp;"Rabattsatz":"20",&nbsp;<br/> &nbsp;&nbsp; &nbsp;"Istgesperrt":0,<br/> &nbsp;&nbsp; &nbsp;"Zahlungskondition":"Vorkasse",&nbsp;<br/> &nbsp;&nbsp; &nbsp;"Vertreter":"",<br/> &nbsp;&nbsp; &nbsp;"Adressgruppe":"",<br/> &nbsp;&nbsp; &nbsp;"Ansprechpartner_Nummer":"123546",&nbsp;<br/> &nbsp;&nbsp; &nbsp;"EMail":"mh@htk.de",<br/> &nbsp;&nbsp; &nbsp;"Anrede":"Herr",<br/> &nbsp;&nbsp; &nbsp;"Ansprechpartner":"",<br/> &nbsp;&nbsp; &nbsp;"Vorname":"Marvin",<br/> &nbsp;&nbsp; &nbsp;"Nachname":"Harant",<br/> &nbsp;&nbsp; &nbsp;"Typ":"L",<br/> &nbsp;&nbsp; &nbsp;"Name1":"",<br/> &nbsp;&nbsp; &nbsp;"Name2":"",<br/> &nbsp;&nbsp; &nbsp;"Lieferstrasse":"In der Nauroth 2",<br/> &nbsp;&nbsp; &nbsp;"LieferPLZ":"67158",<br/> &nbsp;&nbsp; &nbsp;"LieferOrt":"Ellerstadt",<br/> &nbsp;&nbsp; &nbsp;"Lieferzusatz":"",<br/> &nbsp;&nbsp; &nbsp;"Lieferland":"DE",<br/> &nbsp;&nbsp; &nbsp;"Telefon":"06237 306010",<br/> &nbsp;&nbsp; &nbsp;"Telefax":""</div> <div>}</div> <div>]</div> </div>  
|-
|-
| style="width: 102px;" | Response-Json
| style="width: 102px;" | Response-Json
| style="width: 385px;" | <div>{</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;"status":&nbsp;"FINISHED",</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;"successful":&nbsp;1,</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;"errors":&nbsp;0,</div> <div>&nbsp; &nbsp; "deleted":1</div> <div>}</div>  
| style="width: 385px;" | <div>{</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;"status":&nbsp;"FINISHED",</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;"successful":&nbsp;1,</div> <div>&nbsp; &nbsp; "inserts":10,</div> <div>&nbsp; &nbsp; "updates":2,&nbsp;</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;"errors":&nbsp;0</div> <div>}</div>  
|-
|-
| style="width: 102px;" | &nbsp;
| style="width: 102px;" | &nbsp;
| style="width: 385px;" | &nbsp;
| style="width: 385px;" | &nbsp;
|}
|}
</div> </div> </div>
 
&nbsp;
 
<div class="mw-parser-output">
<div class="mw-parser-output">
<div class="mw-parser-output">
= Installation =
<div>Da das Plugin in dieser Form (noch) nicht im Shopware Store existiert muss dieses manuell über das Shopware Backend installiert werden.</div> <div>Bei neuen Shopware6 Versionen (6.4+) gibt es links ein Feld "Erweiterungen". Dort kann dann unter "meine Erweiterungen" das Zip File hochgeladen werden. Anschließend über die 3 Punkte installieren und zuletzt aktivieren.</div> <div>Bei älteren Shopware6 Versionen ist das Prinzip das gleiche, nur ist die Plugin Seite links im Menü unter Einstellungen->System->Plugins zu finden.</div> </div></div>

Aktuelle Version vom 11. Oktober 2021, 10:15 Uhr

das OmniSeller Plugin für Zusatzfunktionen in Shopware6

Hintergründe

Uns erreichen zunehmend Anfragen zur Ausleitung von bestimmten Sage100/ERP Daten in Richtung Shopware, um dort zusätzliche Funktionen  wie z.B. Kundenstamm-Import, kundenspezifische Preise oder Erstellungsmöglichkeiten von Verkaufsstatistiken abbilden zu können.
 
Dieses Plugin soll ein paar dieser Punkte abbilden.
Technisch erweitert dieses Plugin die von Shopware existierende REST-API.
Es werden spezifische Endpunkte zur Verfügung gestellt, die dann angesprochen werden können.
Eine Übersicht hierzu finden Sie unten.
 

Inhalte/API Endpunkte

Shopware API Authentifizierung

Route /api/oauth/token
Request-Tpye POST
Request-Json
{
    "client_id": "administration",
    "grant_type":"password",
    "username":"<username>",
    "password":"<password>"
}
 
Response-Json
{
    "token_type": "Bearer",
    "expires_in": 600,
    "access_token": "<Token>",
    "refresh_token": "<RefreshToken>"
}
 

 

Nach der erfolgreichen Authentifizierung wird dann bei den folgenden Endpunkt Requests ein Authorization Header mit "Bearer <Token>" angehängt.

 

Statistik Import

Route /api/v3/omniseller/statistik
Request-Tpye POST
Request-Json
[{
        "kunde": "D100000",
        "periode": "2002003",
        "mandant": 123,
        "menge": "10,0000",
        "umsatz": "77,7900",
        "roherloes": "77,7900"
    }
]
Response-Json
{
    "status": "FINISHED",
    "successful": 1,
    "inserts": 0,
    "updates": 1,
    "errors": 0
}

 

B2BPreise

einfacher Request für Versionserfragung und Test ob Plugin installiert/aktiv

Route /api/v3/omniseller/b2bpricesCheck
Request-Tpye GET
Request-Json  
Response-Json
{
    "Installation": "OK",
    "version": "1.0.2"
}

 

Anlegen von B2B-Preise

Route /api/v3/omniseller/b2bprices
Request-Tpye POST
Request-Json
[
     {
        "Company": "123",
        "CustID": "D12345",
        "Email":"example@htk.de",
        "Item": "08154711",
        "Variation": "0",
        "Ref": "",
        "AbMenge":"0",
        "Price": "123,45",
        "Discount": "10,00",
        "IsBruttoPrice": true,
        "AllowDiscount": true,
        "UploadID": 1234657890
    }
]
Response-Json
{
    "status": "FINISHED",
    "successful": 1,
    "inserts": 0,
    "updates": 1,
    "errors": 0
}

 

Ein Delete Request, der alle Einträge löscht, die eine alte UploadID haben. Bereinigt alte Einträge unmittelbar nach einer vollständigen B2BPrice Synchronisation

Route /api/v3/omniseller/b2bpricesdeleteold
Request-Tpye POST
Request-Body "1234567890"
Response-Json
{
        "message":"Es wurden xx Einträge gelöscht",
        "success":true
}

 

Es können auch gezielt einzelne Preise gelöscht werden:

Route /api/v3/omniseller/b2bpricesDeleteSpecific
Request-Tpye POST
Request-Json
[     
       {
     "Company": "123",
     "CustID": "D12345",
     "Item": "08154711",
     "Variation": "0"
    }
]
Response-Json
{
    "status":"FINISHED",
    "successful":1,
    "errors":0,
    "deleted":1
}
   

 

 

Kundenimport

Route /api/v3/omniseller/customersImport
Request-Tpye POST
Request-Json
[{
    "Kto_Aktiv":"1",
    "Kto":"D10000",
    "AdressID":"12345",
    "EUUStID":"DE 12345677",
    "EULand":"DE",
    "Sprache":"DE",
    "Rabattgruppe":"R1",
    "Rabattsatz":"20", 
    "Istgesperrt":0,
    "Zahlungskondition":"Vorkasse", 
    "Vertreter":"",
    "Adressgruppe":"",
    "Ansprechpartner_Nummer":"123546", 
    "EMail":"mh@htk.de",
    "Anrede":"Herr",
    "Ansprechpartner":"",
    "Vorname":"Marvin",
    "Nachname":"Harant",
    "Typ":"L",
    "Name1":"",
    "Name2":"",
    "Lieferstrasse":"In der Nauroth 2",
    "LieferPLZ":"67158",
    "LieferOrt":"Ellerstadt",
    "Lieferzusatz":"",
    "Lieferland":"DE",
    "Telefon":"06237 306010",
    "Telefax":""
}
]
Response-Json
{
    "status": "FINISHED",
    "successful": 1,
    "inserts":10,
    "updates":2, 
    "errors": 0
}
   

 

Installation

Da das Plugin in dieser Form (noch) nicht im Shopware Store existiert muss dieses manuell über das Shopware Backend installiert werden.
Bei neuen Shopware6 Versionen (6.4+) gibt es links ein Feld "Erweiterungen". Dort kann dann unter "meine Erweiterungen" das Zip File hochgeladen werden. Anschließend über die 3 Punkte installieren und zuletzt aktivieren.
Bei älteren Shopware6 Versionen ist das Prinzip das gleiche, nur ist die Plugin Seite links im Menü unter Einstellungen->System->Plugins zu finden.