### Create Store Ruby Example Source: https://developers.scalev.id/reference/stores Example of how to create a store using Ruby. This code snippet demonstrates making a POST request to the Scale.id API. ```ruby # Ruby example for creating a store require 'net/http' require 'uri' uri = URI.parse('https://api.scalev.id/v2/stores') https = Net::HTTP.new(uri.host, uri.port) https.use_ssl = true request = Net::HTTP::Post.new(uri.request_uri) request['accept'] = 'application/json' request['content-type'] = 'application/json' request.body = { name: 'Your Store Name' }.to_json response = https.request(request) puts response.body ``` -------------------------------- ### Create Store PHP Example Source: https://developers.scalev.id/reference/stores Example of how to create a store using PHP. This code snippet demonstrates making a POST request to the Scale.id API. ```php 'Your Store Name'); $options = array( 'http' => array( 'header' => "Content-type: application/json\r\nAccept: application/json\r\n", 'method' => 'POST', 'content' => json_encode($data) ) ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); if ($result === FALSE) { die('Error fetching data'); } var_dump($result); ?> ``` -------------------------------- ### Create Store Python Example Source: https://developers.scalev.id/reference/stores Example of how to create a store using Python. This code snippet demonstrates making a POST request to the Scale.id API. ```python # Python example for creating a store import requests import json url = 'https://api.scalev.id/v2/stores' data = { 'name': 'Your Store Name' } headers = { 'accept': 'application/json', 'content-type': 'application/json' } response = requests.post(url, data=json.dumps(data), headers=headers) print(response.json()) ``` -------------------------------- ### Create Store Node.js Example Source: https://developers.scalev.id/reference/stores Example of how to create a store using Node.js. This code snippet demonstrates making a POST request to the Scale.id API. ```javascript // Node.js example for creating a store // Requires a fetch implementation like 'node-fetch' const url = 'https://api.scalev.id/v2/stores'; const options = { method: 'POST', headers: { 'accept': 'application/json', 'content-type': 'application/json' }, body: JSON.stringify({ name: 'Your Store Name' }) }; fetch(url, options) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error(error)); ``` -------------------------------- ### Create Bundle Node.js Example Source: https://developers.scalev.id/reference/bundles Example of creating a new bundle using Node.js with the Scalev.id API v2. This snippet shows how to make a POST request with JSON payload and headers. ```javascript // Node.js example for creating a bundle // Requires a library like 'axios' or built-in 'fetch' for making HTTP requests. const axios = require('axios'); const createBundle = async (bundleData) => { try { const response = await axios.post('https://api.scalev.id/v2/bundles', bundleData, { headers: { 'accept': 'application/json', 'content-type': 'application/json' } }); return response.data; } catch (error) { console.error('Error creating bundle:', error.response ? error.response.data : error.message); throw error; } }; // Example usage: // const myBundleData = { // name: 'Example Bundle', // bundle_price_options: [], // bundlelines: [] // }; // createBundle(myBundleData).then(data => console.log('Bundle created:', data)); ``` -------------------------------- ### Troubleshooting: Testing MCP Endpoint with curl Source: https://developers.scalev.id/docs/getting-started-mcp A command-line example using `curl` to test connectivity and authorization to the MCP tools endpoint. This is useful for isolating connection issues and verifying token validity. ```bash curl -H "Authorization: Bearer YOUR_TOKEN" \ https://mcp.scalev.id/mcp/tools ``` -------------------------------- ### Example Workflow: Fetching and Updating Orders via MCP Source: https://developers.scalev.id/docs/getting-started-mcp Demonstrates a typical interaction flow where an AI assistant uses the MCP server to retrieve order information and subsequently update an order's status. This involves calling specific API endpoints. ```text User: "Show me my 10 latest orders on Scalev and their current status" AI Assistant (via MCP): 1. Calls the /order endpoint tool 2. Retrieves order details 3. Formats and presents the information User: "Update the order status for Order #250101QWERTY to confirmed" AI Assistant (via MCP): 1. Calls the /order/{id} endpoint tool with PATCH method 2. Updates the order status 3. Confirms the successful update ``` -------------------------------- ### Query Scalev MCP Server with TypeScript Source: https://developers.scalev.id/docs/getting-started-mcp This TypeScript code demonstrates how to query the Scalev MCP server using the OpenAI SDK. It defines an interface for MCP tools and an asynchronous function `queryScalev` that takes a prompt and optional allowed tools, returning the response text from the server. Ensure you have the `openai` and `dotenv` packages installed and your API keys configured. ```typescript import OpenAI from "openai"; import dotenv from "dotenv"; dotenv.config(); interface MCPTool { type: "mcp"; server_label: string; server_url: string; headers: { Authorization: string; }; allowed_tools?: string[]; require_approval?: "never" | "always" | "auto"; } const ACCESS_TOKEN: string = "API_KEY_OR_OAUTH_ACCESS_TOKEN"; const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY }); async function queryScalev(prompt: string, allowedTools?: string[]): Promise { const response = await openai.responses.create({ model: "gpt-4.1", input: prompt, tools: [ { type: "mcp", server_label: "scalev", server_url: "https://mcp.scalev.id/mcp", headers: { Authorization: `Bearer ${ACCESS_TOKEN}`, }, allowed_tools: allowedTools, require_approval: "never", } as MCPTool, ], }); return response.output_text; } // Example usage const result = await queryScalev( "List my latest 3 orders on Scalev", ["list_order"] ); console.log(result); ``` -------------------------------- ### Get Business Information (Python) Source: https://developers.scalev.id/reference/businesses Example Python request to retrieve business information using the Scale.id API. This uses the 'requests' library to make a GET request. ```Python import requests url = "https://api.scale.id/v2/businesses/me" headers = { "accept": "application/json" } response = requests.get(url, headers=headers) if response.status_code == 200: print(response.json()) else: print(f"Error: {response.status_code}") print(response.text) ``` -------------------------------- ### POST /websites/developers/scalev_id Source: https://developers.scalev.id/reference/scalevapiwebstorecontrollercreate Creates a new store with the provided configuration details. Returns the created store's details upon successful creation. ```APIDOC ## POST /websites/developers/scalev_id ### Description Creates a new store with the provided configuration details. Returns the created store's details upon successful creation. ### Method POST ### Endpoint /websites/developers/scalev_id ### Parameters #### Request Body - **auto_other_income** (string) - Optional - Type of auto other income - **max_per_phone** (integer) - Optional - Maximum orders per phone number - **capi_purchase_value_type** (string) - Optional - Type of CAPI purchase value. Enum: ["gross_revenue", "net_revenue", "adj_gross_revenue"] - **last_updated_at** (string) - Optional - Last update timestamp (format: date-time) - **is_show_whatsapp** (boolean) - Optional - Is show WhatsApp option enabled? - **digital_only_complete_type** (string) - Optional - Digital only complete type - **is_order_hard_filter** (boolean) - Optional - Is order hard filter enabled? - **is_active** (boolean) - Optional - Is the store active? - **dynamic_other_income_epayment_default_percentage** (number) - Optional - Default percentage for dynamic e-payment income (format: float) - **dynamic_other_income_cod_type** (string) - Optional - Type of amount (fixed or percentage). Enum: ["fixed", "percentage"] - **created_at** (string) - Optional - Creation timestamp (format: date-time) - **custom_domain** (object) - Optional - Custom domain details - **full_url** (string) - Optional - Full URL (format: uri) - **id** (integer) - Optional - Custom Domain ID - **is_verified** (boolean) - Optional - Is Verified ### Request Example ```json { "auto_other_income": "some_type", "max_per_phone": 10, "capi_purchase_value_type": "gross_revenue", "is_show_whatsapp": true, "is_order_hard_filter": false, "is_active": true, "dynamic_other_income_epayment_default_percentage": 5.5, "dynamic_other_income_cod_type": "percentage", "custom_domain": { "full_url": "https://example.com", "id": 123, "is_verified": true } } ``` ### Response #### Success Response (200) - **Store** (object) - Created store details - **auto_other_income** (string) - Type of auto other income - **max_per_phone** (integer) - Maximum orders per phone number - **capi_purchase_value_type** (string) - Type of CAPI purchase value - **last_updated_at** (string) - Last update timestamp (format: date-time) - **is_show_whatsapp** (boolean) - Is show WhatsApp option enabled? - **digital_only_complete_type** (string) - Digital only complete type - **is_order_hard_filter** (boolean) - Is order hard filter enabled? - **is_active** (boolean) - Is the store active? - **dynamic_other_income_epayment_default_percentage** (number) - Default percentage for dynamic e-payment income (format: float) - **dynamic_other_income_cod_type** (string) - Type of amount (fixed or percentage) - **created_at** (string) - Creation timestamp (format: date-time) - **custom_domain** (object) - Custom domain details - **full_url** (string) - Full URL (format: uri) - **id** (integer) - Custom Domain ID - **is_verified** (boolean) - Is Verified #### Response Example ```json { "auto_other_income": "some_type", "max_per_phone": 10, "capi_purchase_value_type": "gross_revenue", "last_updated_at": "2023-10-27T10:00:00Z", "is_show_whatsapp": true, "digital_only_complete_type": "default", "is_order_hard_filter": false, "is_active": true, "dynamic_other_income_epayment_default_percentage": 5.5, "dynamic_other_income_cod_type": "percentage", "created_at": "2023-10-27T09:00:00Z", "custom_domain": { "full_url": "https://example.com", "id": 123, "is_verified": true } } ``` #### Error Response (400) - **code** (integer) - Error code (e.g., 400) - **error** (string or object) - Error message or validation details - **status** (string) - Status text (e.g., "Bad Request") #### Error Response Example (400) ```json { "code": 400, "error": { "max_per_phone": "Must be a positive integer." }, "status": "Bad Request" } ``` #### Error Response (401) - **code** (integer) - Error code (e.g., 401) - **status** (string) - Status text (e.g., "Unauthorized") #### Error Response Example (401) ```json { "code": 401, "status": "Unauthorized" } ``` ``` -------------------------------- ### Get Business Information (PHP) Source: https://developers.scalev.id/reference/businesses Example PHP request to retrieve business information using the Scale.id API. This demonstrates making a GET request with cURL in PHP. ```PHP // PHP example would go here, likely using cURL // Example structure: // $curl = curl_init(); // // curl_setopt($curl, CURLOPT_URL, 'https://api.scale.id/v2/businesses/me'); // curl_setopt($curl, CURLOPT_HTTPHEADER, [ // 'accept: application/json' // ]); // curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); // // $response = curl_exec($curl); // $err = curl_error($curl); // // curl_close($curl); // // if ($err) { // echo "cURL Error # " . $err; // } else { // echo $response; // } ``` -------------------------------- ### GET /websites/{website_id}/products/{product_id} Source: https://developers.scalev.id/reference/scalevapiwebproductcontrollerindex_simplified Retrieves details of a specific product, including its variants and associated files. ```APIDOC ## GET /websites/{website_id}/products/{product_id} ### Description Retrieves details of a specific product, including its variants and associated files. ### Method GET ### Endpoint `/websites/{website_id}/products/{product_id}` ### Parameters #### Path Parameters - **website_id** (integer) - Required - The ID of the website. - **product_id** (integer) - Required - The ID of the product. ### Response #### Success Response (200) - **uuid** (string) - Product UUID. - **name** (string) - Product name. - **variants** (array) - List of variants associated with the product. - **id** (integer) - Variant primary key. - **name** (string) - Full name of the variant. - **product_name** (string) - Name of the associated product. - **item_type** (string) - Type of the product item (physical, digital, course). - **is_checked** (boolean) - Mark variant as sellable. - **is_editable** (boolean) - Indicates if the variant is editable. - **images** (array of strings) - List of image URLs associated with the variant. - **digital_product_files** (array) - List of digital product files associated with the variant. - **id** (integer) - Digital product file primary key. - **name** (string) - File name of the digital product file. - **size_in_bytes** (integer) - Size of the digital product file in bytes. - **content_type** (string) - MIME type of the digital product file. - **url** (string) - URL to access the digital product file. - **metadata** (object) - Additional metadata associated with the variant. #### Response Example ```json { "uuid": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "name": "Example Product", "variants": [ { "id": 1, "name": "Default Variant", "product_name": "Example Product", "item_type": "physical", "is_checked": true, "is_editable": false, "images": [ "https://example.com/image1.jpg" ], "digital_product_files": [], "metadata": {} } ] } ``` ``` -------------------------------- ### Get Business Information (Ruby) Source: https://developers.scalev.id/reference/businesses Example Ruby request to retrieve business information using the Scale.id API. This shows how to perform a GET request with necessary headers. ```Ruby # Ruby example would go here, likely using the 'net/http' library # Example structure: # require 'net/http' # require 'uri' # # uri = URI.parse('https://api.scale.id/v2/businesses/me') # http = Net::HTTP.new(uri.host, uri.port) # http.use_ssl = true # # request = Net::HTTP::Get.new(uri.request_uri) # request['accept'] = 'application/json' # # response = http.request(request) # puts response.body ``` -------------------------------- ### POST /websites/developers_scalev_id/bundles Source: https://developers.scalev.id/reference/scalevapiwebbundlecontrollercreate Creates a new bundle with the provided bundle data. Requires a 'name' for the bundle. ```APIDOC ## POST /websites/developers_scalev_id/bundles ### Description Creates a new bundle with the provided bundle data. Requires a 'name' for the bundle. ### Method POST ### Endpoint /websites/developers_scalev_id/bundles ### Parameters #### Request Body - **bundle** (object) - Required - Bundle data to create - **name** (string) - Required - Public Name - **rich_description** (string) - Optional - Rich Description - **weight_bump** (integer) - Optional - Weight Bump ### Request Example ```json { "bundle": { "name": "Example Bundle Name", "rich_description": "This is a rich description for the bundle.", "weight_bump": 10 } } ``` ### Response #### Success Response (200) - **code** (integer) - HTTP status code. - **data** (object) - Contains bundle price options. - **bundle_price_options** (array) - List of Bundle Price Options - **form_displays** (array) - List of form displays associated with the bundle price option - **id** (integer) - Form Display ID - **page_display** (object) - Page display information - **id** (integer) - Page Display ID - **page** (object) - Page details - **id** (integer) - Page ID - **is_published** (boolean) - Is the page published? - **name** (string) - Name of the page - **published_at** (string) - Publication date of the page - **slug** (string) - Slug for the page URL - **store_id** (integer) - ID of the store the page belongs to - **unique_id** (string) - Unique identifier for the page - **id** (integer) - Bundle Price Option ID - **name** (string) - Name of the bundle price option #### Response Example ```json { "code": 200, "data": { "bundle_price_options": [ { "form_displays": [ { "id": 123, "page_display": { "id": 456, "page": { "id": 789, "is_published": true, "name": "Sample Page", "published_at": "2023-10-27T10:00:00Z", "slug": "sample-page", "store_id": 1, "unique_id": "unique-page-id" } } } ], "id": 101, "name": "Option 1" } ] } } ``` ``` -------------------------------- ### Configure Claude Desktop App for Scalev MCP Source: https://developers.scalev.id/docs/getting-started-mcp This JSON configuration allows the Claude Desktop App to connect to the Scalev MCP server using Server-Sent Events (SSE). It specifies the command to run, arguments including the SSE endpoint and authorization header, and environment variables for the access token. ```json { "mcpServers": { "scalev": { "command": "npx", "args": [ "mcp-remote", "https://mcp.scalev.id/sse", "--header", "Authorization: Bearer ${ACCESS_TOKEN}" ], "env": { "ACCESS_TOKEN": "..." } } } } ``` -------------------------------- ### POST /websites/{websites_id}/products Source: https://developers.scalev.id/reference/scalevapiwebproductcontrollercreate Creates a new product with the provided data. This endpoint allows for the creation of new product entries within a specific website. ```APIDOC ## POST /websites/{websites_id}/products ### Description Creates a new product with the provided data. This endpoint allows for the creation of new product entries within a specific website. ### Method POST ### Endpoint /websites/{websites_id}/products ### Parameters #### Path Parameters - **websites_id** (string) - Required - The ID of the website to which the product will be added. #### Query Parameters None #### Request Body - **name** (string) - Required - The name of the product. - **description** (string) - Optional - A detailed description of the product. - **price** (number) - Required - The price of the product. - **sku** (string) - Required - The Stock Keeping Unit for the product. ### Request Example ```json { "name": "Example Product", "description": "This is a sample product description.", "price": 19.99, "sku": "EXMPL-001" } ``` ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier of the newly created product. - **name** (string) - The name of the product. - **description** (string) - The description of the product. - **price** (number) - The price of the product. - **sku** (string) - The SKU of the product. - **created_at** (string) - The timestamp when the product was created. #### Response Example ```json { "id": "prod_12345abcde", "name": "Example Product", "description": "This is a sample product description.", "price": 19.99, "sku": "EXMPL-001", "created_at": "2023-10-27T10:00:00Z" } ``` #### Error Response (400 Bad Request) - **error** (string) - A message describing the error. #### Error Response Example ```json { "error": "Missing required field: name" } ``` ``` -------------------------------- ### Get Business Information (Node.js) Source: https://developers.scalev.id/reference/businesses Example Node.js request to retrieve business information using the Scale.id API. This demonstrates making a GET request with the appropriate URL and headers. ```JavaScript // Node.js example would go here, likely using a library like 'axios' or 'node-fetch' // Example structure: // const axios = require('axios'); // // axios.get('https://api.scalev.id/v2/businesses/me', { // headers: { // 'accept': 'application/json' // } // }) // .then(response => { // console.log(response.data); // }) // .catch(error => { // console.error(error); // }); ``` -------------------------------- ### POST /websites/{website_id}/products Source: https://developers.scalev.id/reference/scalevapiwebproductcontrollercreate Creates a new product for a given website. This endpoint allows for the creation of products with various details including name, type, and variants. ```APIDOC ## POST /websites/{website_id}/products ### Description Creates a new product for a given website. This endpoint allows for the creation of products with various details including name, type, and variants. ### Method POST ### Endpoint /websites/{website_id}/products ### Parameters #### Path Parameters - **website_id** (integer) - Required - The ID of the website to which the product will be added. #### Query Parameters None #### Request Body - **name** (string) - Required - The name of the product. - **item_type** (string) - Required - The type of the item (e.g., "physical", "digital"). - **description** (string) - Optional - A detailed description of the product. - **tags** (array of strings) - Optional - Tags associated with the product. - **variants** (array of objects) - Optional - A list of product variants. Each variant can include: - **price** (number) - Required - The price of the variant. - **weight** (integer) - Required - The weight of the variant in grams. - **sku** (string) - Optional - The Stock Keeping Unit for the variant. - **option1_value** (string) - Optional - The value for the first option. - **option2_value** (string) - Optional - The value for the second option. - **option3_value** (string) - Optional - The value for the third option. - **rich_description** (string) - Optional - A rich text description for the variant. - **images** (array of strings) - Optional - A list of image URLs for the variant. - **self_file_urls** (array of strings) - Optional - A list of self-file URLs for the variant. - **is_checked** (boolean) - Optional - Indicates if the variant is sellable. - **metadata** (object) - Optional - Additional metadata for the variant. ### Request Example ```json { "name": "T-Shirt", "item_type": "physical", "description": "A comfortable cotton t-shirt.", "tags": ["clothing", "apparel"], "variants": [ { "price": 19.99, "weight": 200, "sku": "TSHIRT-RED-L", "option1_value": "Red", "option2_value": "Large", "images": ["http://example.com/image1.jpg"], "is_checked": true } ] } ``` ### Response #### Success Response (200) - **code** (integer) - The HTTP status code. - **data** (object) - Contains business and product data. - **business** (object) - Information about the associated business. - **account_holder** (string) - Name of the account holder. - **email** (string) - Email address of the business. - **id** (integer) - Business ID. - **is_banned** (boolean) - Indicates if the business is banned. - **logo** (string) - URL to the business logo. - **unique_id** (string) - Unique identifier for the business. - **username** (string) - Username of the business. #### Response Example ```json { "code": 200, "data": { "business": { "account_holder": "John Doe", "email": "john.doe@example.com", "id": 123, "is_banned": false, "logo": "http://example.com/logo.png", "unique_id": "biz-abc-123", "username": "johndoe" } } } ``` ``` -------------------------------- ### Get Business Information (cURL) Source: https://developers.scalev.id/reference/businesses Example cURL request to retrieve business information from the Scale.id API. This requires an 'accept' header set to 'application/json'. ```Shell curl --request GET \ --url https://api.scalev.id/v2/businesses/me \ --header 'accept: application/json' ``` -------------------------------- ### POST /v2/products Source: https://developers.scalev.id/reference/scalevapiwebproductcontrollercreate Creates a new product with the provided data. This endpoint allows for the creation of physical, digital, or course-based products, with options for variants and inventory management. ```APIDOC ## POST /v2/products ### Description Creates a new product with the provided data. This endpoint allows for the creation of physical, digital, or course-based products, with options for variants and inventory management. ### Method POST ### Endpoint /v2/products ### Parameters #### Request Body - **name** (string) - Required - Product Name - **public_name** (string) - Required - Product Public Name - **description** (string) - Optional - Description - **rich_description** (string) - Optional - Rich Description - **slug** (string) - Optional - Product Slug - **item_type** (string) - Required - Type of the product item. Enum: ["physical", "digital", "course"] - **taxonomy_id** (integer) - Optional - Taxonomy ID - **is_inventory** (boolean) - Optional - Is Inventory - **is_product_sharing** (boolean) - Optional - Is Product Sharing - **is_multiple** (boolean) - Optional - Is Multiple - **meta_thumbnail** (string) - Optional - Meta Thumbnail (uri format) - **option1_name** (string) - Optional - Option 1 Name - **option2_name** (string) - Optional - Option 2 Name - **option3_name** (string) - Optional - Option 3 Name - **variants** (array) - Optional - List of variants associated with the product - **cogs** (number) - Optional - Cost of Goods Sold - **description** (string) - Optional - Variant Description ### Request Example ```json { "name": "Example Product", "public_name": "Example Product", "description": "This is a sample product description.", "item_type": "physical", "taxonomy_id": 1, "is_inventory": true, "variants": [ { "cogs": 10.50, "description": "Variant 1" } ] } ``` ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the created product. - **name** (string) - The name of the product. - **public_name** (string) - The public-facing name of the product. - **description** (string) - The description of the product. - **rich_description** (string) - The rich description of the product. - **slug** (string) - The slug for the product. - **item_type** (string) - The type of the product item. - **taxonomy_id** (integer) - The ID of the product's taxonomy. - **is_inventory** (boolean) - Indicates if inventory tracking is enabled for the product. - **is_product_sharing** (boolean) - Indicates if the product is shared. - **is_multiple** (boolean) - Indicates if the product is multiple. - **meta_thumbnail** (string) - The URI for the product's meta thumbnail. - **option1_name** (string) - The name of the first option. - **option2_name** (string) - The name of the second option. - **option3_name** (string) - The name of the third option. - **variants** (array) - A list of variants associated with the product. - **id** (integer) - The unique identifier for the variant. - **cogs** (number) - The cost of goods sold for the variant. - **description** (string) - The description of the variant. #### Response Example ```json { "id": 123, "name": "Example Product", "public_name": "Example Product", "description": "This is a sample product description.", "rich_description": "

