JsonAdm Include changes problem

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
Wall0fDeath
Posts: 28
Joined: 30 Aug 2022, 13:56

JsonAdm Include changes problem

Post by Wall0fDeath » 09 Feb 2024, 09:24

Php version: 8.2
Aimeos version: 2023.10.11
Ai-admin-jsonadm version: 2023.10.2
OS version: Debain 11 Bullseye
Laravel version: 10.43.0

Dear Aimeos Team,

I had an older system (Aimeos version : 2022.10), where I used JsonAdm for management as an api. (new routes next to the original routes, same backend) I had to change to 2023.10 version.


-In the older version i had to use the include for the order like this:
.../abcapi/admin/default/jsonadm/order?include=order/base,order/base/product,order/base/address,order/status,order/service
With this I got relationships and product, address etc in the included.

=========================================================
-In the newer version(Aimeos: 2023.10) as I read it well, I have to use it like this:
.../abcapi/admin/default/jsonadm/order?include=order/product,order/address,order/status,order/product/attribute,order/service,order/service/attribute,order/coupon
I have ordred the first demo product with pay on delivery, without login and at the end I checked to "register with order".
But with this I only get the status relationship and statuses in the included section. I see the data like products, address etc in the database.

What did I do wrong or what should I do differently to receive these listed "domains"?

Thanks in advance!
=======================================================
2022:

Code: Select all

