### GET Customer Product List Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Customers.html Demonstrates a GET request to retrieve a customer's product list. Includes example headers and URL. ```http GET /dw/shop/v23_2/customers/acE9xUWs5ea75qwTh0Svi2XfRY/product_lists/bcedkiWbxCM2MaaadkRhB2IBzM HTTP/1.1 Host: example.com Authorization: Bearer cd669706-3638-4dd1-a8b2-310ab900ca53 Content-Type: application/json ``` -------------------------------- ### GET User Request and Response Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/data/Resources/Users.html Demonstrates a successful GET request to retrieve user details and the corresponding 200 OK response. Includes an example of a 404 Not Found response. ```http GET /s/-/dw/data/v23_2/users/someUser HTTP/1.1 Host: example.com Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367 Content-Type: application/json; charset=UTF-8 # in case of success: RESPONSE: HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Cache-Control: max-age=0,no-cache,no-store,must-revalidate { "_type": "user", "disabled": false, "email": "[email protected]", "external_id": "e2b07841-1db0-a5c1-9a1f-f6a02b6fa25c", "first_name": "John", "last_name": "Doe", "locked": false, "login": "someUser", "password_expiration_date": "2016-01-14T16:48:07Z", "password_modification_date": "2016-04-14T16:48:07Z", "preferred_data_locale": "default", "preferred_ui_locale": "en-US", "roles": ["FirstRole", "SecondRole"] } # in case of failure: RESPONSE: HTTP/1.1 404 Not Found Content-Type: application/json;charset=UTF-8 Cache-Control: max-age=0,no-cache,no-store,must-revalidate { "_v" : "23.2", "fault" : { "type" : "UserNotFoundException", "message" : "No user with login 'someUser' was found." } } ``` -------------------------------- ### Get Product Prices Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Products.html This example demonstrates how to make a GET request to retrieve the prices for a specific product. Ensure the product ID and locale are correctly specified. ```http GET /dw/shop/v23_2/products/apple-ipod-touch/prices HTTP/1.1 Host: example.com Accept: application/json ``` -------------------------------- ### Get Promotion Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/data/Resources/Promotions.html Demonstrates how to make a GET request to retrieve promotion information. Includes sample request headers and URL. ```http GET /s/-/dw/data/v23_2/sites/SiteGenesis/promotions/order-promotion HTTP/1.1 Host: example.com Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367 Content-Type: application/json; charset=UTF-8 ``` -------------------------------- ### GET Request and Response Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/HttpMethods.html Demonstrates a typical GET request to retrieve a Product resource and its corresponding JSON response with a 200 OK status. ```http GET /dw/shop/v23_2/products/123 HTTP/1.1 Host: example.com Accept: application/json ``` ```http HTTP/1.1 200 OK Content-Length: 67 Content-Type: application/json; charset=UTF-8 {"sku":"123","name":"foo","brand":"bar","online":true} ``` -------------------------------- ### GET Site Preferences Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/data/Resources/Sites.html Demonstrates how to make a GET request to retrieve custom site preferences for a specific group and instance type. Includes example headers and URL parameters. ```http GET /s/-/dw/data/v23_2/sites/SiteGenesis/site_preferences/preference_groups/my-preferencegroup/staging?expand=sites HTTP/1.1 Host: example.com Authorization: Bearer aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa ``` -------------------------------- ### Bundled Products GET Request Sample Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Products.html Example of a GET request for bundled products and its corresponding JSON response. ```http REQUEST: GET /dw/shop/v23_2/products/sony-ps3-bundle/bundled_products HTTP/1.1 Host: example.com Accept: application/json RESPONSE: HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 Cache-Control: max-age=900,must-revalidate { "_v" : "23.2", "_type":"product", "brand" : "Sony", "bundled_products" : [ { "product" : { "brand" : "Sony", "id" : "sony-ps3-console", "name" : "Sony Playstation 3 Game Console", "page_description" : "ncludes PLAYSTATION 3 80GB system, DUALSHOCK 3 wireless controller, free PLAYSTATION Network membership, internet ready Wi-Fi, and 80GB of hard disk storage for all your games, music, videos, and photos. Every PS3 comes with a built-in Blu-ray player to give you the best high-definition viewing experience and pristine picture quality. Plus, the PS3 can play your entire catalog of CDs and DVDs.", "page_keywords" : "Sony", "page_title" : "Sony Playstation 3 Game Console", "primary_category_id" : "electronics-game-consoles", ``` -------------------------------- ### Sample Request for Get All Categories Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/data/Resources/Categories.html Example GET request to retrieve categories with specific expansions and selections. ```http GET /s/-/dw/data/v23_2/catalogs/main-catalog/categories?expand=vm&select=(**) HTTP/1.1 Host: example.com Accept: application/json ``` -------------------------------- ### Product Search Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/ProductSearch.html This example demonstrates how to construct a GET request to search for products. It includes parameters for query, category refinement, color refinement, price range, sorting, and the number of results. ```HTTP GET /dw/shop/v23_2/product_search/represented_products?q=shoes&refine_1=cgid=womens&refine_2=c_refinementColor=Black&refine_3=price=(0..500)&sort=top-sellers&count=5 HTTP/1.1 Host: example.com Accept: application/json ``` -------------------------------- ### Product GET Request Sample Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Products.html Example of a GET request for product availability and its corresponding JSON response. ```http REQUEST: GET /dw/shop/v23_2/products/creative-zen-v/availability HTTP/1.1 Host: example.com Accept: application/json RESPONSE: HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 Cache-Control: max-age=60,must-revalidate { "_v" : "23.2", "_type":"product", "brand" : "Creative", "id" : "creative-zen-v", "min_order_quantity" : 1, "name" : "Creative ZEN V Digital Media Player", "orderable" : true, "page_description" : "The ZEN V player was designed for people like you—those who walk a step or two ahead of the pack. So don't be surprised when people take notice of your cool, colorful music and photo player.", "page_keywords" : "Creative", "page_title" : "Creative ZEN V Digital Media Player", "primary_category_id" : "electronics-digital-media-players", "short_description" : "The ZEN V player was designed for people like you—those who walk a step or two ahead of the pack. So don't be surprised when people take notice of your cool, colorful music and photo player.", "step_quantity" : 1, "type" : { "item" : true }, ... "c_mediaFormat" : [ "0010", "0020", "0030", "0040" ], "c_memorySize" : "1GB", "c_tabDescription" : "The ZEN V player was designed for people like you—those who walk a step or two ahead of the pack. So don't be surprised when people take notice of your cool, colorful music and photo player." } ``` -------------------------------- ### Sample Product Link Request Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Products.html Example of a GET request to retrieve product links for a specific product. ```HTTP GET /dw/shop/v23_2/products/namco-we-ski-wii/links HTTP/1.1 Host: example.com Accept: application/json ``` -------------------------------- ### Product Search Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/ProductSearch.html This is an example of a GET request to the product_search endpoint. It includes query parameters for search terms, refinements, sorting, and expansion of product prices. ```http GET /dw/shop/v23_2/product_search?q=shoes&refine_1=cgid=womens&refine_2=c_refinementColor=Black&refine_3=price=(0..500)&sort=top-sellers&count=5&expand=prices HTTP/1.1 Host: example.com Accept: application/json ``` -------------------------------- ### Get Single Promotion Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Promotions.html Example HTTP request to retrieve a specific promotion by its ID. ```http GET /dw/shop/v23_2/promotions/15off-gps HTTP/1.1 Host: example.com Accept: application/json ``` -------------------------------- ### Sample Response for Get All Categories Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/data/Resources/Categories.html Example JSON response for a GET request to retrieve categories, showing category details. ```json HTTPS/1.1 200 OK Content-Type: application/json; charset=UTF-8 Cache-Control: max-age=900,must-revalidate { "_v" : "23.2", "count" : 1, "data" : [ "_v" : "23.2", "_type" : "category", "categories" : [ { "_type" : "category", "creation_date" : "2015-11-30T18:48:37.333Z", "description" : { "default" : "sub-category 1 for main catalog" }, "id" : "sub-category-1", "image" : "https://example.com/on/demandware.static/-/Sites-main-catalog/default/v1447965267239/category%201.1%20image", "link" : "https://example.com/s/-/dw/data/v23_2/catalogs/main-catalog/categories/sub-category-1", "name" : { "default" : "Sub-category 1" }, "online" : true, "parent_category_id" : "root", "paths" : [ { "_type" : "path_record", "id" : "sub-category-1", "name" : { "default" : "Sub-category 1" } } ], "position" : 1.0, "thumbnail" : "https://example.com/on/demandware.static/-/Sites-main-catalog/default/v1447965267239/category%201.1%20thumbnail" } ], "creation_date" : "2015-11-29T18:48:37.333Z", "description" : { "default" : "root category for main catalog" }, "id" : "root", "image" : "https://example.com/on/demandware.static/-/Sites-main-catalog/default/v1447965267239/category%201%20image", "link" : "https://example.com/s/-/dw/data/v23_2/catalogs/main-catalog/categories/root", "name" : { "default" : "Root Category" } ``` -------------------------------- ### Product Search Prices Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/ProductSearch.html This example demonstrates a GET request to the product search prices endpoint with multiple refinements and sorting options. It specifies query parameters for search terms, category, color, price range, sorting, and the number of results. ```http GET /dw/shop/v23_2/product_search/prices?q=shoes&refine_1=cgid=womens&refine_2=c_refinementColor=Black&refine_3=price=(0..500)&sort=top-sellers&count=5 HTTP/1.1 Host: example.com Accept: application/json ``` -------------------------------- ### GET Customer Payment Instruments Request Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Customers.html Example of a GET request to retrieve a customer's payment instruments. ```HTTP GET /dw/shop/v23_2/customers/acE9xUWs5ea75qwTh0Svi2XfRY/payment_instruments HTTP/1.1 Host: example.com Authorization: Bearer cd669706-3638-4dd1-a8b2-310ab900ca53 Content-Type: application/json ``` -------------------------------- ### Get Promotion Response Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/data/Resources/Promotions.html Shows a successful HTTP 200 OK response for a promotion retrieval request. Includes relevant headers. ```http HTTP/1.1 200 OK Expires: Thu, 01-Aug-2014 00:00:00 GMT x-dw-resource-state: 43c2d7a118bd0a4034399ed86c86654b40c198ea64fd3195e5587d9211d10d7e ``` -------------------------------- ### Product Search Images Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/ProductSearch.html Demonstrates a GET request to search for product images with multiple refinement parameters and sorting options. ```http GET /dw/shop/v23_2/product_search/images?q=shoes&refine_1=cgid=womens&refine_2=c_refinementColor=Black&refine_3=price=(0..500)&sort=top-sellers&count=5 HTTP/1.1 Host: example.com Accept: application/json ``` -------------------------------- ### Sample Product Images Request Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Products.html Example of a GET request to retrieve product images for a specific product ID. ```HTTP GET /dw/shop/v23_2/products/creative-zen-v/images HTTP/1.1 Host: example.com Accept: application/json ``` -------------------------------- ### Bundled Products Resource Configuration Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/OCAPISettings.html Example configuration for the /products/*/bundled_products resource, allowing GET requests and specifying read attributes. ```APIDOC ## GET /products/*/bundled_products ### Description Configuration for accessing bundled products associated with a specific product. ### Method GET ### Endpoint /products/*/bundled_products ### Parameters #### Query Parameters None explicitly defined in this snippet. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **read_attributes** (string) - Specifies which properties are included in the response document (e.g., 'c_name', 'c_street'). - **write_attributes** (string) - Specifies which properties can be written. #### Response Example ```json { "_v": "23.2", "clients": [ { "resources": [ { "resource_id": "/products/*/bundled_products", "methods": ["get"], "read_attributes": "(c_name,c_street)", "write_attributes": "(**)" } ] } ] } ``` ``` -------------------------------- ### GET Request for a Customer Product List Item Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Customers.html Example of a GET request to retrieve a specific item from a customer's product list. Includes necessary headers and authorization. ```http GET /dw/shop/v23_2/customers/bdndMnaBvPR2v7xM04bEXaAqho/product_lists/307074e244c06058adfdccd786/items/17f6313d232767ef80da988a13 HTTP/1.1 Host: example.com Authorization: Bearer cd669706-3638-4dd1-a8b2-310ab900ca53 Content-Type: application/json ``` -------------------------------- ### Example Request for Customer Product List Item Purchases Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Customers.html This is an example of a GET request to retrieve purchases for a specific item within a customer's product list. Ensure you replace placeholder IDs with actual values. ```http GET /dw/shop/v23_2/customers/acE9xUWs5ea75qwTh0Svi2XfRY/product_lists/bcedkiWbxCM2MaaadkRhB2IBzM/purchases HTTP/1.1 Host: example.com ``` -------------------------------- ### Get Variations Request Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/data/Resources/Products.html Example GET request to retrieve variations for a master product. Query parameters like `site_id`, `start`, `count`, `select`, and `expand` can be used to filter and shape the response. ```http GET https://hostname:port/dw/data/v23_2/products/{master_product_id}/variations?site_id={String}&start={Integer}&count={Integer}&select={String}&expand={String} ``` -------------------------------- ### Product Search Resource Configuration Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/OCAPISettings.html Example configuration for the /product_search resource, allowing GET requests and specifying read/write attributes. ```APIDOC ## GET /product_search ### Description Configuration for accessing product search functionality. ### Method GET ### Endpoint /product_search ### Parameters #### Query Parameters None explicitly defined in this snippet. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **read_attributes** (string) - Specifies which properties are included in the response document. - **write_attributes** (string) - Specifies which properties can be written. #### Response Example ```json { "_v": "23.2", "clients": [ { "resources": [ { "resource_id": "/product_search", "methods": ["get"], "read_attributes": "(**)", "write_attributes": "(**)", "cache_time": 900 } ] } ] } ``` ``` -------------------------------- ### Get Category Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/data/Resources/Categories.html Example of a GET request to retrieve a specific category and its sub-categories. ```http GET /s/-/dw/data/v23_2/catalogs/main-catalog/categories/root HTTP/1.1 Host: example.com Accept: application/json ``` -------------------------------- ### OPTIONS Request and Response Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/HttpMethods.html Shows an OPTIONS request to list supported HTTP methods for a product endpoint, and the expected response with the 'Allow' header. ```http REQUEST: OPTIONS /dw/shop/v23_2/products HTTP/1.1 Host: http://example.com RESPONSE: HTTP/1.1 204 NO CONTENT Allow: GET, HEAD, POST ``` -------------------------------- ### Sample Request and Response for Product Recommendations Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Products.html This sample demonstrates a GET request for product recommendations and a successful JSON response. The response includes product details and a list of recommended items with their types and links. ```http REQUEST: GET /dw/shop/v23_2/products/apple-ipod-touch/recommendations HTTP/1.1 Host: example.com Accept: application/json ``` ```json RESPONSE: HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 Cache-Control: max-age=900,must-revalidate { "_v" : "23.2", "_type":"product", "brand" : "Apple", "id" : "apple-ipod-touch", "long_description" : "Supports MP3 (up to 320 Kbps), MP3 VBR, AAC (up to 320 Kbps), Protected AAC (iTunes Music Store), Audible (formats 2, 3, 4), AIFF, Apple Lossless and WAV audio formats, plus BMP, JPEG, GIF, TIFF, PNG and PSD (Mac only) image formats; podcasting support Wi-Fi web browsing", "name" : "Apple iPod Touch", "page_description" : "Play music, watch video and surf the Internet with the touch of a finger. The revolutionary multitouch interface is easy to use and the built-in wi-fi comes with a Safari Web browser. Music, movies, games and the Internet — with a built-in speaker and groundbreaking technologies such as accelerometer, and 3D graphics, iPod touch puts an amazing entertainment experience in the palm of your hand.", "page_keywords" : "Apple, iPod, iPod Touch, MP3, Music Player, Video iPod", "page_title" : "Apple iPod Touch", "primary_category_id" : "electronics-digital-media-players", "short_description" : "Play music, watch video and surf the Internet with the touch of a finger. The revolutionary multitouch interface is easy to use and the built-in wi-fi comes with a Safari Web browser. Music, movies, games and the Internet — with a built-in speaker and groundbreaking technologies such as accelerometer, and 3D graphics, iPod touch puts an amazing entertainment experience in the palm of your hand.", "type" : { "master" : true }, recommendations": [ { "_type": "product_recommendation", "recommendation_type": { "_type": "recommendation_type", "display_value": "Cross-Sell", "value": 1 }, "recommended_item_id": "apple-ipod-classic", "recommended_item_link": "https://example.com/dw/shop/v23_2/products/apple-ipod-classic" }, { "_type": "product_recommendation", "recommendation_type": { "_type": "recommendation_type", "display_value": "Up-Sell", "value": 2 }, "recommended_item_id": "apple-ipod-shuffle", "recommended_item_link": "https://example.com/dw/shop/v23_2/products/apple-ipod-shuffle" }, { "_type": "product_recommendation", "recommendation_type": { "_type": "recommendation_type", "display_value": "Cross-Sell", "value": 1 }, "recommended_item_id": "apple-ipod-nano", "recommended_item_link": "https://example.com/dw/shop/v23_2/products/apple-ipod-nano" } ``` -------------------------------- ### GET Slot Configuration Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/data/Resources/SlotConfigurations.html Example HTTP GET request to retrieve a specific slot configuration. Includes necessary headers and path parameters for targeting the correct configuration. ```http GET /s/-/dw/data/v23_2/sites/SiteGenesis/slots/header-banner/slot_configurations/2015-06-24_16%3A33%3A18 HTTP/1.1 Host: example.com Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367 Content-Type: application/json; charset=UTF-8 ``` -------------------------------- ### Sample Request for Product Options Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Products.html This sample demonstrates how to make a GET request to retrieve product options for a specific product. The 'Accept' header should be set to 'application/json'. ```http REQUEST: GET /dw/shop/v23_2/products/garmin-gps-60/options HTTP/1.1 Host: example.com Accept: application/json ``` -------------------------------- ### Product Search Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/ProductSearch.html Demonstrates a GET request to the product search endpoint with various parameters including query, refinements, and sorting. This is useful for understanding how to construct search queries. ```HTTP GET /dw/shop/v23_2/product_search/availability?q=shoes&refine_1=cgid=womens&refine_2=c_refinementColor=Black&refine_3=price=(0..500)&sort=top-sellers&count=5 HTTP/1.1 Host: example.com Accept: application/json ``` -------------------------------- ### Sample Request and Response Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Products.html This sample demonstrates a GET request for product set information and the corresponding JSON response, including details of products within the set. ```http REQUEST: GET /dw/shop/v23_2/products/fall-look/set_products HTTP/1.1 Host: example.com Accept: application/json RESPONSE: HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 Cache-Control: max-age=900,must-revalidate { "_v" : "23.2", "_type":"product", "id" : "fall-look", "long_description" : "Fall Look", "name" : "Fall Look", "primary_category_id" : "womens-outfits", "set_products" : [ { "id" : "013742003314", "name" : "Pink and Gold Necklace", "type" : { "variant" : true }, "upc" : "013742003314" }, { "id" : "25592648", "long_description" : "You will love this floral tunic with embroidery! Perfect for Spring!", "name" : "Floral Tunic", "page_description" : "You will love this floral tunic with embroidery! Perfect for Spring!", "page_title" : "Floral Tunic", "primary_category_id" : "womens-clothing-tops", "short_description" : "You will love this floral tunic with embroidery! Perfect for Spring!", "type" : { "master" : true } }, { "id" : "25698039", "long_description" : "Classically designed, this straight leg pant is perfect to pair with the matching Salesforce Commerce Cloud Store jacket! ", "name" : "Straight Leg Pant.", "page_description" : "Classically designed, this straight leg pant is perfect to pair with the matching Salesforce Commerce Cloud Store jacket! ", "page_title" : "Straight Leg Pant.", "primary_category_id" : "womens-clothing-bottoms", "short_description" : "Classically designed, this straight leg pant is perfect to pair with the matching Salesforce Commerce Cloud Store jacket! ", "type" : { "master" : true } }, { "id" : "013742003314", "name" : "Pink and Gold Necklace", "type" : { "variant" : true }, "upc" : "013742003314" }, { "id" : "25592648", "long_description" : "You will love this floral tunic with embroidery! Perfect for Spring!", "name" : "Floral Tunic", "page_description" : "You will love this floral tunic with embroidery! Perfect for Spring!", "page_title" : "Floral Tunic", "primary_category_id" : "womens-clothing-tops", "short_description" : "You will love this floral tunic with embroidery! Perfect for Spring!", ``` -------------------------------- ### Get Customer Payment Instrument Request Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Customers.html Example request to retrieve a specific customer's payment instrument. ```http GET /dw/shop/v23_2/customers/acE9xUWs5ea75qwTh0Svi2XfRY/payment_instruments/eg5hEiWbPdcaQaaaekty3fqx1o HTTP/1.1 Host: example.com Authorization: Bearer cd669706-3638-4dd1-a8b2-310ab900ca53 Content-Type: application/json ``` -------------------------------- ### GET Customer Product Lists URL Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Customers.html Example URL for retrieving customer product lists. Supports pagination and expansion of product details. ```http GET https://hostname:port/dw/shop/v23_2/customers/{customer_id}/product_lists?expand={String}&start={Integer}&count={Integer} ``` -------------------------------- ### Slot Configuration Search Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/data/Resources/SlotConfigurationSearch.html This example demonstrates how to construct a POST request to search for slot configurations. It specifies fields for text search and a select all query. ```http POST /s/-/dw/data/v23_2/sites/SiteGenesis/slot_configuration_search HTTP/1.1 Host: example.com Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367 Accept: application/json { "query" : { "text_query": { "fields": ["configuration_id", "description"], "search_phrase": "header_banner_html" } }, "select" : "(**)" } ``` -------------------------------- ### HEAD Request and Response Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/HttpMethods.html Demonstrates a HEAD request to retrieve only headers for a product, and the expected 204 NO CONTENT response. ```http REQUEST: HEAD /dw/shop/v23_2/products/123 HTTP/1.1 Host: example.com Accept: application/json RESPONSE: HTTP/1.1 204 NO CONTENT Content-Length: 67 Content-Type: application/json; charset=UTF-8 ``` -------------------------------- ### Get Shared Variation Attributes Request Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/data/Resources/Catalogs.html Example GET request to retrieve shared variation attributes for a catalog. ```http GET /s/-/dw/data/v23_2/catalogs/my-catalog/shared_variation_attributes?count=20 HTTP/1.1 Host: example.com Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367 Content-Type: application/json; charset=UTF-8 ``` -------------------------------- ### Sample Product Variations GET Request Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Products.html Demonstrates how to request product variations using the GET method. Includes common headers like Host and Accept. ```http GET /dw/shop/v23_2/products/apple-ipod-touch/variations HTTP/1.1 Host: example.com Accept: application/json ``` -------------------------------- ### Get Order Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Orders.html Demonstrates a sample GET request to retrieve order details using the order number. ```http GET /dw/shop/v23_2/orders/1234567890 HTTP/1.1 Host: example.com Content-Type: application/json; charset=UTF-8 ``` -------------------------------- ### Sample GET Request for Product List Item Purchase Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Customers.html Demonstrates a successful GET request to retrieve a specific product list item purchase for a customer. Includes necessary headers and URL structure. ```http GET /dw/shop/v23_2/customers/acE9xUWs5ea75qwTh0Svi2XfRY/product_lists/bcedkiWbxCM2MaaadkRhB2IBzM/purchases/83bc7410d26508b6c7598f3c24 HTTP/1.1 Host: example.com Authorization: Bearer cd669706-3638-4dd1-a8b2-310ab900ca53 Content-Type: application/json ``` -------------------------------- ### Customer Orders GET Request Sample Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Customers.html Demonstrates a sample GET request for retrieving a customer's orders without specific paging details. ```http # Request, no paging details REQUEST: GET /dw/shop/v23_2/customers/cevGs1bS2Xac8fpwe6GHJEzYlg/orders HTTP/1.1 Host: example.com ``` -------------------------------- ### Password Reset Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Customers.html Example of a POST request to initiate a password reset for a customer. Includes request headers and expected success/failure responses. ```http POST /dw/shop/v23_2/customers/cdRXAiWbPdMhcaaadh5hZczLu5/password_reset HTTP/1.1 Host: example.com Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367 Content-Length: 0 ``` ```http HTTP/1.1 204 NO CONTENT ``` ```http HTTP/1.1 400 BAD REQUEST Content-Type: application/json;charset=UTF-8 { "_v" : "23.2", "fault" : { "arguments" : { "extensionPoint" : "dw.ocapi.shop.customer.password_reset.afterPOST", "statusCode" : "EXT_PW_CHANGE_FAIL", "statusMessage" : "Password reset not successful in external system." }, "type" : "HookStatusException", "message" : "Error in ExtensionPoint 'dw.ocapi.shop.customer.password_reset.afterPOST'!" } } ``` -------------------------------- ### Create Basket Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Baskets.html This example demonstrates how to create a basket using a POST request to the OCAPI endpoint. It includes the necessary headers and shows a typical success response containing the new basket's ID and other details. ```http POST /dw/shop/v23_2/baskets HTTP/1.1 Host: example.com Authorization:Bearer eyJfdiI6IjXXXXXX.eyJfdiI6IjEiLCJleHAXXXXXXX.-d5wQW4c4O4wt-Zkl7_fiEiALW1XXXX Content-Type: application/json Content-Length: 0 ``` ```http HTTP/1.1 200 OK Content-Length:124 Content-Type:application/json;charset=UTF-8 { "_v" : "23.2", "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5", "_type" : "basket", "_flash" : [ ... ] ... "basket_id" : "bczFTaOjgEqUkaaadkvHwbgrP5", "currency" : "USD", "customer_info" : { ``` -------------------------------- ### GET Customer Product Lists Request and Success Response Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Customers.html Shows a sample GET request for retrieving a customer's product lists and a successful 200 OK response with product list data. ```http GET /dw/shop/v23_2/customers/abIc5hnebSnMSngHiQAekNE6Xd/product_lists HTTP/1.1 Host: example.com Authorization: Bearer cd669706-3638-4dd1-a8b2-310ab900ca53 Content-Type: application/json HTTP/1.1 200 OK Cache-Control: max-age=0,no-cache,no-store,must-revalidate Content-Type: application/json;charset=UTF-8 { "_v": "23.2", "_type": "customer_product_list_result", "count": 2, "data": [ { "_type": "customer_product_list", "creation_date": "2020-07-29T22:30:43.000Z", "event": { "_type": "product_list_event" }, "id": "0000073597bbf8c7604dce8f2c", "items_link": { "_type": "customer_product_list_item_link", "link": "https://example.com/s/SiteGenesis/dw/shop/v23_2/customers/acXvoeW9o2g9SSiaHDHjnm7Pvc/product_lists/0000073597bbf8c7604dce8f2c/items?start=0&count=2", "title": "0 items" }, "last_modified": "2020-07-29T22:30:44.000Z", "public": false, "type": "wish_list" }, { "_type": "customer_product_list", "creation_date": "2020-07-29T22:30:42.000Z", "event": { "_type": "product_list_event" }, "id": "0000407a34e39368119d1db05c", "items_link": { "_type": "customer_product_list_item_link", "link": "https://example.com/s/SiteGenesis/dw/shop/v23_2/customers/acXvoeW9o2g9SSiaHDHjnm7Pvc/product_lists/0000407a34e39368119d1db05c/items?start=0&count=2", "title": "0 items" }, "last_modified": "2020-07-29T22:30:44.000Z", "public": false, "type": "wish_list" } ], "next": "https://localhost/s/SiteGenesis/dw/shop/v23_2/customers/acXvoeW9o2g9SSiaHDHjnm7Pvc/product_lists?start=2&count=2", "start": 0, "total": 4 } ``` -------------------------------- ### GET Request for Category Links Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/data/Resources/CategoryLinks.html Example of a GET request to retrieve category links. Includes sample headers and query parameters. ```http GET /s/-/dw/data/v23_2/catalogs/MyCatalog/categories/MyCategory1/category_links?select=(**) HTTP/1.1 Host: example.com Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367 Content-Type: application/json; charset=UTF-8 ``` -------------------------------- ### Get Customer Product List Item Success Response Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Customers.html Example of a successful response when retrieving a customer product list item. Includes item details and metadata. ```json { "_v" : "23.2", "_type" : "customer_product_list_item", "_resource_state" : "826247114ce7f0afd37993890e05620b75fdacd09b2dad80406bba87926b91af", "id" : "1d447daa4d25805fd682bd4ce1", "priority" : 4, "product_details_link" : { "_type" : "product_simple_link", "link" : "https://example.com/dw/shop/v23_2/products/008884303989", "title" : "Platinum Blue Stripes Easy Care Fitted Shirt" }, "product_id" : "008884303989", "public" : true, "purchased_quantity" : 0, "quantity" : 2, "type" : "product" } ``` -------------------------------- ### GET Customer Product List Success Response Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Customers.html Example of a successful HTTP 200 OK response when retrieving a customer product list. The response body contains details of the product list. ```json HTTP/1.1 200 OK Cache-Control: max-age=0,no-cache,no-store,must-revalidate Content-Type: application/json;charset=UTF-8 { "_v" : "23.2", "_type" : "customer_product_list", "co_registrant" : { "_type" : "product_list_registrant", "email" : "[email protected]", "first_name" : "Jane", "last_name" : "Doe", "role" : "Bride" }, "description" : "our productlist", "event" : { "_type" : "product_list_event", "city" : "Washington", "country" : "US", "date" : "2015-07-30T00:00Z", "state" : "DC", "type" : "Wedding" }, "id" : "bcedkiWbxCM2MaaadkRhB2IBzM", "items_link" : { "_type" : "customer_product_list_item_link", "link" : "https://example.com/dw/shop/v23_2/customers/acE9xUWs5ea75qwTh0Svi2XfRY/product_lists/bcedkiWbxCM2MaaadkRhB2IBzM/items", "title" : "0 items" }, "name" : "OurProductList", "public" : false, "registrant" : { "_type" : "product_list_registrant", "email" : "[email protected]", "first_name" : "John", "last_name" : "Doe", "role" : "Groom" }, "shipping_address_link" : { "_type" : "address_link", "address_id" : "me", "link" : "https://example.com/dw/shop/v23_2/customers/acE9xUWs5ea75qwTh0Svi2XfRY/addresses/me", "title" : "me, John Doe, Woburn" }, "type" : "wish_list" } ``` -------------------------------- ### Customer Baskets GET Request Sample Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Customers.html Illustrates a sample GET request for retrieving a customer's baskets, including headers and expected response structure. ```http # Request REQUEST: GET /dw/shop/v23_2/customers/abdlkQCKV1aEqUQoeFOwAOeD4U/baskets HTTP/1.1 Host: example.com Authorization:Bearer eyJfdiI6IjXXXXXX.eyJfdiI6IjEiLCJleHAXXXXXXX.-d5wQW4c4O4wt-Zkl7_fiEiALW1XXXX Content-Type:application/json;charset=UTF-8 # in case of success RESPONSE: HTTP/1.1 200 OK Content-Type:application/json;charset=UTF-8 { "_v" : "23.2", "_type" : "baskets_result", "baskets" : [ { "_type" : "basket", "basket_id" : "bccO1aOjgEnuIaaadk7pYO2rFE", ... }, { "_type" : "basket", "basket_id" : "bcs5vaOjgEQ9Uaaadk9zQIrXE6", ... } ], "total" : 2 } ``` -------------------------------- ### Sample Response for Product Options Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Products.html This sample shows a successful response when retrieving product options. It includes product details and a list of available options with their values. ```json HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 Cache-Control: max-age=900,must-revalidate { "_v" : "23.2", "_type":"product", "brand" : "Garmin", "id" : "garmin-gps-60", "min_order_quantity" : 1, "name" : "Garmin GPS 60™ Portable GPS Unit", "options" : [ { "id" : "gpsWarranty", "name" : "Extended Warranty", "values" : [ { "default" : true, "id" : "000", "name" : "None" }, { "default" : false, "id" : "001", "name" : "1 Year Warranty" }, { "default" : false, "id" : "004", "name" : "2 Year Warranty" }, { "default" : false, "id" : "002", "name" : "3 Year Warranty" }, { "default" : false, "id" : "003", "name" : "5 Year Warranty" } ] } ] ``` -------------------------------- ### Get Catalog Details (Response Example) Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/data/Resources/Catalogs.html Example of a successful response when retrieving catalog details. This snippet shows a portion of the catalog object. ```json { "description" : "My catalog.", "id" : "my-catalog", "link" : "https://example.com/s/-/dw/data/v23_2/catalogs/my-catalog", "name" : "My Catalog", "online" : true, "owned_product_count" : 148, "recommendation_count" : 5, "root_category" : "root" } ``` -------------------------------- ### Basket Not Found Response Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/shop/Resources/Baskets.html This example shows the structure of a 404 Not Found response when a basket cannot be located. ```json { "_v" : "23.2", "fault" : { "type" : "BasketNotFoundException", "message" : "No basket with ID 'xxbcql1aOjgEsaaadkOtMbgrQq' could be found." } } ``` -------------------------------- ### Get Product Variation Attribute Values Request Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/data/Resources/Products.html Example GET request to retrieve variation attribute values for a specific product and attribute. ```http GET /s/-/dw/data/v23_2/products/master_product_1/variation_attributes/color/values HTTP/1.1 Host: example.com Authorization: Bearer cccccccc-dddd-aaaa-ffff-2c53c4507367 Content-Type: application/json; charset=UTF-8 ``` -------------------------------- ### Example Usage Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/docs/scriptapi/html/api/class_dw_rpc_WebReference.html Example of how to create and use a WebReference object. ```APIDOC ## Example ```javascript // Assuming MyWSDL.wsdl is defined in the webreferences directory var webref : WebReference = webreferences.MyWSDL; var stub : Stub = webref.getDefaultService(); // Now you can use the stub to call web service operations ``` ``` -------------------------------- ### GET Shared Product Option Request Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/data/Resources/Catalogs.html Example of a GET request to retrieve a shared product option, including query parameters for currency. ```http GET /s/-/dw/data/v23_2/catalogs/my-catalog/shared_product_options/option15¤cy=USD HTTP/1.1 Host: example.com Authorization: Bearer aaaaaaaa-dddd-cccc-eeee-aaaaaaaa Content-Type: application/json; charset=UTF-8 ``` -------------------------------- ### Product Search Request Example Source: https://github.com/clavery/docset-sfcc-b2c/blob/main/ocapi/data/Resources/ProductSearch.html This example demonstrates a POST request to the product search endpoint with a JSON body specifying a text query for product IDs. ```http POST /s/-/dw/data/v23_2/product_search HTTP/1.1 Host: example.com Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367 Accept: application/json { "query" : { "text_query": { "fields": ["id"], ```