# Zahlungs- und Versandarten per REST API abfragen

**URL:** <https://forum.shopware.com/t/zahlungs-und-versandarten-per-rest-api-abfragen/46305>\
**Category:** Programmierung\
**Created:** [13. Juni 2017 um 13:53 UTC](https://forum.shopware.com/t/zahlungs-und-versandarten-per-rest-api-abfragen/46305 "2017-06-13T13:53:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbdus](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/mbdus/32/12997_2.png) [@mbdus](https://forum.shopware.com/u/mbdus)\
**Post date:** [13. Juni 2017 um 13:53 UTC](https://forum.shopware.com/t/zahlungs-und-versandarten-per-rest-api-abfragen/46305/1 "2017-06-13T13:53:47Z")

</div>

Hallo Community,

ich würde gerne Bestellungen per REST API anlegen. Das funktioniert soweit mit der Shopwareversion 5.2.21.

Mein Problem ist, dass ich die Zahlungs- und Versandarten-IDs nicht zur Verfügung habe. Deshalb möchte ich diese mit bspw. den Namen (Rechnung, Vorkasse, Paypal, etc.) abfragen. Im Moment fällt mir nur dazu ein, die API per Plugin zu erweitern, um die IDs abzufragen.

Geht es auch einfacher bzw. eleganter?

Grüße

Mathias

---

<div class="post-metadata">

**Author:** ![mbdus](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/mbdus/32/12997_2.png) [@mbdus](https://forum.shopware.com/u/mbdus)\
**Post date:** [14. Juni 2017 um 06:49 UTC](https://forum.shopware.com/t/zahlungs-und-versandarten-per-rest-api-abfragen/46305/2 "2017-06-14T06:49:35Z")

</div>

Hier nochmal der Codeausschnitt, wie ich gerne eine Bestellung anlegen möchte:

```
$client->post ( 'orders', array (
		"customerId" => $customerId,
		"paymentId" => $status,
		"dispatchId" => 10,
		"partnerId" => "",
		"shopId" => 1,
		"invoiceAmount" => sprintf ( "%01.2f", ($amount) ),
		"invoiceAmountNet" => sprintf ( "%01.2f", ($amountNet) ),
		"invoiceShipping" => $invoice,
		"invoiceShippingNet" => sprintf ( "%01.2f", ($invoiceNet) ),
		"orderTime" => date ( "Y-m-d H:i:s" ),
		"net" => 0,
		"taxFree" => 0,
		"languageIso" => "1",
		"currency" => "EUR",
		"currencyFactor" => 1,
		"remoteAddress" => "11.11.11.11",
		"details" => $articles,
		"documents" => array (),
		"comment" => $comment,
		"customerComment" => "Bestellung von Marktplatz xyz",
		"billing" => array (
				"id" => '',
				"customerId" => $customerId,
				"countryId" => 2,
				"stateId" => 3,
				"company" => $company,
				"salutation" => "mr",
				"firstName" => $firstname,
				"lastName" => $lastname,
				"street" => $street,
				"zipCode" => $zipcode,
				"city" => $city 
		),
		"shipping" => array (
				"id" => 2,
				"countryId" => 2,
				"stateId" => 3,
				"customerId" => 1,
				"company" => $company,
				"salutation" => "mr",
				"firstName" => $firstname,
				"lastName" => $lastname,
				"street" => $street,
				"zipCode" => $zipcode,
				"city" => $city 
		),
		"paymentStatusId" => 17,
		"orderStatusId" => 0 
) );

```

An die $customerId komme ich noch ran:

```
$params = [
	'filter' => [
		[
			'property' => 'email',
			'value' => $mail
		]
	]
];

$data = $client->get('customers',$params);

```

Ich muss aber zwingend auch die dispatchId und paymentStatusId setzen können. Der Kunde hat hier die Auswahl der Zahlungsarten und Versandarten als Name. Die Ids stehen nicht zur Verfügung. Diese müsste ich irgendwie abfragen.

Für einen Ansatz wäre ich dankbar.

Grüße

Mathias

---

<div class="post-metadata">

**Author:** ![mbdus](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/mbdus/32/12997_2.png) [@mbdus](https://forum.shopware.com/u/mbdus)\
**Post date:** [16. Juni 2017 um 14:36 UTC](https://forum.shopware.com/t/zahlungs-und-versandarten-per-rest-api-abfragen/46305/3 "2017-06-16T14:36:26Z")

</div>

@shopware‍

So wie ich es mitbekommen habe, wird Shopware Partner des Marktplatzes werden. ![Thumb-Up](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/7fcda44f782696668a3d093569d15e88105769e1.png "Thumb-Up")

Meine Einschätzung bleibt, dass ich mit einem Plugin die API erweitern muss, um die ZahlungsartenIDs und VersandartenIDs auslesen zu können. Außerdem brauche ich min. Shopware 5.2.21. Einen anderen Weg sehe ich im Moment nicht. Oder habe ich etwas übersehen?

Grüße

Mathias

&nbsp;
