Skip to content

Conversation

@MattKelvin
Copy link

@MattKelvin MattKelvin commented Aug 25, 2025

Questions Answers
Description? See below
Type? new feature
BC breaks? no
Deprecations? no
Fixed ticket? /
Sponsor company Mademoiselle bio
How to test? See below

Any advices welcome :)

New endpoints

GET /manufacturers
GET /manufacturer/1
POST /manufacturer
PATCH /manufacturer/1
DELETE /manufacturer/1
PUT /manufacturers/delete

How to test

  1. Setup
  • Install Prestashop 9.0.x.
  • Install the ps_apiresources module from this branch.
  • Navigate to modules/ps_apiresources and run:
    composer install
  • Clear the cache
    composer clear-test-cache
  1. API Configuration
  • In the API Admin, create a new client with the following permissions:
    -- manufacturer_read
    -- manufacturer_write
  • Disable Security Mode in the API Admin.
  1. cURL Examples
  • In the examples below, replace:
    -- YOUR_CLIENT_ID
    -- YOUR_CLIENT_SECRET
    -- YOUR_DOMAIN_NAME
    -- YOUR_ACCESS_TOKEN
  1. Get a new access token :
curl --location 'YOUR_DOMAIN_NAME/admin-api/access_token' \
--form 'grant_type="client_credentials"' \
--form 'client_id="YOUR_CLIENT_ID"' \
--form 'client_secret="YOUR_CLIENT_SECRET"' \
--form 'scope[]="manufacturer_read"' \
--form 'scope[]="manufacturer_write"'
  1. Get a manufacturer
curl --location 'YOUR_DOMAIN_NAME/admin-api/manufacturer/1' --header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
  1. Create a new manufacturer
curl --location 'YOUR_DOMAIN_NAME/admin-api/manufacturer' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--data '{
  "name": "test",
  "shortDescriptions": {
    "1": "test"
  },
  "descriptions": {
    "1": "test"
  },
  "metaTitles": {
    "1": "test"
  },
  "metaDescriptions": {
    "1": "test"
  },
  "metaKeywords": {
    "1": "test"
  },
  "enabled": true,
  "shopAssociation": [1]
}'
  1. Update a mananufacturer
curl --location --request PATCH 'YOUR_DOMAIN_NAME/admin-api/manufacturer/26' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--data '{
  "name": "update test",
  "shortDescriptions": {
    "1": "update test"
  },
  "descriptions": {
    "1": "update test"
  },
  "metaTitles": {
    "1": "update test"
  },
  "metaDescriptions": {
    "1": "update test"
  },
  "metaKeywords": {
    "1": "update test"
  },
  "enabled": true,
  "associatedShops": [1]
}'
  1. List manufacturers
curl --location 'YOUR_DOMAIN_NAME/admin-api/manufacturers' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
  1. Delete a manufacturer
curl --location --request DELETE 'YOUR_DOMAIN_NAME/admin-api/manufacturer/15' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
  1. Delete bulk
curl --location --request PUT 'YOUR_DOMAIN_NAME/admin-api/manufacturers/delete' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--data '{
  "manufacturerIds": {
    "1": ID1,
    "2": ID2,
    "3": ID3
  }
}'

To execute tests

cd modules/ps_apiresources
php -d date.timezone=UTC ./vendor/bin/phpunit -c tests/Integration/phpunit-local.xml --filter=Manufacturer

Thank you

@ps-jarvis
Copy link

Hello @MattKelvin!

This is your first pull request on ps_apiresources repository of the PrestaShop project.

Thank you, and welcome to this Open Source community!

@Codencode
Copy link
Contributor

Codencode commented Sep 18, 2025

Hello @MattKelvin,
in this categories endpoint PR #61, I've implemented a service to "validate" a field that involves the editor (in admin) based on the PS_ALLOW_HTML_IFRAME configuration. The manufacturer also has this type of field, perhaps you could implement it too? Obviously, if my PR gets approved, the service will already exist and it will be PrestaShop\Module\APIResources\Validation\IframeValidationGroupsResolver.
What do you think?

@MattKelvin
Copy link
Author

It would be amazing ! Let's wait for the result of your PR 🙏

Thank you :)

@Codencode
Copy link
Contributor

Perfect, thank you!

@Codencode
Copy link
Contributor

@MattKelvin the PR has been merged: #61, so if you want you can use the service PrestaShop\Module\APIResources\Validation\IframeValidationGroupsResolver

