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.
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
8PUT
9DELETE
/customers/{customerPartyId}/shipping-addresses/{contactMechId}To
delete/expire
update the
postal POST
shipping address.
10
https:/
customers/{customerPartyId}/phonesTo create a telecom number.11PUT /customers/{customerPartyId}/phones/{contactMechId}
/github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
9
To update a telecom number.12
DELETE /customers/{customerPartyId}/
phones
shipping-addresses/{contactMechId}To delete
a telecom number13POST /customers/{customerPartyId}/emailsTo create an email PUT
/expire the shipping address.
14
https:/
customers/{customerPartyId}/emails/{contactMechId}To update an email address.15DELETE /customers/{customerPartyId}/emails/{contactMechId}To remove an email address.16
/github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
10POST /customers/{customerPartyId}/
contact
payment-
informationTo add the other contact information like electronic address, Internet IP address, Internet Domain Name, Web Url, LDAP address, File server, etc. 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.
methodsTo save a payment method e.g. credit card, gift card, eft accounthttps://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
11GET
18DELETE
/customers/{customerPartyId}/
contact-information/{contactMechId}
payment-methodsTo
remove the other contact information like electronic address, Internet IP address, Internet Domain Name, Web Url, LDAP address, File server, etc.
get the user's payment methods eg. saved credit cards, gift cards, eft accountshttps://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
12
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.21
PUT /customers/{customerPartyId}/
credit
payment-
cards
methods/{paymentMethodId}To update the
credit card detail and to mark it as default.22
payment method detail.https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
13DELETE /customers/{customerPartyId}/
credit
payment-
cards
methods/{paymentMethodId}To remove a saved credit card, gift card, eft account.
23POST /customers/{customerPartyId}/gift-cardsTo create a gift card.24
https://github.com/apache/ofbiz-plugins/pull/45In Code ReviewI
14GET
PUT
/customers/{customerPartyId}/
gift-cards/{paymentMethodId}
order-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

update the gift card detail and to mark it as default.ordersorderId fetch the order detail.PUT orders/{orderId}
Sr No.API EndpointDescriptionTasksStatusPhase
1POST 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.29POST /customers/{customerPartyId}/shipment-methods/{shipmentMethodId}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.32GET /customers/{customerPartyId}/orderswishlistTo fetch all the orders of a customerCreate a wishlist.
Planning
133GET PUT /customers/{customerPartyId}/wishlist/{wishlistId}To add a product to the wishlist.
PlanningI
2DELETE 34 /customers/{customerPartyId}/To update the order. Right now the support to cancel an item(partially or fully) is there. That should be handled in this API.wishlist/{wishlistId}/{productId}To remove a product from the wishlist.
PlanningI
335GET /customers/{customerPartyId}/orders/{orderId}/order-pdfTo get the order pdf.36GET /customers/{customerPartyId}/orderswishlist/{orderIdwishlistId}/invoice-pdfTo get the invoice pdfwishlist.37POST /customers/{customerPartyId}/returnsTo create a return.

Catalog


PlanningI


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