Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Purpose

The purpose of this document is to list the high-level API endpoints required for headless commerce(B2C). This will helps in finalizing API design.

API Endpoints

Authentication

GET /getGuestToken
Sr No.API EndpointDescriptionTasksStatusPhase
1POST /guest-tokenThis API will return a token for a guest account.
PlanningI
2POST /getCustomerTokencustomer-tokenThis API will return a token for the registered user.
PlanningI
3POST /refreshTokenrefresh-tokenIn case we need to update the token. As JWT token ideally contains a certain expiry time. So if the user is active then instead of getting him to log out, this API can generate a new token from the existing token.
PlanningI


Customer

Sr No.API EndpointDescriptionTasks/PRsStatusPhase
1POST /customersTo register the customer.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
2GET /customers/{customerPartyId}
/password-hint
To get the
password hint.3POST /customers/reset-passwordTo get the reset password link on the registered email.4POST /customers/{customerPartyId}/change-passwordTo change the password.5GET /customers/{customerPartyId}To get the full data of the customer profile.
customer's personal information, addresses, emails, phones, etc.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
3
6
PUT /customers/{customerPartyId}To update the customer's personal information.
7POST /customers/{customerPartyId}/addressesTo create the postal address.8PUT /customers/{customerPartyId}/addresses/{contactMechId}To update the postal address and to mark the default address.
https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
4POST /customers/reset-passwordTo get the reset password link on the registered email.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
5
9DELETE /customers/{customerPartyId}/addresses/{contactMechId}To delete/expire the postal address.10
POST /customers/{customerPartyId}/
phones
change-passwordTo
create a telecom numberPUT
change the password.
11
https:/
customers/{customerPartyId}/phones/{contactMechId}To update a telecom number.12DELETE /customers/{customerPartyId}/phones/{contactMechId}To delete a telecom number13
/github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
6GET
POST
/customers/{customerPartyId}/
emailsTo create an email address.14PUT /customers/{customerPartyId}/emails/{contactMechId}To update an email address.15DELETE /customers/{customerPartyId}/emails/{contactMechId}To remove an email address.16
shipping-addressesTo get the customer's shipping addresseshttps://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
7POST /customers/{customerPartyId}/
contact
shipping-
information
addressesTo
add the other contact information like electronic address, Internet IP address, Internet Domain Name, Web Url, LDAP address, File server, etc. 
create the shipping address.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
8PUT
17PUT /customers/{customerPartyId}/contact-information/{contactMechId}To update the other contact information like electronic address, Internet IP address, Internet Domain Name, Web Url, LDAP address, File server, etc.18DELETE
/customers/{customerPartyId}/
contact
shipping-
information
addresses/{contactMechId}To
remove the other contact information like electronic address, Internet IP address, Internet Domain Name, Web Url, LDAP address, File server, etc.
update the shipping address.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
9DELETE
19POST /customers/{customerPartyId}/sendEmailTo send the mail from the profile page to the added email address.20POST /customers/{customerPartyId}/credit-cardsTo create a credit card.21PUT
/customers/{customerPartyId}/
credit
shipping-
cards
addresses/{
paymentMethodId
contactMechId}To
update the credit card detail and to mark it as default.22DELETE /customers/{customerPartyId}/credit-cards/{paymentMethodId}To remove a credit card.23
delete/expire the shipping address.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
10POST /customers/{customerPartyId}/
gift
payment-
cards
methodsTo
create a gift card.24PUT /customers/{customerPartyId}/gift-cards/{paymentMethodId}To update the gift card detail and to mark it as default.
save a payment method e.g. credit card, gift card, eft accounthttps://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
11GET
25DELETE
/customers/{customerPartyId}/
gift-cards/{paymentMethodId}
payment-methodsTo
remove the gift card.26POST /customers/{customerPartyId}/eft-accountsTo create an EFT account.27
get the user's payment methods eg. saved credit cards, gift cards, eft accountshttps://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
12PUT /customers/{customerPartyId}/
eft
payment-
accounts
methods/{paymentMethodId}To update the
EFT account detail and to mark it as default.28DELETE /customers/{customerPartyId}/eft-accounts/{paymentMethodId}To remove the EFT account.29
payment method detail.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
13DELETE
POST
/customers/{customerPartyId}/
shipment
payment-methods/{
shipmentMethodId
paymentMethodId}To
mark the default shipping method if there is a default shipping address.30POST /customers/{customerPartyId}/contact-list/{contactListId}/subscriptionTo subscribe to the contact list.31PUT /customers/{customerPartyId}/contact-list/{contactListId/subscriptionTo unsubscribe the contact list.32
remove a saved credit card, gift card, eft account.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
14GET /customers/{customerPartyId}/
orders
order-historyTo fetch all the orders of a customer.
33GET /customers/{customerPartyId}/orders/{orderId}To fetch the order detail.34PUT /customers/{customerPartyId}/orders/{orderId}To update the order. Right now the support to cancel an item(partially or fully) is there. That should be handled in this API.35GET /customers/{customerPartyId}/orders/{orderId}/order-pdfTo get the order pdf.36GET /customers/{customerPartyId}/orders/{orderId}/invoice-pdfTo get the invoice pdf.37POST /customers/{customerPartyId}/returnsTo create a return.

In ProgressI


Catalog

Sr No.API EndpointDescriptionTasksStatusPhase
1GET /
catalogs
categoriesTo get the category hierarchy.
PlanningI
2
GET 
GET /
catalogs
categories/{
catalogId
categoryId}
/feature-categories
This will fetch all the products of a category.
PlanningI
3
3GET  /catalogs/{catalogId}/feature-products4GET /catalogs/{catalogId}/category-hierarchy5
GET /productsThis API will have support for the search string and other additional filters. This API will also bring the products of a selected category if provided.
6GET /products/{productId}

PlanningI
4GET
7POST
/products/{productId}
/reviews8GET /products/{productId}/reviews9GET /products/{productId}/associated-products10
To get the product detail.
PlanningI
5POST /products/{productId}/
product-tags11GET /products/{productId}/product-tags12GET /products/product-tagsAll the product tags for the tag cloud.13
reviewsTo add a review of a product.
PlanningI
6GET /offersTo list the special offers.
PlanningI


Wishlist

DELETE /products/compare-list compare list
Sr No.API EndpointDescriptionTasksStatusPhase
1POST /customers/{customerPartyId}/wishlistTo Create a wishlist.
Planning
1PUT /customers/{customerPartyId}/wishlist/{wishlistId}To add a product to the wishlist.
PlanningI
2DELETE /customers/{customerPartyId}/wishlist/{wishlistId}14GET /offers/{promotionId}To get the complete detail of a particular offer15POST /sendMailFor Tell a Friend functionality16POST /products/compare-listTo create a compare list and to add a product to it.17GET /products/compare-listTo get the list of added products with detail for the comparison view.18/{productId}To remove a product from the wishlist.

Shopping List and Quotes

PUT /shopping-listsshoppingListId}

PlanningI
Sr No.API EndpointDescriptionTasksStatusPhase
1POST /shopping-lists2GET /shopping-lists3GET /shopping-listscustomers/{shoppingListIdcustomerPartyId}4/wishlist/{5POST /shopping-lists/{shoppingListId}/items6GET /shopping-lists/{shoppingListId}/items7PUT /shopping-lists/{shoppingListId}/items/{itemId}8DELETE /shopping-lists/{shoppingListId}/items/{itemId}9POST /quote-requestsQuotes Request can be created from the shopping list and from the cart10GET /quote-requests11GET /quote-requests/{requestId}12GET /quotes13GET /quotes/{quoteId}14POST /orders/quotes/{quoteId}To create an order from the quote.

Shopping Cart & Checkout

wishlistId}To get the wishlist.
PlanningI


Checkout

Phase
Sr No.API EndpointDescriptionTasksStatusPhase
1POST /ordersTo Create an order with all the necessary detail (items, shipping address, payment information, etc.)
PlanningI
2PATCH /orders/{orderId}/statuses/CANCELTo cancel an order.
PlanningI
3PATCH /orders/{orderId}/items/statuses/CANCELTo Cancel order items.
PlanningISr No.API EndpointDescriptionTasksStatus