Documentation Home
This version of the framework is no longer supported. View the latest documentation.

REST Endpoints

Request/Response Formats

All of the endpoints below have the ability to produce and consume both XML and JSON. To ensure that you are receiving JSON in a response, ensure that this request HTTP header is set:

Accept: application/json

To tell the endpoint that you are sending it JSON (like in a PUT or POST), use this HTTP header:

Content-Type: application/json

And of course, to ensure that all requests/responses are in JSON, use both of those headers combined:

Accept: applciation/json
Content-Type: application/json

Functionality

The following provides a list of current RESTful endpoints provided with Broadleaf Commerce:

Catalog

URIDescriptionMethodQuery Parameters
/catalog/product/{id} Returns a representation of a Broadleaf product by its ID GET None
/catalog/products Returns a representation of a paginated list of products GET
  • name
  • limit (default 20)
  • offset (default 0)
/catalog/product/{id}/skus Returns a list of skus for a particular product GET None
/catalog/categories Returns a representation of a paginated list of product categories GET
  • name
  • limit (default 20)
  • offset (default 0)
/catalog/category/{id}/categories Returns a list of subcategories for a particular product category GET
  • active (default true)
  • limit (default 20)
  • offset (default 0)
/catalog/category/{id}/activeSubcategories Returns a list of active subcategories for a particular product category GET
  • limit (default 20)
  • offset (default 0)
/catalog/category/{id} Returns a representation of a product category, keyed by ID. Parameters allow one to control how much additional, nested data is returned. GET
  • productLimit (default 20)
  • productOffset (default 0)
  • subcategoryOffset (default 0)
  • subcategoryDepth (default 1)
/catalog/category/{id}/proucts Returns a list of products for a particular category GET
  • limit (default 20)
  • offset (default 0)
  • activeOnly (default true)
/catalog/product/{id}/related-products/upsale Returns a list of related upsale products for a particular catalog product GET
  • limit (default 20)
  • offset (default 0)
/catalog/product/{id}/related-products/crosssale Returns a list of related cross sell products for a particular catalog product GET
  • limit (default 20)
  • offset (default 0)
/catalog/product/{id}/product-attributes Returns a list of product attributes for a particular catalog product GET None
/catalog/sku/{id}/sku-attributes Returns a list of sku attributes for a particular catalog sku GET None
/catalog/sku/{id} Returns a representation of a particular catalog sku GET None
/catalog/sku/{id}/media Returns a list of media items for a particular catalog sku GET None
/catalog/product/{id}/media Returns a list of media items for a particular catalog product GET None
/catalog/category/{id}/media Returns a list of media items for a particular product category GET None
/catalog/product/{id}/categories Returns a list of categories for a particular product GET None

Order

NOTE: The customer ID must be passed on each request. It can be passed on a query parameter or a request header. But it must be keyed as "customerId"**

URIDescriptionMethodQuery Parameters
/cart Returns a representation of the customer's shopping cart. GET None
/cart Creates a new cart for the customer. If the customer ID is unknown because a customer record does not yet exist, it need not be passed in. A new customer will be created. The new cart along with the customer will be returned. POST None
/cart/{categoryId}/{productId}/{skuId} Adds the sku and its associated category and product references to the shopping cart. Optionally reprices the order. Returns a representation of the cart. POST
  • quantity (default 1)
  • priceOrder (default true)
/cart/items/{itemId} Deletes the item from the cart and optionally reprices the order DELETE
  • priceOrder (default true)
/cart/items/{itemId} Updates the quantity of an item and optionally reprices the cart PUT
  • priceOrder (default true)
/cart/offer Adds a promotional code to an order POST
  • promoCode
  • priceOrder (default true)
/cart/offer Deletes a promotional code from an order DELETE
  • promoCode
  • priceOrder (default true)
/cart/offers Deletes all promotional codes from an order and optionally reprices DELETE
  • priceOrder (default true)
/cart/fulfillment/groups Returns a list of fulfillment groups for a particular order GET None
/cart/fulfillment/groups Deletes all fulfillment groups from an order DELETE
  • priceOrder (default true)
/cart/fulfillment/group Adds a new fulfillment group to the order. Accepts a fulfillment group representation in JSON or XML format. POST
  • priceOrder (default true)
/cart/fulfillment/group/{fulfillmentGroupId} Updates the fulfillment group identified by the ID in the URI. Accepts a fulfillment group representation in JSON or XML format. PUT
  • priceOrder (default true)
/orders Returns a list of orders. The order history is for the customer who's ID is passed in. GET
  • orderStatus (default SUBMITTED)

Checkout

URIDescriptionMethodQuery Parameters
/cart/checkout Accepts a list of PaymentMapWrapper representations in JSON or XML format. Returns a completed order. POST None
/cart/checkout/payment/response This should only be called for modules that need to engage the workflow directly without doing a complete checkout. For example, when using PayPal for doing an authorize and retrieving the redirect: url to PayPal. This takes in a single PaymentReferenceMap representation. Returns a PaymentResponseItem representation. POST None