Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow developers to access the Order resource #4

Open
AdamSheaffer opened this issue Apr 1, 2020 · 0 comments
Open

Allow developers to access the Order resource #4

AdamSheaffer opened this issue Apr 1, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@AdamSheaffer
Copy link
Contributor

Implement the following endpoints

Description Endpoint Method Request Body Response Body
Get orders made by customer api/orders?customerId={customer Id} GET Order Array
Get order by order ID api/orders/{id} GET Order Object
Get customer's shopping cart api/orders?customerId={customerId}&cart=true GET Order Object w/ Product Array
Add a product to shopping cart api/orders POST CustomerProduct Object Order Object
Purchase order in cart** api/orders/{id} PUT Order Object**
Remove product from cart api/orders/{orderId}/products{productId} DELETE

* Order objects that have a payment method that isn't NULL are considered complete and processed. An order that does not have a payment type would be considered a user's shopping cart. A user can have only one shopping cart, and therefore will only have a maximum of one Order record in the database with a NULL payment type at a given time.

** To purchase an order, update the Order object's userPaymentId property

JSON Order Object

{
    "id": 1575559407665,
    "customerId": 1575559407787,
    "userPaymentId": null
}

JSON CustomerProduct Object

{
    "customerId": 1575559407787,
    "productId": 1575501970208
}
@AdamSheaffer AdamSheaffer added the enhancement New feature or request label Apr 1, 2020
@Coffey-May Coffey-May self-assigned this Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants