API | listPrice muss ein Array sein. Wer weiß wie dieses aussehen muss?

Hallo zusammen,

was muss ich im JSON angeben bei listPrice damit es funktioniert.

Hier mein JSON:

 "price": [
                {
                    "currencyId": "b7d2554b0ce847cd82f3ac9bd1c0dfca",
                    "net": 1590.7563025210084,
                    "gross": 1893.0,
                    "listPrice": 2093.0,
                    "linked": false
                }
            ]

Bekomme folgende Fehlermeldung:

{
    "errors": [
        {
            "code": "FRAMEWORK__WRITE_CONSTRAINT_VIOLATION",
            "status": "400",
            "detail": "Dieser Wert sollte vom Typ array|(Traversable\u0026ArrayAccess) sein.",
            "template": "This value should be of type {{ type }}.",
            "meta": {
                "parameters": {
                    "{{ type }}": "array|(Traversable\u0026ArrayAccess)"
                }
            },
            "source": {
                "pointer": "\/0\/price\/0\/listPrice"
            }
        },
        {
            "code": "FRAMEWORK__WRITE_CONSTRAINT_VIOLATION",
            "status": "400",
            "detail": "Dieser Wert sollte vom Typ array|(Traversable\u0026ArrayAccess) sein.",
            "template": "This value should be of type {{ type }}.",
            "meta": {
                "parameters": {
                    "{{ type }}": "array|(Traversable\u0026ArrayAccess)"
                }
            },
            "source": {
                "pointer": "\/0\/children\/0\/price\/0\/listPrice"
            }
        },
        {
            "code": "FRAMEWORK__WRITE_CONSTRAINT_VIOLATION",
            "status": "400",
            "detail": "Dieser Wert sollte vom Typ array|(Traversable\u0026ArrayAccess) sein.",
            "template": "This value should be of type {{ type }}.",
            "meta": {
                "parameters": {
                    "{{ type }}": "array|(Traversable\u0026ArrayAccess)"
                }
            },
            "source": {
                "pointer": "\/0\/children\/1\/price\/0\/listPrice"
            }
        },
        {
            "code": "FRAMEWORK__WRITE_CONSTRAINT_VIOLATION",
            "status": "400",
            "detail": "Dieser Wert sollte vom Typ array|(Traversable\u0026ArrayAccess) sein.",
            "template": "This value should be of type {{ type }}.",
            "meta": {
                "parameters": {
                    "{{ type }}": "array|(Traversable\u0026ArrayAccess)"
                }
            },
            "source": {
                "pointer": "\/0\/children\/2\/price\/0\/listPrice"
            }
        },
        {
            "code": "FRAMEWORK__WRITE_CONSTRAINT_VIOLATION",
            "status": "400",
            "detail": "Dieser Wert sollte vom Typ array|(Traversable\u0026ArrayAccess) sein.",
            "template": "This value should be of type {{ type }}.",
            "meta": {
                "parameters": {
                    "{{ type }}": "array|(Traversable\u0026ArrayAccess)"
                }
            },
            "source": {
                "pointer": "\/0\/children\/3\/price\/0\/listPrice"
            }
        },
        {
            "code": "c1051bb4-d103-4f74-8988-acbcafc7fdc3",
            "status": "400",
            "detail": "Dieser Wert sollte nicht leer sein.",
            "template": "This value should not be blank.",
            "meta": {
                "parameters": {
                    "{{ value }}": "null"
                }
            },
            "source": {
                "pointer": "\/0\/children\/3\/media\/0\/mediaId"
            }
        },
        {
            "code": "FRAMEWORK__WRITE_CONSTRAINT_VIOLATION",
            "status": "400",
            "detail": "Dieser Wert sollte vom Typ array|(Traversable\u0026ArrayAccess) sein.",
            "template": "This value should be of type {{ type }}.",
            "meta": {
                "parameters": {
                    "{{ type }}": "array|(Traversable\u0026ArrayAccess)"
                }
            },
            "source": {
                "pointer": "\/0\/children\/4\/price\/0\/listPrice"
            }
        },
        {
            "code": "FRAMEWORK__WRITE_CONSTRAINT_VIOLATION",
            "status": "400",
            "detail": "Dieser Wert sollte vom Typ array|(Traversable\u0026ArrayAccess) sein.",
            "template": "This value should be of type {{ type }}.",
            "meta": {
                "parameters": {
                    "{{ type }}": "array|(Traversable\u0026ArrayAccess)"
                }
            },
            "source": {
                "pointer": "\/0\/children\/5\/price\/0\/listPrice"
            }
        },
        {
            "code": "FRAMEWORK__WRITE_CONSTRAINT_VIOLATION",
            "status": "400",
            "detail": "Dieser Wert sollte vom Typ array|(Traversable\u0026ArrayAccess) sein.",
            "template": "This value should be of type {{ type }}.",
            "meta": {
                "parameters": {
                    "{{ type }}": "array|(Traversable\u0026ArrayAccess)"
                }
            },
            "source": {
                "pointer": "\/0\/children\/6\/price\/0\/listPrice"
            }
        },
        {
            "code": "FRAMEWORK__WRITE_CONSTRAINT_VIOLATION",
            "status": "400",
            "detail": "Dieser Wert sollte vom Typ array|(Traversable\u0026ArrayAccess) sein.",
            "template": "This value should be of type {{ type }}.",
            "meta": {
                "parameters": {
                    "{{ type }}": "array|(Traversable\u0026ArrayAccess)"
                }
            },
            "source": {
                "pointer": "\/0\/children\/7\/price\/0\/listPrice"
            }
        },
        {
            "code": "FRAMEWORK__WRITE_CONSTRAINT_VIOLATION",
            "status": "400",
            "detail": "Dieser Wert sollte vom Typ array|(Traversable\u0026ArrayAccess) sein.",
            "template": "This value should be of type {{ type }}.",
            "meta": {
                "parameters": {
                    "{{ type }}": "array|(Traversable\u0026ArrayAccess)"
                }
            },
            "source": {
                "pointer": "\/0\/children\/8\/price\/0\/listPrice"
            }
        },
        {
            "code": "FRAMEWORK__WRITE_CONSTRAINT_VIOLATION",
            "status": "400",
            "detail": "Dieser Wert sollte vom Typ array|(Traversable\u0026ArrayAccess) sein.",
            "template": "This value should be of type {{ type }}.",
            "meta": {
                "parameters": {
                    "{{ type }}": "array|(Traversable\u0026ArrayAccess)"
                }
            },
            "source": {
                "pointer": "\/0\/children\/9\/price\/0\/listPrice"
            }
        },
        {
            "code": "FRAMEWORK__WRITE_CONSTRAINT_VIOLATION",
            "status": "400",
            "detail": "Dieser Wert sollte vom Typ array|(Traversable\u0026ArrayAccess) sein.",
            "template": "This value should be of type {{ type }}.",
            "meta": {
                "parameters": {
                    "{{ type }}": "array|(Traversable\u0026ArrayAccess)"
                }
            },
            "source": {
                "pointer": "\/0\/children\/10\/price\/0\/listPrice"
            }
        }
    ]
}

Vielen Dank für jede Hilfe.

Hi s-a,

der Parameter listPrice muss noch ein mal mit „gross“, „net“, „currencyId“ und „linked“ aufgeschlüsselt werden, sprich:

"price": [
        {
            "gross": 110,
            "net": 110,
            "currencyId": "b7d2554b0ce847cd82f3ac9bd1c0dfca",
            "linked": false,
            "listPrice": {
                "gross": 120,
                "net": 120,
                "currencyId": "b7d2554b0ce847cd82f3ac9bd1c0dfca",
                "linked": false
            }
        }
    ],

Beispiel entnommen aus platform/variantProductListingPrice.js at 6.4.0.0 · shopware/platform · GitHub

@cogiPatrick Vielen Vielen Dank. Es funktioniert.

1 „Gefällt mir“