### Retrieve a Store by Name and Properties (GET) Source: https://developers.cafe24.com/docs/en/api/dcollection This example shows how to retrieve a store by specifying both its name and properties using query parameters. Multiple parameters are separated by an ampersand. ```bash GET https://dcollection-api.cafe24.com/api/shops?shop_name=nelly&shop_properties=hartebeest ``` -------------------------------- ### Initialize and Make API Request (JavaScript) Source: https://developers.cafe24.com/docs/en/api Example of initializing the Cafe24 API with a version and client ID, then making a GET request to retrieve categories. ```javascript (function(CAFE24API) { CAFE24API.get('/api/v2/categories', function (err, res) { console.log(res); });})(CAFE24API.init({ version: 'yyyy-mm-dd', client_id: 'BrIfqEKoP.......'})); ``` -------------------------------- ### Javascript GET Request Example Source: https://developers.cafe24.com/docs/en/api Demonstrates how to perform a GET request to retrieve categories using the Cafe24 API. Ensure CAFE24API is initialized with your client ID. ```javascript (function(CAFE24API) { CAFE24API.get('/api/v2/categories', function (err, res) { console.log(res); }); })(CAFE24API.init({ client_id: 'BrIfqEKoP....... })); ``` -------------------------------- ### Front API Example Source: https://developers.cafe24.com/docs/en/api This snippet demonstrates how to use the Front API to retrieve data, such as product information. It shows a basic GET request to the categories endpoint. ```APIDOC ## GET /api/v2/categories ### Description Retrieves a list of categories. This is a common operation for displaying product information. ### Method GET ### Endpoint /api/v2/categories ### Parameters #### Query Parameters (No specific query parameters are detailed in the source for this example, but typically would include filtering or pagination options) ### Request Example ```javascript (function(CAFE24API) { CAFE24API.get('/api/v2/categories', function (err, res) { console.log(res); }); })(CAFE24API.init({ client_id: 'BrIfqEKoP....' })); ``` ### Response #### Success Response (200) Returns a JSON object containing category data. #### Response Example ```json { "resource": { "key": "value", "key": "value" } } ``` #### Error Response ```json { "error": { "code": "error code", "message": "error message", "more_info": {} } } ``` ``` -------------------------------- ### Retrieve a Store by Specific Name (GET) Source: https://developers.cafe24.com/docs/en/api/dcollection Example of a GET request to retrieve a store by its specific name. This demonstrates adding a query parameter to the shops endpoint. ```bash GET https://dcollection-api.cafe24.com/api/shops?shop_name=nelly ``` -------------------------------- ### Retrieve Products by Category or Product Names (GET) Source: https://developers.cafe24.com/docs/en/api/dcollection This example shows how to retrieve products that match a specific category OR are listed under specific product names. It uses multiple query parameters, with one parameter accepting a comma-separated list. ```bash GET https://dcollection-api.cafe24.com/api/products?dcollection_product_category=C200802&product_name=안다르,에어쿨링 ``` -------------------------------- ### Make Authenticated API Request (cURL) Source: https://developers.cafe24.com/docs/en/api Example cURL command to make a GET request to retrieve the product count, including Basic Authentication and necessary headers. ```curl curl -X GET \ 'https://{mallid}.cafe24api.com/api/v2/products/count' \ -H 'Authorization: Basic {base64_encode({client_id}:{front_api_key})}' \ -H 'Content-Type: application/json' \ -H 'X-Cafe24-Client-Id: {client_id}' ``` -------------------------------- ### Retrieve Products with Offset Source: https://developers.cafe24.com/docs/en/api Example of retrieving product details starting from a specific offset, used for pagination when results exceed the 'limit'. ```http GET https://dcollection-api.cafe24.com/api/products?dcollection_product_category=C200802&limit=100&offset=200 ``` -------------------------------- ### Example GET Request using cURL Source: https://developers.cafe24.com/docs/en/api/admin Use this cURL command to make a GET request to retrieve data from an endpoint. Ensure you replace placeholders with your actual mall ID, endpoint URL, access token, and API version. ```bash curl -X GET \ 'https://{mallid}.cafe24api.com/{endpoint_url}' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -H 'X-Cafe24-Api-Version: {version}' ``` -------------------------------- ### Sample GET Request (cURL) Source: https://developers.cafe24.com/docs/en/api/cafe24data Example of how to make a GET request to the Cafe24 Analytics API using cURL. Ensure you replace {access_token} with your valid token. ```bash curl -X GET \ 'https://ca-api.cafe24data.com/visitors/pageview' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' ``` -------------------------------- ### Retrieve a Store and Product Endpoint Examples Source: https://developers.cafe24.com/docs/en/api/dcollection Examples of API endpoints for retrieving store and product data. The product retrieval endpoint includes a parameter for filtering by dcollection_product_category. ```bash Retrieve a store : https://dcollection-api.cafe24.com/api/shops Retrieve a product : https://dcollection-api.cafe24.com/api/products?dcollection_product_category={dcollection_product_category} ``` -------------------------------- ### Retrieve Product Sales by Date Range Source: https://developers.cafe24.com/docs/en/api/cafe24data Example GET request to retrieve sales amount and quantity by product for a specific store within a specified time range. Use '&' to separate parameters. ```http GET https://ca-api.cafe24data.com/products/sales?mall_id=nelly&start_date=2023-01-01&end_date=2023-02-01 ``` -------------------------------- ### Retrieve Products by Category (GET) Source: https://developers.cafe24.com/docs/en/api/dcollection Example of retrieving products filtered by a specific dcollection_product_category. This uses a query parameter on the products endpoint. ```bash GET https://dcollection-api.cafe24.com/api/products?dcollection_product_category=C200802 ``` -------------------------------- ### Get Product SEO Source: https://developers.cafe24.com/docs/en/api/admin Retrieves the SEO settings for a specific product. ```bash GET /api/v2/admin/products/{product_no}/seo ``` -------------------------------- ### How to use GET API Source: https://developers.cafe24.com/docs/en/api This section explains how to retrieve data using GET requests, including adding search conditions, using commas for multiple items, and viewing multi-language store information. ```APIDOC ## How to use GET API Cafe24 API provides several ways to get the data. The following describes the different ways to recall data using various parameters when inquiring an API. ### 1. Add search conditions You can use search conditions by adding parameters to an endpoint. If you want to use multiple search conditions, separate them with ampersands (&). You can also specify a date and time if it is supported by the API you are using. > Add search conditions ``` E.g. When searching for products of which price is KRW 1,000 or higher in a certain brand GET https://{mallid}.cafe24api.com/api/v2/products?brand_code=B000000A&price_min=1000 E.g. When searching for products by specifying the date range in which they were added GET https://{mallid}.cafe24api.com/api/v2/products?created_start_date=2018-01-03&created_end_date=2018-02-03 E.g. When searching for products by specifying the date range in which they were edited GET https://{mallid}.cafe24api.com/api/v2/products?updated_start_date=2018-01-03T14:01:26+09:00&updated_end_date=2018-02-03T14:01:26+09:00 ``` ### 2. Use commas to search for more than one item Use commas to search for data for more than one item. (You can search for up to 100 items in one query.) The search conditions separated by commas are OR conditions; You can view all data corresponding to the conditions. > Use commas to search for more than one item ``` E.g. When searching for products by specifying their product numbers GET https://{mallid}.cafe24api.com/api/v2/products?product_no=11,12,13 E.g. When searching for products by specifying their product numbers and product codes GET https://{mallid}.cafe24api.com/api/v2/products?product_no=11,12,13&product_code=P000000X,P000000W ``` ### 3. View multi-language store information You can search for the information of a localized store by specifying its multi-language store number. If you don't, the information of the default store will be shown. > View multi-language store information ``` E.g. When searching for products in a certain localized store GET https://{mallid}.cafe24api.com/api/v2/products?shop_no=2 ``` ``` -------------------------------- ### How to use GET API Source: https://developers.cafe24.com/docs/en/api/admin This section explains how to effectively use GET requests with the Cafe24 API, covering the addition of search conditions, searching for multiple items using commas, and viewing multi-language store information. ```APIDOC ## How to use GET API Cafe24 API provides several ways to get the data. The following describes the different ways to recall data using various parameters when inquiring an API. ### 1. Add search conditions You can use search conditions by adding parameters to an endpoint. If you want to use multiple search conditions, separate them with ampersands (&). #### Example: Searching for products by price range ``` GET https://{mallid}.cafe24api.com/api/v2/products?brand_code=B000000A&price_min=1000 ``` #### Example: Searching for products by creation date range ``` GET https://{mallid}.cafe24api.com/api/v2/products?created_start_date=2018-01-03&created_end_date=2018-02-03 ``` #### Example: Searching for products by update date range ``` GET https://{mallid}.cafe24api.com/api/v2/products?updated_start_date=2018-01-03T14:01:26+09:00&updated_end_date=2018-02-03T14:01:26+09:00 ``` ### 2. Use commas to search for more than one item Use commas to search for data for more than one item (You can search for up to 100 items in one query). The search conditions separated by commas are OR conditions; You can view all data corresponding to the conditions. #### Example: Searching for products by specifying their product numbers ``` GET https://{mallid}.cafe24api.com/api/v2/products?product_no=11,12,13 ``` #### Example: Searching for products by specifying their product numbers and product codes ``` GET https://{mallid}.cafe24api.com/api/v2/products?product_no=11,12,13&product_code=P000000X,P000000W ``` ### 3. View multi-language store information You can search for the information of a localized store by specifying its multi-language store number. If you don't, the information of the default store will be shown. #### Example: Searching for products in a certain localized store ``` GET https://{mallid}.cafe24api.com/api/v2/products?shop_no=2 ``` ``` -------------------------------- ### Create a script tag Source: https://developers.cafe24.com/docs/en/api/admin Installs a remotely located script on a specific page of the mall. ```APIDOC ## POST /api/v2/admin/scripttags ### Description Installs a remotely located script on a specific page of the mall. This API facilitates adding functionality without altering the mall's design. ### Method POST ### Endpoint /api/v2/admin/scripttags ``` -------------------------------- ### Example API Endpoint Source: https://developers.cafe24.com/docs/en/api This is a sample endpoint URL for accessing the Cafe24 API. Replace {mallid} with your specific mall ID. ```text https://{mallid}.cafe24api.com/api/v2/sampleapi ``` -------------------------------- ### Retrieve a list of product options Source: https://developers.cafe24.com/docs/en/api/admin Use this endpoint to look up the product's options as a list. Ensure you have the mall.read_product scope. ```bash curl https://api.cafe24.com/api/v2/admin/products/{product_no}/options \ -H "NHN-API-KEY: {API_KEY}" \ -H "access_token: {ACCESS_TOKEN}" \ -H "shop_no: {SHOP_NO}" ``` -------------------------------- ### Create Product Source: https://developers.cafe24.com/docs/en/api/admin Registers a new product in the system. ```APIDOC ## POST /api/v2/admin/products ### Description Creates a new product in the system. Requires product details in the request body. ### Method POST ### Endpoint /api/v2/admin/products ### Parameters #### Request Body - **product_name** (string) - Required - The name of the product. - **description** (string) - Optional - A description for the product. - **price** (float) - Required - The price of the product. ### Request Example { "product_name": "New Gadget", "description": "A brand new gadget with advanced features.", "price": 199.50 } ### Response #### Success Response (201) - **product_no** (integer) - The unique identifier of the newly created product. - **message** (string) - Confirmation message. #### Response Example { "product_no": 456, "message": "Product created successfully." } ``` -------------------------------- ### Create product options Source: https://developers.cafe24.com/docs/en/api/admin Use this POST endpoint to create and register options for a product. Items are automatically created when options are registered. Requires mall.write_product scope. ```bash curl -X POST https://api.cafe24.com/api/v2/admin/products/{product_no}/options \ -H "NHN-API-KEY: {API_KEY}" \ -H "access_token: {ACCESS_TOKEN}" \ -H "shop_no: {SHOP_NO}" \ -d '{ "options": [ { "option_name": "Color", "option_type": "F", "select_one_by_option": "T", "use_additional_option": "F", "additional_options": [], "use_attached_file_option": "F", "attached_file_option": [], "option_list_type": "S", "options": [ { "option_name": "Red", "price": "0", "display_order": 1 }, { "option_name": "Blue", "price": "0", "display_order": 2 } ] }, { "option_name": "Size", "option_type": "F", "select_one_by_option": "T", "use_additional_option": "F", "additional_options": [], "use_attached_file_option": "F", "attached_file_option": [], "option_list_type": "S", "options": [ { "option_name": "S", "price": "0", "display_order": 1 }, { "option_name": "M", "price": "0", "display_order": 2 }, { "option_name": "L", "price": "0", "display_order": 3 } ] } ] }' ``` -------------------------------- ### Retrieve Stores with Offset Source: https://developers.cafe24.com/docs/en/api Example of retrieving store details starting from a specific offset, used for pagination when results exceed the 'limit'. ```http GET https://dcollection-api.cafe24.com/api/shops?limit=100&offset=200 ``` -------------------------------- ### Create Subscription Payment Rule Source: https://developers.cafe24.com/docs/en/api/admin Use this endpoint to set up regular delivery products. Note the scope and request limits for this operation. ```bash POST /api/v2/admin/subscription/shipments/setting ``` -------------------------------- ### Set icons for a product Source: https://developers.cafe24.com/docs/en/api/admin Registers product icons for a specific product. Requires icon codes and optionally image lists with display settings. ```bash POST /api/v2/admin/products/{product_no}/icons ``` -------------------------------- ### Example POST Request using cURL Source: https://developers.cafe24.com/docs/en/api/admin This cURL command demonstrates how to make a POST request for registering or modifying resources. Replace placeholders and provide the JSON data in the -d argument. ```bash curl -X POST \ 'https://{mallid}.cafe24api.com/{endpoint_url}' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -H 'X-Cafe24-Api-Version: {version}' \ -d '{ .... }' ``` -------------------------------- ### Retrieve a count of script tags Source: https://developers.cafe24.com/docs/en/api/admin Use this endpoint to get the total number of script tags installed in your shopping mall. It helps in understanding the current script tag usage. ```bash curl -X GET "https://{shop_domain}/api/v2/admin/scripttags/count?shop_no={shop_no}" ``` -------------------------------- ### Create a Product Memo Source: https://developers.cafe24.com/docs/en/api/admin Use this endpoint to register notes for a particular product. Ensure you provide the author ID and the memo content. ```HTTP POST /api/v2/admin/products/{product_no}/memos ``` -------------------------------- ### Retrieve Stores by Multiple Names (GET) Source: https://developers.cafe24.com/docs/en/api/dcollection Example of retrieving multiple stores by providing a comma-separated list of shop names. This utilizes the OR condition for multiple values in a single parameter. ```bash GET https://dcollection-api.cafe24.com/api/shops?shop_name=nelly,reseda ``` -------------------------------- ### List bundle products Source: https://developers.cafe24.com/docs/en/api/admin Retrieves a list of all bundle products available in the store. ```bash GET /api/v2/admin/bundleproducts ``` -------------------------------- ### Retrieve Page View Count by Date Range Source: https://developers.cafe24.com/docs/en/api/cafe24data Example GET request to retrieve page view counts for a specific store within a given date range. Parameters are delimited by '&'. ```http GET https://ca-api.cafe24data.com/visitors/pageview?mall_id=nelly&start_date=2023-01-01&end_date=2023-02-01 ``` -------------------------------- ### D.Collection API Request Example (cURL) Source: https://developers.cafe24.com/docs/en/api/dcollection This snippet shows a basic cURL command for making a GET request to a D.Collection API resource. It includes the endpoint URL and the required Authorization and Content-Type headers. ```bash curl -X GET \ 'https://dcollection-api.cafe24.com/api/{resource_name}' \ -H 'Authorization: Basic {base64_encode({clinet_id}:{client_secret}}' \ -H 'Content-Type: application/json' ``` -------------------------------- ### Add Search Conditions: Price Range Source: https://developers.cafe24.com/docs/en/api Use this example to search for products within a specific price range. Ensure the 'brand_code' and 'price_min' parameters are correctly set. ```http GET https://{mallid}.cafe24api.com/api/v2/products?brand_code=B000000A&price_min=1000 ``` -------------------------------- ### Retrieve Visitor Count by Domain and Date Range Source: https://developers.cafe24.com/docs/en/api/cafe24data Example GET request to retrieve visitor counts by domain for a specific store within a given date range. Multiple search conditions are added using '&'. ```http GET https://ca-api.cafe24data.com/visitpaths/domains?mall_id=nelly&start_date=2023-01-01&end_date=2023-02-01 ``` -------------------------------- ### Retrieve Hourly Sales Data by Date Range Source: https://developers.cafe24.com/docs/en/api/cafe24data Example GET request to retrieve hourly sales data (count of customers, orders, sales amount) for a specific store within a specified time range. Parameters are delimited by '&'. ```http GET https://ca-api.cafe24data.com/sales/times?mall_id=nelly&start_date=2023-01-01&end_date=2023-02-01 ``` -------------------------------- ### Retrieve Product SEO Settings Source: https://developers.cafe24.com/docs/en/api/admin Use this endpoint to inquire about the SEO settings of a specific product. Ensure you have the necessary read permissions. ```bash curl -X GET "https://{yourdomain}.cafe24api.com/api/v2/admin/products/{product_no}/seo?shop_no=1" \ -H "Content-Type: application/json" \ -H "X-Cafe24-Api-Version: 20221101" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` -------------------------------- ### Product Decoration Images Endpoints Source: https://developers.cafe24.com/docs/en/api/admin Overview of available endpoints for managing product decoration images. ```bash GET /api/v2/admin/products/{product_no}/decorationimages__ POST /api/v2/admin/products/{product_no}/decorationimages__ PUT /api/v2/admin/products/{product_no}/decorationimages__ DELETE /api/v2/admin/products/{product_no}/decorationimages/{code}__ ``` -------------------------------- ### JSON Response Example Source: https://developers.cafe24.com/docs/en/api Example of a successful JSON response from the Cafe24 API. ```json { "resource": { "key": "value", "key": "value" } } ``` -------------------------------- ### Retrieve interest-free installment information Source: https://developers.cafe24.com/docs/en/api/admin Retrieves the interest-free installment information for a given shop. ```APIDOC ## Retrieve interest-free installment information __ cafe24 GET /api/v2/admin/payment/freeinstallments You can retrieve interest-free installment information. #### Specification **Property** | **Description** ---|--- SCOPE | **mall.read_store** Request Limit | **40** #### Request **Parameter** | **Description** ---|--- shop_no _Min : [1]_ | Shop Number DEFAULT 1 Retrieve interest-free installment information * Retrieve interest-free installment information ``` -------------------------------- ### Retrieve app installation information Source: https://developers.cafe24.com/docs/en/api/admin Retrieves the Plus App installation information for shopping mall members. ```APIDOC ## GET /api/v2/admin/customers/{member_id}/plusapp ### Description Retrieves the Plus App installation information for shopping mall members. ### Method GET ### Endpoint /api/v2/admin/customers/{member_id}/plusapp ### Parameters #### Path Parameters - **member_id** (string) - Required - Member ID. #### Query Parameters - **shop_no** (integer) - Optional - Shop Number. Defaults to 1. ### Response #### Success Response (200) - **shop_no** (integer) - Shop Number. - **os_type** (string) - OS Type. - **install_date** (string) - Installation date. - **auto_login_flag** (boolean) - Whether the user opted-in to use the auto-login feature. - **use_push_flag** (boolean) - Whether the user opted-in to receive push notifications. ``` -------------------------------- ### Create Naver Pay Settings Source: https://developers.cafe24.com/docs/en/api/admin Registers the Naver common authentication key with the shopping mall administrator. Requires mall.write_store scope. ```bash curl -X POST "https://api.cafe24.com/api/v2/admin/naverpay/setting" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d "shop_no=1" \ -d "authentication_key=YOUR_AUTH_KEY" \ -d "naverpay_version=2.1" \ -d "shop_id=YOUR_SHOP_ID" \ -d "is_button_show=T" \ -d "is_used_order=T" \ -d "is_used_review=T" \ -d "is_show_review=T" \ -d "is_order_page=N" \ -d "certi_key=YOUR_CERTI_KEY" \ -d "image_key=YOUR_IMAGE_KEY" \ -d "naver_button_pc_product=A|1|2" \ -d "naver_button_pc_basket=A|1|1" \ -d "naver_button_mobile_product=MA|1|2" \ -d "naver_button_mobile_basket=MA|1|1" ``` -------------------------------- ### Retrieve Payment Free Installments Source: https://developers.cafe24.com/docs/en/api/admin Fetches interest-free installment information for a given shop. Requires the mall.read_store scope. ```HTTP GET /api/v2/admin/payment/freeinstallments ``` -------------------------------- ### List All Products View Source: https://developers.cafe24.com/docs/en/api/cafe24data Retrieves a list of all product view data. Requires mall ID, start date, and end date. ```bash curl -X GET "https://api.cafe24.com/products/view?mall_id=YOUR_MALL_ID&start_date=2023-01-01&end_date=2023-02-01" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Admin API Endpoint Example Source: https://developers.cafe24.com/docs/en/api Example of an Admin API endpoint URL. Replace {mallid} with your specific mall ID. ```text https://{mallid}.cafe24api.com/api/v2/admin/sampleapi ``` -------------------------------- ### Retrieve payment methods installed for a mall Source: https://developers.cafe24.com/docs/en/api/admin Retrieves a list of all payment methods that are currently installed and available for a specific mall. ```APIDOC ## GET /api/v2/admin/paymentmethods ### Description Retrieves a list of all payment methods that are currently installed and available for a specific mall. ### Method GET ### Endpoint /api/v2/admin/paymentmethods ### Parameters #### Query Parameters - **shop_no** (integer) - Optional - Shop Number. Defaults to 1. ### Response #### Success Response (200) - **shop_no** (integer) - Shop Number - **code** (string) - payment method code ``` -------------------------------- ### Create Category Source: https://developers.cafe24.com/docs/en/api/admin Creates a new product category. This is a prerequisite for selling products. ```bash POST /api/v2/admin/categories__ ``` -------------------------------- ### Retrieve Board Settings Source: https://developers.cafe24.com/docs/en/api/admin Use this endpoint to retrieve the board settings for a specific shop. ```bash curl -X GET "https://{domain}/api/v2/admin/boards/setting?shop_no=1" \ -H "Authorization: Bearer {access_token}" ``` -------------------------------- ### JSON Error Response Example Source: https://developers.cafe24.com/docs/en/api Example of an error response from the Cafe24 API, including error code, message, and additional information. ```json { "error": { "code": "error code", "message": "error message", "more_info": { } } } ```