{
	"meta": {
		"total": 2,
		"csrf": {
			"name": "_token",
			"value": ""
		}
	},
	"links": {
		"self": "https://xxx/admin/default/jsonadm/order?include=order%2Fbase%2Corder%2Fbase%2Fproduct%2Corder%2Fbase%2Faddress%2Corder%2Fstatus%2Corder%2Fservice%2Corder%2Fcoupon&page%5Boffset%5D=0"
	},
	"data": [
		{
			"id": "1",
			"type": "order",
			"attributes": {
				"order.id": "1",
				"order.siteid": "1.",
				"order.ctime": "2024-02-07 12:44:42",
				"order.mtime": "2024-02-07 12:46:15",
				"order.editor": "xxx@xxx.hu",
				"order.channel": "",
				"order.invoiceno": "1",
				"order.statusdelivery": -1,
				"order.statuspayment": 6,
				"order.datedelivery": null,
				"order.datepayment": "2024-02-07 12:46:15",
				"order.relatedid": "",
				"order.baseid": "1"
			},
			"links": {
				"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/1"
			},
			"relationships": {
				"order\/base": {
					"data": [
						{
							"id": "1",
							"type": "order\/base",
							"links": {
								"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/base\/1"
							}
						}
					]
				},
				"order\/status": {
					"data": [
						{
							"id": "1",
							"type": "order\/status",
							"links": {
								"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/status\/1"
							}
						},
						{
							"id": "2",
							"type": "order\/status",
							"links": {
								"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/status\/2"
							}
						},
						{
							"id": "3",
							"type": "order\/status",
							"links": {
								"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/status\/3"
							}
						}
					]
				}
			}
		},
		{
			"id": "2",
			"type": "order",
			"attributes": {
				"order.id": "2",
				"order.siteid": "1.",
				"order.ctime": "2024-02-07 12:52:26",
				"order.mtime": "2024-02-07 12:52:26",
				"order.editor": "xxx@xxx.hu",
				"order.channel": "",
				"order.invoiceno": "",
				"order.statusdelivery": -1,
				"order.statuspayment": -1,
				"order.datedelivery": null,
				"order.datepayment": null,
				"order.relatedid": "",
				"order.baseid": "2"
			},
			"links": {
				"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/2"
			},
			"relationships": {
				"order\/base": {
					"data": [
						{
							"id": "2",
							"type": "order\/base",
							"links": {
								"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/base\/2"
							}
						}
					]
				},
				"order\/status": {
					"data": [
						{
							"id": "4",
							"type": "order\/status",
							"links": {
								"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/status\/4"
							}
						},
						{
							"id": "5",
							"type": "order\/status",
							"links": {
								"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/status\/5"
							}
						}
					]
				}
			}
		}
	],
	"included": [
		{
			"id": "1",
			"type": "order\/base",
			"attributes": {
				"order.base.id": "1",
				"order.base.siteid": "1.",
				"order.base.ctime": "2024-02-07 12:44:42",
				"order.base.mtime": "2024-02-07 12:44:42",
				"order.base.editor": "xxx@xxx.hu",
				"order.base.sitecode": "default",
				"order.base.customerid": "1",
				"order.base.languageid": "en",
				"order.base.currencyid": "EUR",
				"order.base.price": "1000.00",
				"order.base.costs": "0.00",
				"order.base.rebate": "0.00",
				"order.base.taxflag": true,
				"order.base.taxvalue": "212.5984",
				"order.base.customerref": "",
				"order.base.comment": ""
			},
			"links": {
				"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/base\/1",
				"related": {
					"href": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/base"
				}
			},
			"relationships": {
				"order\/base\/address": {
					"data": [
						{
							"id": "1",
							"type": "order\/base\/address"
						}
					]
				},
				"order\/base\/product": {
					"data": [
						{
							"id": "1",
							"type": "order\/base\/product"
						}
					]
				}
			}
		},
		{
			"id": "2",
			"type": "order\/base",
			"attributes": {
				"order.base.id": "2",
				"order.base.siteid": "1.",
				"order.base.ctime": "2024-02-07 12:52:26",
				"order.base.mtime": "2024-02-07 12:52:26",
				"order.base.editor": "xxx@xxx.hu",
				"order.base.sitecode": "default",
				"order.base.customerid": "1",
				"order.base.languageid": "en",
				"order.base.currencyid": "EUR",
				"order.base.price": "2000.00",
				"order.base.costs": "0.00",
				"order.base.rebate": "0.00",
				"order.base.taxflag": true,
				"order.base.taxvalue": "425.1968",
				"order.base.customerref": "",
				"order.base.comment": ""
			},
			"links": {
				"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/base\/2",
				"related": {
					"href": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/base"
				}
			},
			"relationships": {
				"order\/base\/address": {
					"data": [
						{
							"id": "2",
							"type": "order\/base\/address"
						}
					]
				},
				"order\/base\/product": {
					"data": [
						{
							"id": "2",
							"type": "order\/base\/product"
						}
					]
				}
			}
		},
		{
			"id": "1",
			"type": "order\/base\/address",
			"attributes": {
				"order.base.address.id": "1",
				"order.base.address.siteid": "1.",
				"order.base.address.ctime": "2024-02-07 12:44:42",
				"order.base.address.mtime": "2024-02-07 12:44:42",
				"order.base.address.editor": "xxx@xxx.hu",
				"order.base.address.salutation": "",
				"order.base.address.company": "yxdasd",
				"order.base.address.vatid": "",
				"order.base.address.title": "",
				"order.base.address.firstname": "Gedeon",
				"order.base.address.lastname": "Bácsi",
				"order.base.address.address1": "Kanyargós utca 333",
				"order.base.address.address2": "",
				"order.base.address.address3": "",
				"order.base.address.postal": "1666",
				"order.base.address.city": "Pontott",
				"order.base.address.state": "",
				"order.base.address.countryid": "HU",
				"order.base.address.languageid": "en",
				"order.base.address.telephone": "",
				"order.base.address.telefax": "",
				"order.base.address.email": "ponty.oda@gmail.com",
				"order.base.address.website": "",
				"order.base.address.longitude": null,
				"order.base.address.latitude": null,
				"order.base.address.birthday": null,
				"order.base.address.type": "payment",
				"order.base.address.position": 0,
				"order.base.address.addressid": "",
				"order.base.address.baseid": "1"
			},
			"links": {
				"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/base\/address\/1",
				"related": {
					"href": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/base\/address"
				}
			}
		},
		{
			"id": "2",
			"type": "order\/base\/address",
			"attributes": {
				"order.base.address.id": "2",
				"order.base.address.siteid": "1.",
				"order.base.address.ctime": "2024-02-07 12:52:26",
				"order.base.address.mtime": "2024-02-07 12:52:26",
				"order.base.address.editor": "xxx@xxx.hu",
				"order.base.address.salutation": "",
				"order.base.address.company": "yxdasd",
				"order.base.address.vatid": "",
				"order.base.address.title": "",
				"order.base.address.firstname": "Gedeon",
				"order.base.address.lastname": "Bácsi",
				"order.base.address.address1": "Kanyargós utca 333",
				"order.base.address.address2": "",
				"order.base.address.address3": "",
				"order.base.address.postal": "1666",
				"order.base.address.city": "Pontott",
				"order.base.address.state": "",
				"order.base.address.countryid": "HU",
				"order.base.address.languageid": "en",
				"order.base.address.telephone": "",
				"order.base.address.telefax": "",
				"order.base.address.email": "ponty.oda@gmail.com",
				"order.base.address.website": "",
				"order.base.address.longitude": null,
				"order.base.address.latitude": null,
				"order.base.address.birthday": null,
				"order.base.address.type": "payment",
				"order.base.address.position": 0,
				"order.base.address.addressid": "",
				"order.base.address.baseid": "2"
			},
			"links": {
				"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/base\/address\/2",
				"related": {
					"href": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/base\/address"
				}
			}
		},
		{
			"id": "1",
			"type": "order\/base\/product",
			"attributes": {
				"order.base.product.id": "1",
				"order.base.product.siteid": "1.",
				"order.base.product.ctime": "2024-02-07 12:44:42",
				"order.base.product.mtime": "2024-02-07 12:44:42",
				"order.base.product.editor": "xxx@xxx.hu",
				"order.base.product.price": "1000.00",
				"order.base.product.costs": "0.00",
				"order.base.product.rebate": "0.00",
				"order.base.product.taxrate": "27.00",
				"order.base.product.taxrates": {
					"tax": "27.00"
				},
				"order.base.product.type": "default",
				"order.base.product.stocktype": "default",
				"order.base.product.prodcode": "teszt_termek",
				"order.base.product.productid": "1",
				"order.base.product.parentproductid": "",
				"order.base.product.vendor": "Default",
				"order.base.product.scale": 1,
				"order.base.product.quantity": 1,
				"order.base.product.qtyopen": 1,
				"order.base.product.currencyid": "EUR",
				"order.base.product.taxvalue": "212.5984",
				"order.base.product.taxflag": true,
				"order.base.product.name": "Teszt Termék",
				"order.base.product.description": "",
				"order.base.product.mediaurl": "",
				"order.base.product.timeframe": "",
				"order.base.product.position": 0,
				"order.base.product.notes": "",
				"order.base.product.statuspayment": -1,
				"order.base.product.statusdelivery": -1,
				"order.base.product.baseid": "1",
				"order.base.product.orderproductid": null,
				"order.base.product.orderaddressid": null,
				"order.base.product.target": "",
				"order.base.product.flags": 0
			},
			"links": {
				"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/base\/product\/1",
				"related": {
					"href": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/base\/product"
				}
			}
		},
		{
			"id": "2",
			"type": "order\/base\/product",
			"attributes": {
				"order.base.product.id": "2",
				"order.base.product.siteid": "1.",
				"order.base.product.ctime": "2024-02-07 12:52:26",
				"order.base.product.mtime": "2024-02-07 12:52:26",
				"order.base.product.editor": "xxx@xxx.hu",
				"order.base.product.price": "1000.00",
				"order.base.product.costs": "0.00",
				"order.base.product.rebate": "0.00",
				"order.base.product.taxrate": "27.00",
				"order.base.product.taxrates": {
					"tax": "27.00"
				},
				"order.base.product.type": "default",
				"order.base.product.stocktype": "default",
				"order.base.product.prodcode": "teszt_termek",
				"order.base.product.productid": "1",
				"order.base.product.parentproductid": "",
				"order.base.product.vendor": "Default",
				"order.base.product.scale": 1,
				"order.base.product.quantity": 2,
				"order.base.product.qtyopen": 2,
				"order.base.product.currencyid": "EUR",
				"order.base.product.taxvalue": "212.5984",
				"order.base.product.taxflag": true,
				"order.base.product.name": "Teszt Termék",
				"order.base.product.description": "",
				"order.base.product.mediaurl": "",
				"order.base.product.timeframe": "",
				"order.base.product.position": 0,
				"order.base.product.notes": "",
				"order.base.product.statuspayment": -1,
				"order.base.product.statusdelivery": -1,
				"order.base.product.baseid": "2",
				"order.base.product.orderproductid": null,
				"order.base.product.orderaddressid": null,
				"order.base.product.target": "",
				"order.base.product.flags": 0
			},
			"links": {
				"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/base\/product\/2",
				"related": {
					"href": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/base\/product"
				}
			}
		},
		{
			"id": "1",
			"type": "order\/status",
			"attributes": {
				"order.status.id": "1",
				"order.status.siteid": "1.",
				"order.status.ctime": "2024-02-07 12:44:42",
				"order.status.mtime": "2024-02-07 12:44:42",
				"order.status.editor": "xxx@xxx.hu",
				"order.status.type": "stock-update",
				"order.status.value": "1",
				"order.status.parentid": "1"
			},
			"links": {
				"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/status\/1",
				"related": {
					"href": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/status"
				}
			}
		},
		{
			"id": "2",
			"type": "order\/status",
			"attributes": {
				"order.status.id": "2",
				"order.status.siteid": "1.",
				"order.status.ctime": "2024-02-07 12:44:42",
				"order.status.mtime": "2024-02-07 12:44:42",
				"order.status.editor": "xxx@xxx.hu",
				"order.status.type": "coupon-update",
				"order.status.value": "1",
				"order.status.parentid": "1"
			},
			"links": {
				"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/status\/2",
				"related": {
					"href": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/status"
				}
			}
		},
		{
			"id": "3",
			"type": "order\/status",
			"attributes": {
				"order.status.id": "3",
				"order.status.siteid": "1.",
				"order.status.ctime": "2024-02-07 12:46:15",
				"order.status.mtime": "2024-02-07 12:46:15",
				"order.status.editor": "xxx@xxx.hu",
				"order.status.type": "status-payment",
				"order.status.value": "6",
				"order.status.parentid": "1"
			},
			"links": {
				"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/status\/3",
				"related": {
					"href": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/status"
				}
			}
		},
		{
			"id": "4",
			"type": "order\/status",
			"attributes": {
				"order.status.id": "4",
				"order.status.siteid": "1.",
				"order.status.ctime": "2024-02-07 12:52:26",
				"order.status.mtime": "2024-02-07 12:52:26",
				"order.status.editor": "xxx@xxx.hu",
				"order.status.type": "stock-update",
				"order.status.value": "1",
				"order.status.parentid": "2"
			},
			"links": {
				"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/status\/4",
				"related": {
					"href": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/status"
				}
			}
		},
		{
			"id": "5",
			"type": "order\/status",
			"attributes": {
				"order.status.id": "5",
				"order.status.siteid": "1.",
				"order.status.ctime": "2024-02-07 12:52:26",
				"order.status.mtime": "2024-02-07 12:52:26",
				"order.status.editor": "xxx@xxx.hu",
				"order.status.type": "coupon-update",
				"order.status.value": "1",
				"order.status.parentid": "2"
			},
			"links": {
				"self": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/status\/5",
				"related": {
					"href": "https:\/\/xxx\/admin\/default\/jsonadm\/order\/status"
				}
			}
		}
	]
}
2023:

