Skip to content

Add Product suppliers endpoints (associate, default, remove all) - #268

Closed
PrestaEdit wants to merge 1 commit into
PrestaShop:devfrom
PrestaEdit:add-product-suppliers
Closed

PrestaEdit wants to merge 1 commit into
PrestaShop:devfrom
PrestaEdit:add-product-suppliers

Conversation

@PrestaEdit

Copy link
Copy Markdown
Contributor
Questions Answers
Description? Add the Product suppliers endpoints (associate, default, remove all)
Type? new feature
BC breaks? no
Deprecations? no
Fixed ticket? Related to PrestaShop/PrestaShop#39630
Sponsor company

Adds the Admin API endpoints to manage a product's supplier associations:

  • PUT /products/{productId}/suppliers — SetSuppliersCommand (associate suppliers by id)
  • DELETE /products/{productId}/suppliers — RemoveAllAssociatedProductSuppliersCommand
  • PUT /products/{productId}/default-suppliers — SetProductDefaultSupplierCommand

These manage the associations only (per-supplier reference/price content is handled by a separate
command and can follow up). All return 204.

The integration test associates a fixture supplier, sets it as the default (verified via
product.id_supplier) and removes all (verified via the product_supplier table). Reuses the
product_write scope.

- PUT    /products/{productId}/suppliers          (SetSuppliersCommand)
- DELETE /products/{productId}/suppliers          (RemoveAllAssociatedProductSuppliersCommand)
- PUT    /products/{productId}/default-suppliers   (SetProductDefaultSupplierCommand)

Associate suppliers with a product, set its default supplier and remove all associations. The
integration test associates a fixture supplier, sets it as default (verified via product.id_supplier)
and removes all (verified via the product_supplier table).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jolelievre

Copy link
Copy Markdown
Contributor

Closing in favor of #410, which centralizes all the pending Product-domain endpoints into a single PR: mutualizing the changes makes the review simpler, and it allowed rebuilding the integration tests so that every fixture is created through the API alone (with whole-structure assertions). @PrestaEdit your work is kept and you are co-authored on the commits of #410 — thanks!

Note: in #410 the three operations live in the consolidated ProductSuppliers resource together with the GET and the details PATCH, every write returns the updated supplier options, and the default supplier URI is singularized to /products/{productId}/default-supplier.

@jolelievre jolelievre closed this Aug 11, 2026
@github-project-automation github-project-automation Bot moved this from Ready for review to Closed in PR Dashboard Aug 11, 2026
jolelievre added a commit to jolelievre/ps_apiresources that referenced this pull request Aug 13, 2026
Centralizes the pending Product-domain endpoint PRs into a single
branch, as requested in PrestaShop/PrestaShop#42054 (tracking table:
PrestaShop/PrestaShop#39630). Original content authored by PrestaEdit:

- PrestaShop#337 GET product attribute groups
- PrestaShop#353 GET product supplier options
- PrestaShop#354 GET shop product images
- PrestaShop#361 GET product stock movements
- PrestaShop#374 GET free gift candidates
- PrestaShop#383 POST/PATCH virtual product file
- PrestaShop#384 PUT product image shop associations
- PrestaShop#256 PUT product stock
- PrestaShop#268 product suppliers (associate, default, remove all)
- PrestaShop#269 PATCH product supplier details
- PrestaShop#308 DELETE virtual product file (resource only; its test file
  collides with PrestaShop#383's and the tests are rewritten in this PR)

Endpoints are imported as-is; consolidation, review fixes and test
rewrites follow in dedicated commits.

Co-Authored-By: Jonathan Danse <j.danse@prestaedit.com>
jolelievre added a commit to jolelievre/ps_apiresources that referenced this pull request Sep 15, 2026
Centralizes the pending Product-domain endpoint PRs into a single
branch, as requested in PrestaShop/PrestaShop#42054 (tracking table:
PrestaShop/PrestaShop#39630). Original content authored by PrestaEdit:

- PrestaShop#337 GET product attribute groups
- PrestaShop#353 GET product supplier options
- PrestaShop#354 GET shop product images
- PrestaShop#361 GET product stock movements
- PrestaShop#374 GET free gift candidates
- PrestaShop#383 POST/PATCH virtual product file
- PrestaShop#384 PUT product image shop associations
- PrestaShop#256 PUT product stock
- PrestaShop#268 product suppliers (associate, default, remove all)
- PrestaShop#269 PATCH product supplier details
- PrestaShop#308 DELETE virtual product file (resource only; its test file
  collides with PrestaShop#383's and the tests are rewritten in this PR)

Endpoints are imported as-is; consolidation, review fixes and test
rewrites follow in dedicated commits.

Co-Authored-By: Jonathan Danse <j.danse@prestaedit.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants