How can I create a custom api for product detail?

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
Jairus34
Posts: 31
Joined: 05 Aug 2024, 07:34

How can I create a custom api for product detail?

Post by Jairus34 » 28 Aug 2024, 08:09

Code: Select all

Enviroment:
Aimeos: dev-master
Laravel: 11
Mac OS
Hi community,

I'm currently working on a system with a separate front end using React Next.js. We're utilizing the Aimeos JSON API to fetch data, but certain data points need to be formatted before being sent to the front end.

How can I create a custom API for a single product in this setup? Is the process similar to Laravel, where you:

1. Create a controller
2 Define the API route in app/routes/api.php

Does this approach apply here as well?

Thanks in advance for your help!

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

Re: How can I create a custom api for product detail?

Post by aimeos » 29 Aug 2024, 10:22

The Laravel approach works but we don't recommend that way. You get all data you need from the existing Aimeos JSON:API and all transformations of the data for displaying it should be done in your JS frontend application.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply