Hilfe bei associations (Orderabfrage)

Kann mir jemand einen Tipp geben, wie ich meine Abfrage (Orderdetails) zum Laufen bekomme? Dabei werden
die Associations country und customerComment völlig ignoriert, obwohl ich sie bei den includes meiner Meinung nach ordnungsgemäß aufgeführt habe.

Vielen Dank im voraus,
Thomas

Uri: /api/search/order 
Method: POST
{
    "associations": {
        "addresses": {
            "associations": {
                "country": []
            }
        },
        "deliveries": {
            "associations": {
                "shippingMethod": {},
                "shippingOrderAddress": [],
                "stateMachineState": {}
            }
        },
        "lineItems": {
            "associations": {
                "product": {
                    "associations": {
                        "options": {},
                        "tags": {}
                    }
                }
            }
        },
        "orderCustomer": {},
        "salesChannel": {
            "associations": {
                "paymentMethods": []
            }
        },
        "transactions": {
            "associations": {
                "paymentMethod": {},
                "stateMachineState": []
            },
        },
        "log_entry": [
            "id",
            "customerComment"
        ]
    },
    "filter": [
        {
            "field": "orderNumber",
            "parameters": {
                "gt": 10001,
                "lte": 19999
            },
            "type": "range"
        }
    ],
    "includes": {
        "country": [
            "iso",
            "name"
        ],
        "deliveries": [
            "id",
            "shippingDateEarliest",
            "shippingDateLatest",
            "stateMachineState"
        ],
        "order": [
            "id",
            "orderNumber",
            "lineItems",
            "addresses",
            "deliveries",
            "stateMachineState",
            "orderCustomer",
            "shippinTotal",
            "salesChannelId",
            "transactions"
        ],
        "order_address": [
            "id",
            "firstName",
            "lastName",
            "street",
            "zipcode",
            "city",
            "company",
            "department",
            "country",
            "phoneNumber"
        ],
        "order_customer": [
            "email",
            "firstName",
            "lastName",
            "customerNumber",
            "vatIds",
            "email"
        ],
        "order_line_item": [
            "id",
            "position",
            "quantity",
            "description",
            "label",
            "unitPrice",
            "productId",
            "payload",
            "productNumer",
            "parentId",
            "product"
        ],
        "order_transaction": [
            "id",
            "amount",
            "stateMachineState",
            "paymentMethod"
        ],
        "payment_method": [
            "id",
            "name"
        ],
        "product": [
            "id",
            "productNumber",
            "attributes",
            "type",
            "name",
            "description",
            "metaTitle",
            "keywords",
            "tags",
            "children",
            "options"
        ],
        "tags": [
            "id",
            "name"
        ],
        "log_entry": [
            "id",
            "customerComment"
        ]
    },
    "limit": 500,
    "sort": [
        {
            "field": "orderNumber",
            "naturalSorting": true,
            "order": "ASC"
        }
    ]
}

Also bei mir geht das so:

{
	"limit": 1000,
	"sort": [{
		"field": "createdAt",
		"order": "ASC"
	}],
	"includes": {
		"order": ["id", "orderNumber", "orderDateTime", "orderCustomer", "lineItems", "transactions", "billingAddress", "deliveries", "shippingCosts"],
		"country": ["id", "iso", "iso3"],
		"order_address": ["id", "firstName", "lastName", "additionalAddressLine1", "additionalAddressLine2", "company", "street", "zipcode", "city", "country"],
		"order_line_item": ["id", "label", "position", "quantity", "unitPrice", "product", "payload"],
		"order_transaction": ["id", "paymentMethod", "extensions"],
		"payment_method": ["id", "distinguishableName"],
		"order_customer": ["id", "email"],
		"order_delivery": ["id", "shippingOrderAddress"],
		"calculated_price": ["totalPrice"]
	},
	"associations": {
		"lineItems": {
			"associations": {
				"product": {}
			}
		},
		"transactions": {
			"associations": {
				"paymentMethod": {}
			}
		},
		"billingAddress": {
			"associations": {
				"country": {}
			}
		},
		"deliveries": {
			"associations": {
				"shippingOrderAddress": {
					"associations": {
						"country": {}
					}
				}
			}
		}
	}
}

Servus ThomasChr.

Den CustomerComent hab ich mittlerweile hinbekommen, doch die salutation liefert nur die Id, statt des displayNames. :-/
Hast Du noch einen Tipp?

{
    "associations": {
        "addresses": {
            "associations": {
                "country": []
            }
        },
        "deliveries": {
            "associations": {
                "shippingMethod": {},
                "shippingOrderAddress": [],
                "stateMachineState": {}
            }
        },
        "lineItems": {
            "associations": {
                "product": {
                    "associations": {
                        "options": {},
                        "tags": {}
                    }
                }
            }
        },
        "orderCustomer": {
            "associations": {
                "salutation":[]
            }
        },
        "salesChannel": {
            "associations": {
                "paymentMethods": []
            }
        },
        "transactions": {
            "associations": {
                "paymentMethod": {},
                "stateMachineState": []
            }
        }
    },
    "filter": [
        {
            "field": "orderNumber",
            "parameters": {
                "gt": 10001,
                "lte": 19999
            },
            "type": "range"
        }
    ],
    "includes": {
        "country": [
            "iso",
            "name"
        ],
        "deliveries": [
            "id",
            "shippingDateEarliest",
            "shippingDateLatest",
            "stateMachineState"
        ],
        "order": [
            "id",
            "orderNumber",
            "createdAt",
            "updatedAt",
            "lineItems",
            "addresses",
            "deliveries",
            "stateMachineState",
            "orderCustomer",
            "shippinTotal",
            "salesChannelId",
            "transactions",
            "customerComment"
        ],
        "order_address": [
            "id",
            "firstName",
            "lastName",
            "street",
            "zipcode",
            "city",
            "company",
            "department",
            "country",
            "phoneNumber"
        ],
        "order_customer": [
            "email",
//            "salutationId",
            "firstName",
            "lastName",
            "customerNumber",
            "vatIds",
            "email"
        ],
        "order_line_item": [
            "id",
            "position",
            "quantity",
            "description",
            "label",
            "unitPrice",
            "productId",
            "payload",
            "productNumer",
            "parentId",
            "product"
        ],
        "order_transaction": [
            "id",
            "amount",
            "stateMachineState",
            "paymentMethod"
        ],
        "payment_method": [
            "id",
            "name"
        ],
        "product": [
            "id",
            "productNumber",
            "attributes",
            "type",
            "name",
            "description",
            "metaTitle",
            "keywords",
            "tags",
            "children",
            "options"
        ],
        "salutation": [
            "id",
            "displayName"
        ],
        "tags": [
            "id",
            "name"
        ]
    },
    "limit": 500,
    "sort": [
        {
            "field": "orderNumber",
            "naturalSorting": true,
            "order": "ASC"
        }
    ]
}

Einfachster Tipp: Nimm mal den includes zu „order_customer“ komplett raus. Dann siehst du alle Felder. Und dann siehst du auch dass das Feld dass du suchst einfach „salutation“ heißt (ist ein Unterobject).
„works on my machine“ :slight_smile: