Skip to content

feat: add ~170 new API endpoints for multiple domains#166

Closed
Amoifr wants to merge 53 commits intoPrestaShop:mainfrom
Amoifr:feat/api-endpoints-batch1
Closed

feat: add ~170 new API endpoints for multiple domains#166
Amoifr wants to merge 53 commits intoPrestaShop:mainfrom
Amoifr:feat/api-endpoints-batch1

Conversation

@Amoifr
Copy link
Copy Markdown

@Amoifr Amoifr commented Mar 29, 2026

Summary

This PR adds approximately 170 new API endpoints across multiple domains to help close the gap identified in issue #39630.

Domains implemented:

Domain Endpoints Description
Cart 18 Full cart management (products, cart rules, settings, addresses, etc.)
Order 20 Order viewing, status updates, refunds, shipping, addresses, notes
Product 24 Bulk ops, duplicate, categories, stock, tags, features, specific prices, combinations
Customer 4 Private notes, guest transform, orders/carts queries
SearchEngine 5 Full CRUD + bulk delete
Tag 5 Full CRUD + bulk delete
AttributeGroup 5 Full CRUD + bulk delete
Carrier 7 Full CRUD + toggle status
CatalogPriceRule 5 Full CRUD + bulk delete
Manufacturer 7 Full CRUD + bulk delete + toggle status
Employee 6 GET/PATCH/DELETE + bulk operations
CmsPage 8 Full CRUD + bulk ops + toggle status
OrderMessage 5 Full CRUD + bulk delete
Profile 5 Full CRUD + bulk delete
State 8 Full CRUD + bulk ops + zone update
CustomerGroup 4 Full CRUD
ImageType 5 Full CRUD + bulk delete
Hook 2 GET + update status
Meta 3 GET/POST/PATCH
Currency 5 Existing + additions
Language 4 Existing + additions
OrderState 5 Full CRUD + bulk delete
OrderReturnState 5 Full CRUD + bulk delete
CmsPageCategory 2 Additional endpoints

Key features:

  • Follows existing CQRS patterns with CQRSGet, CQRSCreate, CQRSPartialUpdate, CQRSDelete, CQRSUpdate
  • Proper exception to HTTP status mapping
  • LocalizedValue support for multi-language fields
  • Bulk operations where applicable
  • Consistent API scopes for authorization

Test plan

  • Run existing test suite
  • Verify endpoints are properly registered in API Platform
  • Test CRUD operations for new domains
  • Verify OpenAPI documentation is generated correctly

🤖 Generated with Claude Code