Detailed description here.

", "slug": "example-product", "item_type": "physical", "taxonomy_id": 1, "is_inventory": true, "is_product_sharing": false, "is_multiple": false, "meta_thumbnail": "https://example.com/thumbnail.jpg", "option1_name": "Size", "option2_name": "Color", "option3_name": null, "variants": [ { "id": 456, "cogs": 10.50, "description": "Red, Small" } ] } ``` ``` -------------------------------- ### Get Shipping Costs using Node.js Source: https://developers.scalev.id/reference/shipping-costs This Node.js example shows how to make a POST request to the Scale.id API to get shipping cost estimates. It utilizes the 'axios' library for HTTP requests and includes the required body parameters. ```javascript const axios = require('axios'); const options = { method: 'POST', url: 'https://api.scalev.id/v2/shipping-costs', headers: { 'accept': 'application/json', 'content-type': 'application/json' }, data: { courier_codes: ['courier1', 'courier2'], location_id: 123, postal_code: '90210', warehouse_id: 456, weight: 500 } }; axios.request(options).then(function (response) { console.log(response.data); }).catch(function (error) { console.error(error); }); ``` -------------------------------- ### GET /websites/{website_id}/stores/{store_id} Source: https://developers.scalev.id/reference/scalevapiwebordercontrollerupdate_customer Retrieves the configuration details for a specific store. ```APIDOC ## GET /websites/{website_id}/stores/{store_id} ### Description Retrieves the configuration details for a specific store, including its name, active status, and various operational settings. ### Method GET ### Endpoint `/websites/{website_id}/stores/{store_id}` ### Parameters #### Path Parameters - **website_id** (integer) - Required - The ID of the website. - **store_id** (integer) - Required - The ID of the store. ### Response #### Success Response (200) - **id** (integer) - Store ID. - **name** (string) - Name of the store. - **is_active** (boolean) - Is the store active? - **is_auto_expire** (boolean) - Is auto-expire enabled? - **is_discount_editable** (boolean) - Is discount editable? - **is_dropshipping_allowed** (boolean) - Is dropshipping allowed in this store? - **is_moota_enabled** (boolean) - Is Moota integration enabled for this store? - **is_postal_code** (boolean) - Is postal code required for orders? - **is_transferproof_required** (boolean) - Is transfer proof required for orders in this store? - **is_unique_code** (boolean) - Is unique code required for orders? - **is_use_waba** (boolean) - Is WABA integration enabled? - **max_unique_code_amount** (integer) - Maximum amount for unique code orders. - **non_cod_purchase_triggers** (array of strings) - Non-COD purchase triggers. Possible values: `public_upload`, `internal_upload`, `confirmed`, `shipped`, `completed`. - **other_income_name** (string) - Name of the other income. - **postal_code_requirement** (string) - Postal code requirement options. Possible values: `autofill`, `manual`. - **dynamic_other_income_epayment_default_amount** (float) - Default amount for dynamic e-payment income. - **dynamic_other_income_epayment_default_percentage** (float) - Default percentage for dynamic e-payment income. - **dynamic_other_income_epayment_type** (string) - Type of amount (fixed or percentage). Possible values: `fixed`, `percentage`. - **fixed_auto_other_income** (boolean) - Is fixed auto other income enabled? #### Response Example ```json { "id": 123, "name": "Example Store", "is_active": true, "is_auto_expire": false, "is_discount_editable": true, "is_dropshipping_allowed": true, "is_moota_enabled": false, "is_postal_code": true, "is_transferproof_required": false, "is_unique_code": false, "is_use_waba": true, "max_unique_code_amount": 1000, "non_cod_purchase_triggers": [ "confirmed", "shipped" ], "other_income_name": "Commission", "postal_code_requirement": "autofill", "dynamic_other_income_epayment_default_amount": 50.0, "dynamic_other_income_epayment_default_percentage": 5.0, "dynamic_other_income_epayment_type": "percentage", "fixed_auto_other_income": false } ``` ``` -------------------------------- ### List Locations Ruby Example Source: https://developers.scalev.id/reference/locations Example code in Ruby to fetch a list of locations from the Scale.id API. This snippet demonstrates making a GET request using the 'net/http' library. ```ruby require 'net/http' require 'uri' uri = URI.parse('https://api.scalev.id/v2/locations') response = Net::HTTP.get_response(uri) puts response.body ``` -------------------------------- ### List Locations Node.js Example Source: https://developers.scalev.id/reference/locations Example code in Node.js to fetch a list of locations from the Scale.id API. This snippet demonstrates making a GET request and handling the JSON response. ```javascript const fetch = require('node-fetch'); const url = 'https://api.scalev.id/v2/locations'; fetch(url, { method: 'GET', headers: { 'accept': 'application/json' } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error(error)); ``` -------------------------------- ### GET /products Source: https://developers.scalev.id/reference/scalevapiwebproductcontrollerindex Retrieves a list of available products. This endpoint is secured and requires authentication. ```APIDOC ## GET /products ### Description Retrieves a list of available products. This endpoint is secured and requires authentication. ### Method GET ### Endpoint /products ### Parameters #### Query Parameters (No query parameters defined in the provided schema) #### Request Body (No request body defined for this endpoint) ### Request Example (No request example provided in the schema) ### Response #### Success Response (200) - **products** (array) - A list of product objects. - **id** (string) - The unique identifier for the product. - **name** (string) - The name of the product. - **description** (string) - A detailed description of the product. - **price** (number) - The price of the product. - **currency** (string) - The currency of the product price. #### Response Example ```json { "products": [ { "id": "prod_123", "name": "Example Product", "description": "This is a sample product.", "price": 19.99, "currency": "USD" } ] } ``` #### Error Responses - **401 Unauthorized** - **code** (integer) - The HTTP status code (401). - **status** (string) - The status message (e.g., "Unauthorized"). - **message** (string) - A description of the error. - **403 Forbidden** - **code** (integer) - The HTTP status code (403). - **status** (string) - The status message (e.g., "Forbidden"). - **404 Not Found** - **code** (integer) - The HTTP status code (404). - **status** (string) - The status message (e.g., "Not Found"). - **error** (string) - A description of the error. ``` -------------------------------- ### List Locations PHP Example Source: https://developers.scalev.id/reference/locations Example code in PHP to fetch a list of locations from the Scale.id API. This snippet demonstrates using cURL to make a GET request and retrieve the JSON response. ```php ``` -------------------------------- ### GET /websites/{website_id}/developers/scale/{variant_id}/files Source: https://developers.scalev.id/reference/scalevapiwebproductcontrollerindex_digital_product_files Retrieves a paginated list of digital product files for a given website variant. ```APIDOC ## GET /websites/{website_id}/developers/scale/{variant_id}/files ### Description Retrieves a paginated list of digital product files for a specific variant of a website. ### Method GET ### Endpoint /websites/{website_id}/developers/scale/{variant_id}/files ### Parameters #### Path Parameters - **website_id** (string) - Required - The unique identifier for the website. - **variant_id** (string) - Required - The unique identifier for the variant of the digital product. #### Query Parameters - **page** (integer) - Optional - The page number for pagination. Defaults to 1. - **limit** (integer) - Optional - The number of items to return per page. Defaults to 20. ### Request Example ``` GET /websites/123/developers/scale/abc/files?page=1&limit=10 ``` ### Response #### Success Response (200) - **files** (array) - A list of digital product files. - **file_id** (string) - The unique identifier for the file. - **file_name** (string) - The name of the file. - **file_type** (string) - The type of the file (e.g., 'image/jpeg', 'application/pdf'). - **file_url** (string) - The URL to access the file. - **uploaded_at** (string) - The timestamp when the file was uploaded. - **pagination** (object) - Pagination details. - **current_page** (integer) - The current page number. - **total_pages** (integer) - The total number of pages. - **total_items** (integer) - The total number of items. #### Response Example ```json { "files": [ { "file_id": "file_001", "file_name": "product_image.jpg", "file_type": "image/jpeg", "file_url": "https://example.com/files/product_image.jpg", "uploaded_at": "2023-10-27T10:00:00Z" } ], "pagination": { "current_page": 1, "total_pages": 5, "total_items": 95 } } ``` ``` -------------------------------- ### List Locations Python Example Source: https://developers.scalev.id/reference/locations Example code in Python to fetch a list of locations from the Scale.id API. This snippet demonstrates using the 'requests' library to make a GET request and handle the JSON response. ```python import requests url = 'https://api.scalev.id/v2/locations' headers = { 'accept': 'application/json' } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Create Store cURL Request Source: https://developers.scalev.id/reference/stores Example of how to create a store using a cURL request. This command sends a POST request to the Scale.id API endpoint with necessary headers. ```shell curl --request POST \ --url https://api.scalev.id/v2/stores \ --header 'accept: application/json' \ --header 'content-type: application/json' ``` -------------------------------- ### Get Shipping Costs using Python Source: https://developers.scalev.id/reference/shipping-costs This Python example shows how to request shipping cost estimates from the Scale.id API. It uses the 'requests' library to send a POST request with the required JSON payload. ```python import requests url = "https://api.scalev.id/v2/shipping-costs" payload = { "courier_codes": [ "courier1", "courier2" ], "location_id": 123, "postal_code": "90210", "warehouse_id": 456, "weight": 500 } headers = { 'accept': 'application/json', 'content-type': 'application/json' } response = requests.post(url, json=payload, headers=headers) print(response.text) ```