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-hintTo get the password hint.
To get the customer's personal information, addresses, emails, phones, etc.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
3PUT /customers/{customerPartyId}To update the customer's personal information.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
4
3
POST /customers/reset-passwordTo get the reset password link on the registered email.
4
https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
5POST /customers/{customerPartyId}/change-passwordTo change the password.
5GET /customers/{customerPartyId}To get the full data of the customer profile.
https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
6GET
6PUT
/customers/{customerPartyId}/shipping-addressesTo
update
get the customer's
personal information.
shipping addresseshttps://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
7POST /customers/{customerPartyId}/shipping-addressesTo create the
postal
shipping address.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
8PUT /customers/{customerPartyId}/shipping-addresses/{contactMechId}To update the
postal address and to mark the default address.
shipping address.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
9DELETE /customers/{customerPartyId}/shipping-addresses/{contactMechId}To delete/expire the
postal POST
shipping address.
10
https:/
customers/{customerPartyId}/phonesTo create a telecom number.11PUT /customers/{customerPartyId}/phones/{contactMechId}To update a telecom number.12
/github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
10POST
DELETE
/customers/{customerPartyId}/
phones/{contactMechId}
payment-methodsTo
delete a telecom number13POST /customers/{customerPartyId}/emailsTo create an email address.14PUT /customers/{customerPartyId}/emails/{contactMechId}To update an email address.15
save a payment method e.g. credit card, gift card, eft accounthttps://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
11GET
DELETE
/customers/{customerPartyId}/
emails/{contactMechId}To remove an email address.16POST /customers/{customerPartyId}/contact-informationTo add the other contact information like electronic address, Internet IP address, Internet Domain Name, Web Url, LDAP address, File server etc. 
payment-methodsTo get the user's payment methods eg. saved credit cards, gift cards, eft accountshttps://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
12
17
PUT /customers/{customerPartyId}/
contact
payment-
information
methods/{
contactMechId
paymentMethodId}To update the
other contact information like electronic address, Internet IP address, Internet Domain Name, Web Url, LDAP address, File server etc.
payment method detail.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
13
18
DELETE /customers/{customerPartyId}/
contact
payment-
information
methods/{
contactMechId
paymentMethodId}To remove
the other contact information like electronic address, Internet IP address, Internet Domain Name, Web Url, LDAP address, File server etc.
a saved credit card, gift card, eft account.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
14GET
19POST /customers/{customerPartyId}/sendEmailTo send the mail from the profile page to the added email address.20POST
/customers/{customerPartyId}/
credit
order-
cards
historyTo fetch all the orders of a customer.
In ProgressI


Catalog

Sr No.API EndpointDescriptionTasksStatusPhase
1GET /categoriesTo get the category hierarchy.
PlanningI
2GET /categories/{categoryId}This will fetch all the products of a category.
PlanningI
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
4GET /products/{productId}To get the product detail.
PlanningI
5POST /products/{productId}/reviewsTo add a review of a product.
PlanningI
6GET /offersTo list the special offers.
PlanningI


Wishlist

create a credit card.POST shipment-methodsshipmentMethodId mark the default shipping method if there is a default shipping address.POST contact-listcontactListIdsubscription subscribe to the contact list.
Sr No.API EndpointDescriptionTasksStatusPhase
1POST /customers/{customerPartyId}/wishlistTo Create a wishlist.
Planning
1PUT 21PUT /customers/{customerPartyId}/credit-cards/{paymentMethodId}To update the credit card detail and to mark it as default.22DELETE /customers/{customerPartyId}/credit-cards/{paymentMethodId}To remove a credit card.23POST /customers/{customerPartyId}/gift-cardsTo create a gift card.24PUT /customers/{customerPartyId}/gift-cards/{paymentMethodId}To update the gift card detail and to mark it as default.25DELETE /customers/{customerPartyId}/gift-cards/{paymentMethodId}To remove the gift card.26POST /customers/{customerPartyId}/eft-accountsTo create an EFT account.27PUT /customers/{customerPartyId}/eft-accounts/{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 /customers/{customerPartyId}/wishlist/{wishlistId}To add a product to the wishlist.
PlanningI
2DELETE 30 /customers/{customerPartyId}/wishlist/{wishlistId}/{productId}To remove a product from the wishlist.
PlanningI
3GET 31PUT /customers/{customerPartyId}/contact-listwishlist/{contactListId/subscriptionwishlistId}To unsubscribe get the contact listwishlist.
Planning

...

I


Checkout

Sr No.API EndpointDescriptionTasksStatusPhase
123

Shopping List and Quotes

...

Shopping Cart & Checkout

POST /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.
PlanningI
Sr No.API EndpointDescriptionTasksStatusPhase
123