Code: Select all

{
	"meta": {
		"total": 1,
		"csrf": {
			"name": "_token",
			"value": ""
		}
	},
	"links": {
		"self": "https://.../admin/default/jsonadm/order?include=order%2Fproduct%2Corder%2Faddress%2Corder%2Fstatus%2Corder%2Fproduct%2Fattribute%2Corder%2Fservice%2Corder%2Fservice%2Fattribute%2Corder%2Fcoupon&page%5Boffset%5D=0"
	},
	"data": [
		{
			"id": "1",
			"type": "order",
			"attributes": {
				"order.id": "1",
				"order.siteid": "1.",
				"order.ctime": "2024-02-09 07:54:39",
				"order.mtime": "2024-02-09 07:54:39",
				"order.editor": "89.147.118.70",
				"order.channel": "web",
				"order.invoiceno": "1",
				"order.statusdelivery": -1,
				"order.statuspayment": 5,
				"order.datedelivery": null,
				"order.datepayment": "2024-02-09 07:54:39",
				"order.relatedid": "",
				"order.sitecode": "default",
				"order.customerid": "6",
				"order.languageid": "en",
				"order.currencyid": "EUR",
				"order.price": "100.00",
				"order.costs": "13.00",
				"order.rebate": "0.00",
				"order.taxflag": true,
				"order.taxvalue": "18.8333",
				"order.customerref": "",
				"order.comment": ""
			},
			"links": {
				"self": "https:\/\/...\/admin\/default\/jsonadm\/order\/1"
			},
			"relationships": {
				"order\/status": {
					"data": [
						{
							"id": "1",
							"type": "order\/status",
							"links": {
								"self": "https:\/\/...\/admin\/default\/jsonadm\/order\/status\/1"
							}
						},
						{
							"id": "2",
							"type": "order\/status",
							"links": {
								"self": "https:\/\/...\/admin\/default\/jsonadm\/order\/status\/2"
							}
						},
						{
							"id": "3",
							"type": "order\/status",
							"links": {
								"self": "https:\/\/...\/admin\/default\/jsonadm\/order\/status\/3"
							}
						}
					]
				}
			}
		}
	],
	"included": [
		{
			"id": "1",
			"type": "order\/status",
			"attributes": {
				"order.status.id": "1",
				"order.status.siteid": "1.",
				"order.status.ctime": "2024-02-09 07:54:39",
				"order.status.mtime": "2024-02-09 07:54:39",
				"order.status.editor": "89.147.118.70",
				"order.status.type": "stock-update",
				"order.status.value": "1",
				"order.status.parentid": "1"
			},
			"links": {
				"self": "https:\/\/..\/admin\/default\/jsonadm\/order\/status\/1",
				"related": {
					"href": "https:\/\/...\/admin\/default\/jsonadm\/order\/status"
				}
			}
		},
		{
			"id": "2",
			"type": "order\/status",
			"attributes": {
				"order.status.id": "2",
				"order.status.siteid": "1.",
				"order.status.ctime": "2024-02-09 07:54:39",
				"order.status.mtime": "2024-02-09 07:54:39",
				"order.status.editor": "89.147.118.70",
				"order.status.type": "coupon-update",
				"order.status.value": "1",
				"order.status.parentid": "1"
			},
			"links": {
				"self": "https:\/\/....\/admin\/default\/jsonadm\/order\/status\/2",
				"related": {
					"href": "https:\/\/...\/admin\/default\/jsonadm\/order\/status"
				}
			}
		},
		{
			"id": "3",
			"type": "order\/status",
			"attributes": {
				"order.status.id": "3",
				"order.status.siteid": "1.",
				"order.status.ctime": "2024-02-09 07:54:39",
				"order.status.mtime": "2024-02-09 07:54:39",
				"order.status.editor": "89.147.118.70",
				"order.status.type": "status-payment",
				"order.status.value": "5",
				"order.status.parentid": "1"
			},
			"links": {
				"self": "https:\/\/...\/admin\/default\/jsonadm\/order\/status\/3",
				"related": {
					"href": "https:\/\/...\/admin\/default\/jsonadm\/order\/status"
				}
			}
		}
	]
}
Last edited by Wall0fDeath on 09 Feb 2024, 09:37, edited 1 time in total.

User avatar
aimeos
Administrator
Posts: 7854
Joined: 01 Jan 1970, 00:00

Re: JsonAdm Include changes problem

Post by aimeos » 09 Feb 2024, 09:35

The JsonAdm API required to pass "order" as include to return the related items but that was unintentional. This patch removes that requirement:
https://github.com/aimeos/ai-admin-json ... 07d622841c

Can you update to aimeos/ai-admin-jsonadm:2023.10.x-dev and test if it works now as expected?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
Wall0fDeath
Posts: 28
Joined: 30 Aug 2022, 13:56

Re: JsonAdm Include changes problem

Post by Wall0fDeath » 21 Feb 2024, 08:44

I've checked this version: aimeos/ai-admin-jsonadm:2023.10.x-dev
It seems to be working without the order now. :))
Thank you!

Post Reply