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

Sr No.API EndpointDescriptionTasksStatusPhase
1GET POST /getGuestTokenguest-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.
Planning
com/apache/ofbiz-plugins/pull/45In Code ReviewI
2GET /customers/{customerPartyId}
/password-hint
To get the
password hint.PlanningI3POST /customers/reset-passwordTo get the reset password link on the registered email.PlanningI4POST /customers/{customerPartyId}/change-passwordTo change the password.PlanningI5GET /customers/{customerPartyId}To get the full data of the customer profile.PlanningI
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.
PlanningI7POST /customers/{customerPartyId}/addressesTo create the postal address.PlanningI8PUT /customers/{customerPartyId}/addresses/{contactMechId}To update the postal address and to mark the default address.PlanningI
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.PlanningI10
POST /customers/{customerPartyId}/
phones
change-passwordTo
create a telecom number.PlanningI11PUT /customers/{customerPartyId}/phones/{contactMechId}To update a telecom number.PlanningI
change the password.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
6GET
12DELETE /customers/{customerPartyId}/phones/{contactMechId}To delete a telecom numberPlanningI13POST
/customers/{customerPartyId}/
emailsTo create an email address.PlanningI14PUT /customers/{customerPartyId}/emails/{contactMechId}To update an email address.PlanningI15DELETE /customers/{customerPartyId}/emails/{contactMechId}To remove an email address.PlanningI16
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
PlanningI17PUT /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.PlanningI18DELETE
/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
PlanningI19POST /customers/{customerPartyId}/sendEmailTo send the mail from the profile page to the added email address.PlanningI20POST /customers/{customerPartyId}/credit-cardsTo create a credit card.PlanningI21PUT
/customers/{customerPartyId}/
credit
shipping-
cards
addresses/{
paymentMethodId
contactMechId}To
update the credit card detail and to mark it as default.PlanningI
delete/expire the shipping address.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
10
22DELETE /customers/{customerPartyId}/credit-cards/{paymentMethodId}To remove a credit card.PlanningI23
POST /customers/{customerPartyId}/
gift
payment-
cards
methodsTo
create a gift card.PlanningI24PUT /customers/{customerPartyId}/gift-cards/{paymentMethodId}To update the gift card detail and to mark it as default.PlanningI
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.PlanningI26POST /customers/{customerPartyId}/eft-accountsTo create an EFT account.PlanningI27
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.PlanningI
payment method detail.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
13DELETE
28DELETE /customers/{customerPartyId}/eft-accounts/{paymentMethodId}To remove the EFT account.PlanningI29POST
/customers/{customerPartyId}/
shipment
payment-methods/{
shipmentMethodId
paymentMethodId}To
mark the default shipping method if there is a default shipping address.PlanningI30POST /customers/{customerPartyId}/contact-list/{contactListId}/subscriptionTo subscribe to the contact list.PlanningI31PUT /customers/{customerPartyId}/contact-list/{contactListId/subscriptionTo unsubscribe the contact list.PlanningI32
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.
PlanningI33GET /customers/{customerPartyId}/orders/{orderId}To fetch the order detail.PlanningI34PUT /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.PlanningI35GET /customers/{customerPartyId}/orders/{orderId}/order-pdfTo get the order pdf.PlanningI36GET /customers/{customerPartyId}/orders/{orderId}/invoice-pdfTo get the invoice pdf.PlanningI37POST /customers/{customerPartyId}/returnsTo create a return.PlanningI

In ProgressI


Catalog

Sr No.API EndpointDescriptionTasksStatusPhase
1GET /
catalogs
categoriesTo get the
list of catalogs.PlanningI2GET /catalogs/{catalogId}To get the feature categories, feature products,
category hierarchy
in a single call
.
PlanningI
3GET /catalogs/{catalogId}/feature-categoriesTo get the feature categories of a catalog.PlanningI
2GET /categories/{categoryId}This will fetch all the products of a category
4GET  /catalogs/{catalogId}/feature-productsTo get the feature products of a catalog.PlanningI5GET /catalogs/{catalogId}/category-hierarchyTo get the category hierarchy of a catalog
.
PlanningI
6
3GET /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.
PlanningI
7
4GET /products/{productId}To get the product detail.
PlanningI
8
5POST /products/{productId}/reviewsTo add a review of a product.
PlanningI
9GET /products/{productId}/reviewsTo get the reviews of a product.PlanningI10GET /products/{productId}/associated-productsTo get the list of cross-sell/upsell products.PlanningI11POST /products/{productId}/product-tagsTo add a tag for a product.PlanningI12GET /products/{productId}/product-tagsTo get all the tags of a product.PlanningI13GET /products/product-tagsAll the product tags for the tag cloud.PlanningI14
6GET /offersTo list the special offers
PlanningI15GET /offers/{promotionId}To get the complete detail of a particular offerPlanningI16POST /sendMailFor Tell a Friend functionalityPlanningI17POST /products/compare-listTo create a compare list and to add a product to it
.
PlanningI
18GET /products/compare-listTo get the list of added products with detail for the comparison view.PlanningI19DELETE /products/compare-list/{productId}To remove a product from the compare list.PlanningI

...


Wishlist

shopping-listsAdd an item to the shopping listshopping-listsshoppingListId}/itemsRemove the particular item from the shopping list
Sr No.API EndpointDescriptionTasksStatusPhase
1POST /To create a new shopping list.PlanningI2GET /shopping-listsTo get the list of shopping lists.PlanningI3GET /shopping-lists/{shoppingListId}To get the detail of a shopping list. This will also bring the list of available interval/frequency data for setting the recurrence detail using the update shopping list API.PlanningI4PUT /shopping-lists/{shoppingListId}To update the shopping list detail. Recurrence info can also be set from this API.PlanningI5POST /shopping-lists/{shoppingListId}/itemscustomers/{customerPartyId}/wishlistTo Create a wishlist.
Planning
1PUT /customers/{customerPartyId}/wishlist/{wishlistId}To add a product to the wishlist.
PlanningI
62GET DELETE /customers/{Get the list of items on a shopping list.PlanningI7PUT /shopping-lists/{shoppingListId}/items/{itemId}Update the particular item on the shopping list.PlanningI8DELETE /shopping-lists/{shoppingListId}/items/{itemId}customerPartyId}/wishlist/{wishlistId}/{productId}To remove a product from the wishlist.
PlanningI
3GET /customers/{customerPartyId}/wishlist/{wishlistId9POST /quote-requestsQuotes Request can be created from the shopping list and from the cart.  This API will create a quote request.PlanningI10GET /quote-requestsTo get the list of quote requests(request history).PlanningI11GET /quote-requests/{requestId}To get the detail of a quote request.PlanningI12GET /quotesTo get the list of quotes.PlanningI13GET /quotes/{quoteId}To get the detail of a quotewishlist.
PlanningI14POST /order-quotesTo create an order from the quote.PlanningI

...


Checkout

carts
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.
PlanningI2GET /carts/{cartReference}3DELETE /carts/{cartReference}4POST /carts/{cartReference}/itemsFor adding products and other order adjustments like shipping charges, tax, etc.5GET /carts/{cartReference}/items6PUT /carts/{cartReference}/items/{itemId}7DELETE /carts/{cartReference}/items/{itemId}8POST /carts/{cartReference}/promotionsTo apply the promo code on the cart.9DELETE /carts/{cartReference}/promotions/{itemId}To remove an applied promotion.10POST /carts/{cartReference}/items/shopping-list/{shoppingListId}This will add all the items of a given shopping list to the cart.11POST /carts/{cartReference}/items/order/{orderId}This will add all the items of a given past order to the cart.12POST /carts/{cartReference}/ship-groupsTo create a new ship group in case of split shipment.13GET /carts/{cartReference}/ship-groupsTo get the ship groups with items.14POST /carts/{cartReference}/ship-groups/{shipGroupSeqId}/shipping-address/{contactMechId}To add the shipping address.15POST /carts/{cartReference}/ship-groups/{shipGroupSeqId}/itemsTo move items from one ship group to another in case of split shipment.16POST /carts/{cartReference}/ship-groups/{shipGroupSeqId}/shipping-instructionsTo add special instructions, gift message in case of a gift, split preferences(ship all items together or ship items when available)17PUT /carts/{cartReference}/ship-groups/{shipGroupSeqId}/shipping-instructionsTo update special instructions, gift message in case of a gift, split preferences(ship all items together or ship items when available)18GET /shipping-methods}To get the shipping methods.19POST /carts/{cartReference}/ship-groups/{shipGroupSeqId}/shipping-methodTo add/update the shipping method.20GET /payment-optionsTo get the list of supported payment options.21POST /carts/{cartReference}/payment-methodsTo add a payment method. The combination of the gift card and other payment methods are supported as of now.22POST /checkoutTo place the order.