# Mirakl Connector SFCC APIs {% partial file="/partial-content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi-description.md" /%} ## Servers Commerce Cloud API server ``` https://{shortCode}.api.commercecloud.salesforce.com/checkout/shopper-baskets/v1/organizations/{organizationId} ``` Variables: - `organizationId`: An identifier for the organization the request is being made by. Default: "myorganizationid" - `shortCode`: Region-specific merchant identifier. Default: "myshortcode" Commerce Cloud API server ``` https://{shortCode}.api.commercecloud.salesforce.com/customer/shopper-customers/v1/organizations/{organizationId} ``` Variables: - `organizationId`: An identifier for the organization the request is being made by. Default: "myorganizationid" - `shortCode`: Region-specific merchant identifier. Default: "myshortcode" Commerce Cloud API server ``` https://{shortCode}.api.commercecloud.salesforce.com/checkout/shopper-orders/v1/organizations/{organizationId} ``` Variables: - `organizationId`: An identifier for the organization the request is being made by. Default: "myorganizationid" - `shortCode`: Region-specific merchant identifier. Default: "myshortcode" Commerce Cloud API server ``` https://{shortCode}.api.commercecloud.salesforce.com/product/shopper-products/v1/organizations/{organizationId} ``` Variables: - `organizationId`: An identifier for the organization the request is being made by. Default: "myorganizationid" - `shortCode`: Region-specific merchant identifier. Default: "myshortcode" Commerce Cloud API server ``` https://{shortCode}.api.commercecloud.salesforce.com/search/shopper-search/v1/organizations/{organizationId} ``` Variables: - `organizationId`: An identifier for the organization the request is being made by. Default: "myorganizationid" - `shortCode`: Region-specific merchant identifier. Default: "myshortcode" Commerce Cloud API server ``` https://{shortCode}.api.commercecloud.salesforce.com/custom/marketplace/v1/organizations/{organizationId} ``` Variables: - `organizationId`: Your organization's ID in Commerce Cloud. Default: "myorganizationid" - `shortCode`: Your organization's shortcode in Commerce Cloud. Default: "mydefaultshortcode" ## Security ### ShopperToken Type: oauth2 ## Download OpenAPI description [Mirakl Connector SFCC APIs](https://developer.mirakl.com/_spec/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3.yaml) ## Shopper Baskets ### addItemToBasket - Adds new items to a basket. - [POST /baskets/{basketId}/items](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/shopper-baskets/additemtobasket.md): Adds new items to a basket. The added items are associated with the specified shipment. If no shipment id is specified, the added items are associated with the default shipment. Considered values from the request body, for each item are: - productId: a valid product ID. This is the ID of the product to be added to the basket. If the product is already in the basket, the API either increments the quantity of the existing product line item or creates a new product line item, based on the site preference 'Add Product Behavior'. For option products and product bundles containing variation masters, the API creates a new product line item regardless of the site preference. - shipmentId: a valid shipment ID (optional). This is the ID of the shipment in which the product item is created. - quantity: a number between 0.01 and 999. This is the quantity of the product to order. - inventoryId: a valid inventory ID (optional). This is the ID of the inventory from which the item is allocated. - bonusDiscountLineItemId: a valid bonus discount line item ID (optional). This is the ID of the bonus discount line item for which the added product is a selected bonus product. - optionItems/optionValueId: a valid option value ID. This is an option value for an option item of an option product. This is only possible if the product item is an option product. To set option values, you must specify a collection of option items in the optionItems property. These option items must contain optionId and optionValueId. Also, the values you specify must be valid for the option product that this product item represents. Otherwise, the server throws an InvalidProductOptionItemException or an InvalidProductOptionValueItemException. - custom properties in the form c_: the custom property must correspond to a custom attribute () defined for ProductLineItem. The value of this property must be valid for the type of custom attribute defined for ProductLineItem. ### getBasket - Gets a basket. - [GET /basket/{basketId}](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/shopper-baskets/getbasket.md): Gets a basket. ### removeItemFromBasket - Removes a product item from the basket. - [DELETE /baskets/{basketId}/items/{itemId}](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/shopper-baskets/removeitemfrombasket.md): Removes a product item from the basket. ### updateItemInBasket - Updates an item in a basket. - [PATCH /baskets/{basketId}/items/{itemId}](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/shopper-baskets/updateiteminbasket.md): Updates an item in a basket. The item to be updated can be a bundled product item, although the kind of update supported for bundled product items is limited to productId (to support variation products), gift, giftMessage and custom properties. The following values in the request body are considered by the server: - productId: a valid product ID. The purpose of this value is to exchange a variation of a variation product. - shipmentId: a valid shipment ID. The purpose of this value is to move a product item to another shipment. - quantity: a number between 0 and 999. The purpose of this value is to change quantity of the product item. If quantity is 0, the product item is removed. - optionItems/optionValueId: a valid option value ID. The purpose of this value is to exchange an option value for an option item of an option product. This is only possible if the product item is an option product. To change option values a collection of option items to be changed need to be provided in property optionItems. Those optionItems need to contain optionId and optionValueId. The provided values must be valid for the option product that this product item represents. Otherwise, InvalidProductOptionItemException or InvalidProductOptionValueItemException is thrown. - custom properties c_: a value corresponding to the type defined for custom attribute of ProductLineItem. The purpose of this value is to add or change the value of a custom attribute defined for ProductLineItem. - gift: a boolean value that specifies whether the item is a gift - giftMessage: a message for the gift ### updateBasket - Updates a basket. - [PATCH /baskets/{basketId}](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/shopper-baskets/updatebasket.md): Updates a basket. Only the currency of the basket, source code, the custom properties of the basket, and the shipping items will be considered. ## Checkout ### getBasketShippingMethods - Get the allowed shipping methods for a basket. - [GET /baskets/shipping-methods](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/checkout/getbasketshippingmethods.md): Get the allowed shipping methods for the current basket by making a call to the SH02 API. ### getShippingMethodsForShipment - Gets the applicable shipping methods for a certain shipment of a basket. - [GET /baskets/{basketId}/shipments/{shipmentId}/shipping-methods](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/checkout/getshippingmethodsforshipment.md): Gets the applicable shipping methods for a certain shipment of a basket. ### updateBillingAddressForBasket - Sets the billing address of a basket. - [PUT /baskets/{basketId}/billing-address](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/checkout/updatebillingaddressforbasket.md): Sets the billing address of a basket. ### updateShippingMethodForShipment - Sets a shipping method for a specific shipment of a basket. - [PUT /baskets/{basketId}/shipments/{shipmentId}/shipping-method](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/checkout/updateshippingmethodforshipment.md): Sets a shipping method for a specific shipment of a basket. ## Shopper Customers ### getCustomerBaskets - Gets the baskets of a customer. - [GET /customers/{customerId}/baskets](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/shopper-customers/getcustomerbaskets.md): Gets the baskets of a customer. This endpoint accepts a registered customer ShopperToken (JWT) or a guest customer ShopperToken. ## Shopper Orders ### getDocumentDownloadURL - Download one document and returns the url to download it. - [GET /document/{documentId}/type/{documentType}](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/shopper-orders/getdocumentdownloadurl.md): Download one document and returns the URL to download it. If the document ID doesn't exist, the API will return an error. ### getOrder - Returns the details of the order with the specified order number. - [GET /orders/{orderNo}](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/shopper-orders/getorder.md): Returns the details of the order with the specified order number. ### getOrderShipments - Get the prepared and to prepare shipments for an order. - [GET /orders/{orderId}/shipments](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/shopper-orders/getordershipments.md): Get the prepared and to prepare shipments for an order. ## Products and Offers ### getProduct - Allows access to product details for a single product ID. - [GET /products/{id}](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/products-and-offers/getproduct.md): Allows access to product details for a single product ID. Only products that are online and assigned to a site catalog are returned. Along with product details, the availability, images, price, bundled_products, set_products, recommedations, product options, variations, and promotions for the products will be included, as appropriate. ### getShippingMethods - Get the shipping methods for an offer and address. - [GET /shipping-methods](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/products-and-offers/getshippingmethods.md): Get the shipping methods for an offer and address. ### productSearch - Searches for products. - [GET /product-search](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/products-and-offers/productsearch.md): Searches for products. The query attribute specifies a complex query that can be used to narrow down the search. Attributes are grouped into different buckets. ## Shop ### getShop - Get the shop information. - [GET /shop](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/shop/getshop.md): Get the shop information. ### getShopEvaluations - Get the evaluations for a shop. - [GET /shop/evaluations](https://developer.mirakl.com/content/connector/operator/salesforce/connector-sfcc-plugin/rest/connector-public/openapi3/shop/getshopevaluations.md): Get the evaluations for a shop.