cagcoach
cagcoach

Reputation: 679

Documentation for Shopware 6 Admin API. What are possible commands?

I got the task to integrate the systems of our old shop to Shopware 6. So I have to deal with the Admin API. The documentation says:

The Admin API is designed in such a way that all entities of the system can be read in the same way. Once an entity is registered in the system, it can be written and read via API

https://developer.shopware.com/docs/guides/integrations-api/admin-api/reading-entities

How do those entities work? Is there a list/documentation of all default entities? Do I have to register the entities myself?

Upvotes: 2

Views: 4629

Answers (2)

Alex
Alex

Reputation: 35028

Shopware 6 API documentation sources

There is a public Shopware 6 API documentation (admin API and store API) available at

Local Documentation

Otherwise you can use the /api/v{version}/_info/swagger.html as pointed out by Valerii.

Be advised that starting from Shopware 6.4, the API version is no longer used in requests. So as per documentation you have to open something like

https://your-shop-url.invalid/api/_info/swagger.html

Make sure you have set

APP_ENV=dev

in your .env and use this only locally and not on a publicly accessible server.

The advantage of using the local documentation is, that you will also see endpoints which are introduced by additional extensions.

Reverse engineering instead of documentation

In addition you can always check the network tab of your browser when doing the intented action in the Shopware admin panel, and learn about the necessary requests.

Upvotes: 3

Valerio8787
Valerio8787

Reputation: 905

You don't need to register "default" entities that are provided by Shopware core. But if you define your own custom entity you have to register it as a service. You can get a list of entities that are registered in the core using /api/v{version}/_info/swagger.html endpoint which generates swagger UI docs.

Upvotes: 1

Related Questions