Ecommerce Integration
There have been a lot of conversations about the evolution of Ecommerce support on the platform. This wiki section will capture the messy details and evolve as we converge on an approach.
At a very high-level, there is some important context:
The Django Oscar based Ecommerce service has been deprecated and is unmaintained
We have developed a simple integration with WooCommerce as the reference implementation for a different approach. This approach recommends that the Open edX project does not have a customized commerce service, but a robust set of APIs for integrating with best-of-breed solutions.
There are existing users of the Django Oscar Ecommerce service. The plan should support those users migrating to something better.
High-level Division of Responsibilities
This is a rough diagram of how we might separate the roles and responsibilities of any ecommerce integration target from the Open edX LMS. The image includes comments from a community meeting on 10/04/2024. Today the LMS has quite a few commerce related details in it. This proposal would result in those being removed. The LMS would not have any knowledge of concepts like bundles, discounts, offers, or even prices.
WooCommerce Details
Copied here for the convenience of the reader
We use the LMS APIs to do the basic functionalities.
To obtain info about enrollments, we use
GET /enrollment/v1/enrollments/
To create enrollments,
POST /enrollment/v1/enrollment
To perform an unenroll, we use the same endpoint to create enrollment, but we set the attribute is_active in
False
.We can pass the flag force in the request to allow you to enroll; disregard the course’s enrollment end dates.
To know if a user exists in the platform,
GET /user/v1/accounts
If the user does not exist yet, we can get, create, or delete an enrollment allowed with:
GET, POST, DELETE /api/enrollment/v1/enrollment_allowed/
MIT’s Ecommerce Middleware
Besides account registration and authentication, MIT’s ecommerce middleware (xpro.mit.edu and mitxonline.mit.edu) uses the following open edX APIs:
Create Enrollment (
/api/enrollment/v1/enrollment
)LIst Enrollment (
/api/enrollment/v1/enrollments
)
Run saler.io as ecommerce: We are testing this option and will report back as soon as possible.