dependabot bot and others added 30 commits November 25, 2024 14:40
Bumps [symfony/process](https://github.com/symfony/process) from 6.3.4 to 6.4.15.
- [Release notes](https://github.com/symfony/process/releases)
- [Changelog](https://github.com/symfony/process/blob/7.1/CHANGELOG.md)
- [Commits](symfony/process@v6.3.4...v6.4.15)

---
updated-dependencies:
- dependency-name: symfony/process
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
… whole matrix is used when merging towards main
…Resources allowed types are restricted to scalar inputs, and a closed list of exceptions
… ApiResources mapping to keep a consistency, test logic is also improved on addresses because it did not check the relevant data
…o-project

GitHub add issue to project workflow
add get country single /countries/{countryId}
…oint-creation

Add claude skill to generate endpoints
…symfony/process-6.4.15

Bump symfony/process from 6.3.4 to 6.4.15
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 10.5.38 to 10.5.62.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/10.5.62/ChangeLog-10.5.md)
- [Commits](sebastianbergmann/phpunit@10.5.38...10.5.62)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-version: 10.5.62
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [symfony/process](https://github.com/symfony/process) from 6.4.15 to 6.4.33.
- [Release notes](https://github.com/symfony/process/releases)
- [Changelog](https://github.com/symfony/process/blob/8.1/CHANGELOG.md)
- [Commits](symfony/process@v6.4.15...v6.4.33)

---
updated-dependencies:
- dependency-name: symfony/process
  dependency-version: 6.4.33
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…/phpunit/phpunit-10.5.62

Bump phpunit/phpunit from 10.5.38 to 10.5.62
…/symfony/process-6.4.33

Bump symfony/process from 6.4.15 to 6.4.33
Expose the GetCategoryIsEnabled query to retrieve the enabled/disabled
status of a category via the Admin API.
pcescon added 5 commits March 29, 2026 23:15
Add complete Cart domain with 18 endpoints:
- GET/POST/DELETE /carts - main cart operations
- POST/DELETE /carts/{cartId}/products - add/remove products
- PUT /carts/{cartId}/products/quantity - update quantity
- PUT /carts/{cartId}/products/{productId}/price - update price
- POST /carts/{cartId}/customizations - add customizations
- POST/DELETE /carts/{cartId}/cart-rules - manage cart rules
- PUT /carts/{cartId}/addresses - update addresses
- PUT /carts/{cartId}/carrier - update carrier
- PUT /carts/{cartId}/currency - update currency
- PUT /carts/{cartId}/language - update language
- PUT /carts/{cartId}/delivery-settings - update delivery
- DELETE /carts/bulk-delete - bulk delete carts
- GET /carts/{cartId}/order-creation - get cart for order
- GET /customers/{customerId}/last-empty-cart - get last empty cart
Add complete Order domain with 20 endpoints:
- GET /orders/{orderId} - get order for viewing
- GET /orders/{orderId}/preview - get order preview
- GET /orders/{orderId}/products - get order products
- POST /orders - create order from back office
- PUT /orders/{orderId}/status - update order status
- PUT /orders/bulk-update-status - bulk update status
- PUT /orders/{orderId}/delivery-address - change delivery address
- PUT /orders/{orderId}/invoice-address - change invoice address
- PUT /orders/{orderId}/shipping - update shipping details
- PUT /orders/{orderId}/currency - change currency
- PUT /orders/{orderId}/note - set internal note
- POST /orders/{orderId}/cart-rules - add cart rule
- DELETE /orders/{orderId}/cart-rules/{id} - delete cart rule
- POST /orders/{orderId}/resend-email - resend order email
- POST /carts/{cartId}/send-process-order-email - send process email
- POST /orders/{orderId}/duplicate-cart - duplicate cart
- POST /orders/{orderId}/refund/standard - standard refund
- POST /orders/{orderId}/refund/partial - partial refund
- POST /orders/{orderId}/refund/return - return product
- POST /orders/{orderId}/cancel-products - cancel products
SearchEngine (5 endpoints):
- GET/POST/PATCH/DELETE /search-engines
- DELETE /search-engines/bulk-delete

Tag (5 endpoints):
- GET/POST/PATCH/DELETE /tags
- DELETE /tags/bulk-delete
Add 4 new Customer endpoints:
- PUT /customers/{customerId}/note - set private note
- POST /customers/{customerId}/transform-guest - convert guest to customer
- GET /customers/{customerId}/orders - get customer orders
- GET /customers/{customerId}/carts - get customer carts
Add 24 new Product endpoints:
- DELETE/PUT /products/bulk-delete, bulk-update-status
- POST /products/{id}/duplicate - duplicate product
- PUT/DELETE /products/{id}/categories - manage categories
- GET/POST/PATCH/DELETE /specific-prices - specific price CRUD
- PUT /products/{id}/stock - update stock
- PUT/DELETE /products/{id}/related-products - manage related
- PUT/DELETE /products/{id}/tags - manage tags
- PUT /products/{id}/carriers - set carriers
- PATCH/DELETE /combinations/{id} - update/delete combination
- DELETE /combinations/bulk-delete - bulk delete combinations
- POST /products/{id}/virtual-product-file - add virtual file
- PUT/DELETE /virtual-product-files/{id} - manage virtual files
- PUT/DELETE /products/{id}/features - manage features
@ps-jarvis
Copy link
Copy Markdown

Hello @Amoifr!

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

Thank you, and welcome to this Open Source community!

@axel-paillaud
Copy link
Copy Markdown

axel-paillaud commented Mar 30, 2026

Hello @Amoifr,

In my opinion, you should divide this into several pull requests to make it easier for the maintainers to test.

Also, you clearly haven't tested the endpoints yourself. For example, GET cms-pages needs a fix in the core to work (draft); otherwise, you get a crash and a 500 error with your suggestion.

Btw, I specifically mentioned supporting CmsPage here :)

Finally, I think you might be comparing the wrong GitHub branch, because we can all see the Git history which doesn't correspond to your commits.

@Amoifr
Copy link
Copy Markdown
Author

Amoifr commented Mar 30, 2026

Hey @axel-paillaud! 👋

Thanks a lot for the thorough review and helpful feedback! You were absolutely right about splitting this massive PR - it was definitely too much to digest in one go.

I've now split both PRs (#166 and #167) into smaller, domain-focused PRs:

From #166 (~170 endpoints):

From #167 (~40 endpoints):

I've also:

  • Applied header-stamp for license headers
  • Applied rector for URI template conventions
  • Fixed floatDecimalNumber for prices/rates
  • Removed Tag endpoints (CQRS not available in PS 9.0.x)

I'll close this PR and #167 now. Feel free to review the smaller ones at your own pace!

Thanks again for your vigilance - it made the contribution much better! 🙏

@Amoifr
Copy link
Copy Markdown
Author

Amoifr commented Mar 30, 2026

Closing in favor of smaller, domain-focused PRs (#168-#182). See comment above for details.

@Amoifr Amoifr closed this Mar 30, 2026
@github-project-automation github-project-automation bot moved this from Ready for review to Closed in PR Dashboard Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

9 participants