# API nutzen um bestimmte Bestellvariablen auszugeben

**URL:** https://forum.shopware.com/t/api-nutzen-um-bestimmte-bestellvariablen-auszugeben/63777
**Category:** Programmierung
**Created:** [2. Januar 2020 um 15:33 UTC](https://forum.shopware.com/t/api-nutzen-um-bestimmte-bestellvariablen-auszugeben/63777 "2020-01-02T15:33:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![oneredox](https://avatars.discourse-cdn.com/v4/letter/o/e5b9ba/32.png) [@oneredox](https://forum.shopware.com/u/oneredox)
#### Post date: [2. Januar 2020 um 15:33 UTC](https://forum.shopware.com/t/api-nutzen-um-bestimmte-bestellvariablen-auszugeben/63777/1 "2020-01-02T15:33:04Z")

</div>

Ein frohes neues Jahr&nbsp;Zusammen,

leider stecke ich gerade in einer gedanklichen Sackgasse.

Ich möchte über die API Schnittstelle Daten wie Name, Adresse usw. auslesen und in einem internen Formular ausgeben.

Bei der Abfrage&nbsp;

```
$client->get('orders/6');

```

erhalte ich natürlich eine sehr umfangreiche JSON Ausgabe&nbsp;a la

```
HTTP: 200
Success
Array
(
    [id] => 6
    [changed] => 2020-01-02T12:05:58+0100
    [number] => 20003
    [customerId] => 3
    [paymentId] => 5
    [dispatchId] => 9
    [partnerId] => 
    [shopId] => 1
    [invoiceAmount] => 1.5
    [invoiceAmountNet] => 1.26
    [invoiceShipping] => 0
    [invoiceShippingNet] => 0
    [invoiceShippingTaxRate] => 19
    [orderTime] => 2020-01-02T12:05:58+0100
    [transactionId] => 
    [comment] => 
    [customerComment] => 
    [internalComment] => 
    [net] => 0
    [taxFree] => 0
    [temporaryId] => 
    [referer] => 
    [clearedDate] => 
    [trackingCode] => 
    [languageIso] => 1
    [currency] => EUR
    [currencyFactor] => 1
    [remoteAddress] => 88.130.0.0
    [deviceType] => desktop
    [isProportionalCalculation] => 
    [details] => Array
        (
            [0] => Array
                (
                    [id] => 18
                    [orderId] => 6
                    [articleId] => 180
                    [taxId] => 1
                    [taxRate] => 19
                    [statusId] => 0
                    [articleDetailID] => 258
                    [number] => 20003
                    [articleNumber] => PB-100
                    [price] => 1.5
                    [quantity] => 1
                    [articleName] => Pizzabrötchen mit Kräuterbutter 
                    [shipped] => 0
                    [shippedGroup] => 0
                    [releaseDate] => 
                    [mode] => 0
                    [esdArticle] => 0
                    [config] => 
                    [ean] => 
                    [unit] => 
                    [packUnit] => 
                    [attribute] => Array

```

&nbsp;

Wie schaffe ich es nun, dass ich nur Werte wie “Name” “Adresse” etc. ausgeben kann.

Irgendwie bewege ich mich gedankklich gerade im Kreis und hoffe auf eure Hilfe

---

<div class="post-metadata">

### Author: ![oneredox](https://avatars.discourse-cdn.com/v4/letter/o/e5b9ba/32.png) [@oneredox](https://forum.shopware.com/u/oneredox)
#### Post date: [3. Januar 2020 um 11:52 UTC](https://forum.shopware.com/t/api-nutzen-um-bestimmte-bestellvariablen-auszugeben/63777/2 "2020-01-03T11:52:09Z")

</div>

UPDATE,

die Ausgabe an sich ist nun kein Problem mehr.

Jedoch denke ich, dass meine Abfrage nicht korrekt formuliert ist.

&nbsp;

Ich möchte beispielsweise den Artikelnamen ausgeben:

&nbsp;

```
[1] => Array
                (
                    [id] => 7
                    [orderId] => 4
                    [articleId] => 369
                    [taxId] => 1
                    [taxRate] => 19
                    [statusId] => 0
                    [articleDetailID] => 558
                    [number] => 20002
                    [articleNumber] => AG-105
                    [price] => 76
                    [quantity] => 1
                    [articleName] => Party Service Angebot (für ca. 15 Personen)
                    [shipped] => 0
                    [shippedGroup] => 0
                    [releaseDate] => -0001-11-30T00:00:00+0100
                    [mode] => 0
                    [esdArticle] => 0
                    [config] => 
                    [ean] => 
                    [unit] => 
                    [packUnit] => 
                    [attribute] => Array
                        (
                            [id] => 7
                            [orderDetailId] => 7
                            [attribute1] => 
                            [attribute2] => 
                            [attribute3] => 
                            [attribute4] => 
                            [attribute5] => 
                            [attribute6] => 
                            [swpArticleInputFieldsData] => 
                            [dvsnConfiguratorInput] => 
                            [pickwareCanceledQuantity] => 0

```

&nbsp;

Hierzu nutze ich folgende Abfrage:

```
get("orders/4");

  if(is_array($details ) or isset($details ["1"] ["articleName"])) {

  foreach($details ["1"] ["data"] as $articleName) {
     echo $articleName ["1"] ["articleName"];
  }

}

?>

```

&nbsp;

So weit, so gut - die Ausgabe funktioniert.

Jedoch erhalte ich als Ausgabewert: “**0090U0oParty Service Angebot (für ca. 15 Personen)**”

Woher kommt der mysteriöse Präfix " **0090U0o**"

Hat hierzu jemand eine Idee?