@MattKelvin
Copy link
Author

Hello @Codencode

I just did it. What do you think about my implementation ?

Thank you ! :)

@Codencode
Copy link
Contributor

Hello @MattKelvin, I think you did a good job, congratulations!

Codencode
Codencode previously approved these changes Sep 25, 2025
tleon
tleon previously approved these changes Sep 29, 2025
Copy link
Contributor

@tleon tleon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx :)

@tleon tleon added the Waiting for QA Status: Waiting for QA feedback label Sep 29, 2025
@ps-jarvis ps-jarvis moved this from Ready for review to To be tested in PR Dashboard Sep 29, 2025
@SiraDIOP SiraDIOP self-assigned this Oct 13, 2025
Copy link

@SiraDIOP SiraDIOP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @MattKelvin,

Thanks for your pr i tested but At the admin API level, I don't have the manufacturer endpoint, but I do have it in Swagger.

Uploading Enregistrement de l’écran 2025-10-13 à 18.47.51.mov…

Do you think I've missed something?

Thanks

@MattKelvin
Copy link
Author

Hi @SiraDIOP,

Thanks for testing this PR. 🙏

Can you try to clear the PrestaShop cache and do a composer install in the module directory?

@SiraDIOP
Copy link

Hello @MattKelvin,

Thanks,
I tested it and it's good for me :)

Get a manufacturer:
Capture d’écran 2025-10-14 à 16 37 14

Create a new manufacturer:
Capture d’écran 2025-10-14 à 16 47 29

Update a manufacturer:
Capture d’écran 2025-10-14 à 16 51 22

List manufacturers:
Capture d’écran 2025-10-14 à 16 52 44

Delete a manufacturer:
Capture d’écran 2025-10-14 à 16 54 31

Delete bulk:
Capture d’écran 2025-10-14 à 16 59 26

Thanks :)

SiraDIOP
SiraDIOP previously approved these changes Oct 14, 2025
@SiraDIOP SiraDIOP added QA ✔️ Status: QA-Approved and removed Waiting for QA Status: Waiting for QA feedback labels Oct 14, 2025
@MattKelvin
Copy link
Author

Thanks @SiraDIOP!

⚠️ Note that we need this brand to be merged before PrestaShop/PrestaShop#39470

Else I can disable the endpoint which need it (GET /manufacturer/1/details/1)

Thank you!

@kpodemski
Copy link
Contributor

I added a "Blocked by Core" label.

That also means that ps_apiresources minimum compatibility will have to be adjusted and bumped to PrestaShop 9.0.2.

@MattKelvin MattKelvin dismissed stale reviews from SiraDIOP, tleon, and Codencode via 10ef284 November 20, 2025 18:48
@ps-jarvis ps-jarvis moved this from To be tested to Waiting for author in PR Dashboard Nov 28, 2025
@nicosomb
Copy link
Contributor

@MattKelvin tests are red

@MattKelvin
Copy link
Author

@nicosomb, just rebased it thanks!

@kpodemski
Copy link
Contributor

Hello @MattKelvin

Could you remove merge commits? 🙏🏻 That helps keep git history clean.

@kpodemski
Copy link
Contributor

Hello @MattKelvin

There's still one merge commit inside your pull request. To keep the git history clean, we need to remove it.

@MattKelvin MattKelvin force-pushed the add-manufacturer-endpoint branch from c6def0f to 5ef7a32 Compare December 17, 2025 10:33
@MattKelvin
Copy link
Author

Hello @kpodemski

Sorry for the delay. I tried to remove it. Can you launch the tests? :)

Thanks!

@kpodemski kpodemski closed this Jan 23, 2026
@github-project-automation github-project-automation bot moved this from Waiting for author to Closed in PR Dashboard Jan 23, 2026
@kpodemski kpodemski reopened this Jan 23, 2026
@github-project-automation github-project-automation bot moved this from Closed to Reopened in PR Dashboard Jan 23, 2026
@kpodemski
Copy link
Contributor

kpodemski commented Jan 23, 2026

Hello @MattKelvin

Just a quick heads-up: reviews on pending Admin API PRs will start in the coming days.

We first took some time to clarify and unify the Admin API contribution rules and ADR expectations. With that work done, the team will now review existing PRs based on those updates.

Thanks for your patience. Feedback will follow directly on the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Reopened

Development

Successfully merging this pull request may close these issues.

8 participants