### Install Theme Dependencies and Preview Source: https://docs.salla.dev/421878m0 Navigate to your theme directory, install project dependencies, and start the local development server for live previewing. Ensure you have administrative access for installation. ```shell > cd theme_folder_name > npm install > salla theme preview ``` -------------------------------- ### Run Development Environment Source: https://docs.salla.dev/1724504m0 Start the development server for the store events tracker and open the example HTML page for testing. ```bash pnpm dev ``` -------------------------------- ### Embedded SDK - Getting Started Source: https://docs.salla.dev/llms.txt Guide through the initial steps required to build and integrate your third-party application into the Salla Merchant Dashboard. ```APIDOC ## Embedded SDK Getting Started ### Description Welcome to Salla Embedded App SDK. This section will guide you through the initial steps required to build and integrate your third-party application into the Salla Merchant Dashboard. ### Method Not specified ### Endpoint Not specified ### Parameters Not specified ### Request Example Not specified ### Response #### Success Response (200) Not specified #### Response Example Not specified ``` -------------------------------- ### GET /products/{product_id}/size-guide Source: https://docs.salla.dev/422651m0 Fetches the size guide for a specific product using its unique identifier. ```APIDOC ## GET /products/{product_id}/size-guide ### Description Fetches the size guide for a specific product in an online store. ### Method GET ### Endpoint /products/{product_id}/size-guide ### Parameters #### Path Parameters - **product_id** (integer) - Required - The ID of the product for which the size guide is being fetched. ### Usage ```js salla.product.getSizeGuides(12345) .then(response => { console.log(response); }) .catch(error => { console.error(error); }); ``` ### Events - **onSizeGuideFetched**: Triggered when the size guide is retrieved successfully. - **onSizeGuideFetchFailed**: Triggered when an error occurs during the retrieval process. ``` -------------------------------- ### Install Salla CLI Source: https://docs.salla.dev/422761m0 Installs the Salla CLI globally on the system. ```shell npm install -g @salla.sa/cli ``` -------------------------------- ### Product Size Guides Source: https://docs.salla.dev/6965781e0 Retrieves a list of configured size guides for products. ```APIDOC ## GET /products/size-guides ### Description Retrieves all size guides associated with the store products. ### Response #### Success Response (200) - **status** (number) - HTTP status code - **success** (boolean) - Success flag - **data** (array) - List of size guide objects #### Response Example { "status": 200, "success": true, "data": [ { "id": 1298199463, "name": "Size 4", "description": "test size 4", "type": 1, "enablec": false, "brands": [2079537577], "translations": { "ar": { "name": "Size 4", "description": "test size 4" } } } ] } ``` -------------------------------- ### Success Response Example Source: https://docs.salla.dev/1964303m0 Example of a successful response from an onboarding handler function. ```APIDOC ## Success Response Example ### Description This response confirms that the onboarding step was completed successfully and allows the merchant to continue. ### Code Example ```javascript export default async (context: Onboarding): Promise => { console.log('event triggered'); return Resp.success().setData({}) }; ``` ### Usage Notes Returning `Resp.success()` allows the onboarding process to continue. ``` -------------------------------- ### Developer Portal - Get Started Source: https://docs.salla.dev/api-5394231 Getting started guide for the Developer Portal. ```APIDOC ## Developer Portal - Get Started ### Description Getting started guide for the Developer Portal. (No specific endpoints or details provided in the text) ``` -------------------------------- ### Clone Starter Kit and Install Dependencies Source: https://docs.salla.dev/1724504m0 Clone the Salla store events tracker starter kit and install its dependencies using pnpm. ```bash git clone https://github.com/SallaApp/store-events-tracker-starter-kit cd store-events-tracker-starter-kit pnpm install ``` -------------------------------- ### Complete Example: Load and Render Add-ons Source: https://docs.salla.dev/embedded-sdk/modules/checkout/add-ons This example demonstrates fetching add-ons and rendering them as cards. Each card includes a 'Buy' action that initiates the checkout process for the selected add-on. It handles potential errors during add-on loading. ```javascript import { embedded } from "@salla.sa/embedded-sdk"; async function loadAddons() { const result = await embedded.checkout.getAddons(); if (!result.success) { embedded.ui.toast.error("Could not load addons."); return; } // Render addon cards result.addons.forEach((addon) => { renderAddonCard({ name: addon.name, price: addon.price, onBuy: () => { embedded.checkout.create({ type: "addon", slug: addon.slug, }); }, }); }); } ``` -------------------------------- ### Embedded SDK - Installation Source: https://docs.salla.dev/llms.txt Integrate the Salla Embedded SDK with NPM, modern build tools, or a script tag. Explore initialization, token verification, and readiness setup with practical code examples. ```APIDOC ## Embedded SDK Installation ### Description Integrate the Salla Embedded SDK with NPM, modern build tools, or a script tag. Explore initialization, token verification, and readiness setup with practical code examples. ### Method Not specified ### Endpoint Not specified ### Parameters Not specified ### Request Example Not specified ### Response #### Success Response (200) Not specified #### Response Example Not specified ``` -------------------------------- ### App Installed Event Payload Source: https://docs.salla.dev/421413m0 Example JSON payload received when an app is successfully installed on a merchant store. ```json { "event": "app.installed", "merchant": 1234509876, "created_at": "2022-12-31 12:31:25", "data": { "id": 6789012345, "app_name": "Shipping app", "description": "App Description" "app_type": "app", "app_scopes": [ "settings.read", "customers.read_write", "orders.read_write", "carts.read", "branches.read_write", "categories.read_write", "brands.read_write", "products.read_write", "webhooks.read_write", "payments.read", "taxes.read_write", "specialoffers.read_write", "countries.read", "metadata.read_write", "offline_access" ], "installation_date": "2021-09-28 06:06:56", "store_type": "development" } } ``` -------------------------------- ### Implement Product Size Guide in HTML Source: https://docs.salla.dev/422721m0 Use the salla-product-size-guide component alongside a button that dispatches the open event with a specific product ID. ```html Show Size Guide ``` -------------------------------- ### Set store configuration via salla.init() Source: https://docs.salla.dev/422612m0 Initializes the SDK with store-specific settings during startup. ```js salla.init({ debug: true, store: { id: 123451234, url: "https://my_store.test/", name: "WOW store", settings: { auth: { email_allowed: false } } } }); ``` -------------------------------- ### Configure Installment Payment Options Source: https://docs.salla.dev/422707m0 If using the installment component outside of store pages, configure the available installment payment options using `salla.config.set`. This example enables Tamara, Tabby, and Spotii. ```js salla.config.set('store.settings.installments', { tamara_installment: true, tabby_installment: true, spotii_pay: true }) ``` -------------------------------- ### Run Theme Preview Source: https://docs.salla.dev/doc-422776?nav=01HNFTD5Y5ESFQS3P9MJ0721VM Use this command to start the theme preview. It will list available demo stores for selection and launch an interactive development environment. ```bash salla theme p ``` -------------------------------- ### GET /admin/v2/reservations Source: https://docs.salla.dev/api-5579097?nav=1 Retrieves a list of reservations filtered by start and end dates. ```APIDOC ## GET /admin/v2/reservations ### Description Retrieves a list of reservations for the admin dashboard within a specific date range. ### Method GET ### Endpoint https://api.salla.dev/admin/v2/reservations ### Parameters #### Query Parameters - **start** (string) - Required - The start date for the reservation range (YYYY-MM-DD). - **end** (string) - Required - The end date for the reservation range (YYYY-MM-DD). ### Request Example curl --location --request GET 'https://api.salla.dev/admin/v2/reservations?start=2024-01-01&end=2024-01-31' \ --header 'Authorization: Bearer ' ### Response #### Success Response (200) - **status** (integer) - HTTP status code. - **success** (boolean) - Indicates if the request was successful. - **data** (array) - List of reservation objects. #### Response Example { "status": 200, "success": true, "data": [ { "id": 1473353380, "title": "تعليم القيادة (2)", "type": "day", "start": "2024-02-16T00:00:00", "end": "2024-02-16T:23:59:59", "seats_count": 2, "url": "https://dashboard.test/orders/order/yRdxQ9m28rEbamllyGd1Xz5KoDJZgkAP", "created_at": "2024-02-13 13:48:33" } ] } ``` -------------------------------- ### GET /admin/v2/settings Source: https://docs.salla.dev/api-6965777?nav=01J1Y9KTRRDA57Q8ZSW95TTVDB Retrieves settings for a specified entity. The example shows how to fetch order-related settings. ```APIDOC ## GET /admin/v2/settings ### Description Retrieves settings for a specified entity. This endpoint is useful for fetching configuration details related to various aspects of the Salla platform, such as orders, products, or reports. ### Method GET ### Endpoint /admin/v2/settings ### Query Parameters - **entity** (string) - Required - The entity for which to retrieve settings (e.g., 'orders', 'products', 'reports'). ### Request Example ```curl curl --location --request GET 'https://api.salla.dev/admin/v2/settings?entity=orders' \ --header 'Authorization: Bearer ' ``` ### Response #### Success Response (200) - **status** (integer) - The HTTP status code of the response. - **success** (boolean) - Indicates if the request was successful. - **data** (array) - An array of setting objects. - **slug** (string) - The unique identifier for the setting. - **type** (string) - The data type of the setting (e.g., 'form', 'boolean', 'string', 'dropdown'). - **value** (any) - The current value of the setting. Can be null, boolean, string, or an array depending on the type. #### Response Example ```json { "status": 200, "success": true, "data": [ { "slug": "orders.receive_orders", "type": "form", "value": null }, { "slug": "orders.receiving_times", "type": "form", "value": null }, { "slug": "orders.order_notes", "type": "form", "value": null }, { "slug": "orders.cancel_order", "type": "form", "value": null }, { "slug": "orders.auto_complete", "type": "form", "value": null }, { "slug": "orders.auto_return_stock", "type": "form", "value": null }, { "slug": "orders.disable_bank_transfer_payment_period", "type": "boolean", "value": false }, { "slug": "orders.shipping_indicator", "type": "boolean", "value": true }, { "slug": "orders.price_quote", "type": "boolean", "value": false }, { "slug": "orders.reorder", "type": "boolean", "value": true }, { "slug": "orders.agreement", "type": "form", "value": null }, { "slug": "orders.complete_customization", "type": "form", "value": null }, { "slug": "orders.invoices_customization", "type": "form", "value": null }, { "slug": "orders.shipping_policy_deduction", "type": "form", "value": null }, { "slug": "orders.minimum_amount", "type": "string", "value": "123.23" }, { "slug": "orders.attache_note_notify_status", "type": "boolean", "value": true }, { "slug": "orders.status_notifications", "type": "dropdown", "value": [ "email" ] }, { "slug": "orders.digital_products_notify", "type": "dropdown", "value": [ "email", "sms" ] } ] } ``` #### Error Responses - **401** Unauthorized: Indicates that the request lacks valid authentication credentials. - **422** Unprocessable Entity: Indicates that the request could not be processed due to semantic errors in the request. ``` -------------------------------- ### Initialize Theme Creation Source: https://docs.salla.dev/422775m0 Use this command to start the interactive process of creating or importing a theme via the Salla CLI. ```shell salla theme create # Alias command for create salla theme c ``` -------------------------------- ### GET /reservations Source: https://docs.salla.dev/5579097e0 Retrieves all current order reservations based on the provided start and end dates. ```APIDOC ## GET /reservations ### Description This endpoint allows you to retrieve all the current order reservations. Requires `orders.read` scope. ### Method GET ### Endpoint /reservations ### Parameters #### Query Parameters - **start** (string, date) - Required - Reservation start date - **end** (string, date) - Required - Reservation end date ### Request Example GET /reservations?start=2024-01-01&end=2024-01-31 ### Response #### Success Response (200) - **status** (integer) - Response status code - **success** (string) - Response flag - **data** (array) - List of reservations #### Response Example { "status": 200, "success": true, "data": [ { "id": 1473353380, "title": "تعليم القيادة (2)", "type": "day", "start": "2024-02-16T00:00:00", "end": "2024-02-16T23:59:59", "seats_count": 2, "url": "https://dashboard.test/orders/order/yRdxQ9m28rEbamllyGd1Xz5KoDJZgkAP", "created_at": "2024-02-13 13:48:33" } ] } ``` -------------------------------- ### Page URL Example Source: https://docs.salla.dev/422561m0 This example shows the typical URL structure for a single product page on a Salla store. ```shell └── src ├── views ├── pages | ├── product | ... | ├── single.twig | ... ... ``` -------------------------------- ### Product Size Guide Usage Source: https://docs.salla.dev/422721m0 This snippet shows how to use the `` to trigger the Product Size Guide and how to include the `` component in your HTML. ```APIDOC ## Basic Product Size Guide Integration ### Description This example demonstrates how to add a button that, when clicked, opens the Product Size Guide modal for a specific product. It also includes the necessary `` tag to render the modal. ### Method HTML with JavaScript event dispatch ### Endpoint N/A (Client-side component) ### Parameters N/A ### Request Example ```html Show Size Guide ``` ### Response N/A (Client-side interaction) ``` -------------------------------- ### Initialize SDK and Listen for Ready State - JavaScript Source: https://docs.salla.dev/embedded-sdk/authentication Initialize the SDK to establish a postMessage bridge with the Salla Dashboard and listen for the initialization event to access authenticated context like layout information. ```javascript embedded.onInit((state) => { console.log("Authenticated context:", state.layout); }); ``` -------------------------------- ### OpenAPI Specification for List Store Scopes Source: https://docs.salla.dev/15104922e0 Defines the structure and example response for the GET /scopes endpoint. ```yaml openapi: 3.0.1 info: title: '' description: '' version: 1.0.0 paths: /scopes: get: summary: List Store Scopes deprecated: false description: >- This endpoint allows you to list store scopes for multi-country functionality. `products.read`- Products Read Only operationId: List-Store-Scopes tags: - Default module/Merchant API/APIs/Store Scopes - Store Scopes parameters: [] responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/list_store_scopes_response_body' example: status: 200 success: true data: - id: 1473353380 name: welcome countries: - id: 1473353380 name: Saudi Arabia code: SA primary_currency: code: SAR name: Saudi Riyal symbol: SAR default_language: id: 1 name: العربية status: enabled rtl: true flag: https://assets.salla.sa/images/flags/ar.svg iso_code: ar country_code: sa sort_order: 0 is_default: true auto_translate: false is_default: true domain: newxDom.mozdstore.com url: https://mozdstore.com/en/?scope=1473353380 status: '1' store_id: 67593 theme_customization_id: null created_at: 1744549302 updated_at: 1765889285 branches: - id: 1255900674 name: Silsala Warehouse - Riyadh. - Ahmed status: active is_default: true priority: 0 - id: 1689312780 name: Dubai Branch status: active is_default: false priority: 1 - id: 297123410 name: UAE branch status: active is_default: false priority: 2 - id: 1429885875 name: الصحافة - الرياض status: active is_default: false priority: 3 supported_languages: - id: 2 name: English status: enabled rtl: false flag: https://assets.salla.sa/images/flags/en.svg iso_code: en country_code: gb sort_order: 0 is_default: false auto_translate: false - id: 1 name: العربية status: enabled rtl: true flag: https://assets.salla.sa/images/flags/ar.svg iso_code: ar country_code: sa sort_order: 0 is_default: true auto_translate: false - id: 289292369 name: سوق الامارات1 countries: - id: 566146469 name: United Arab Emirates code: AE primary_currency: code: AED name: UAE Dirham symbol: AED default_language: id: 1 name: العربية status: enabled rtl: true flag: https://assets.salla.sa/images/flags/ar.svg iso_code: ar country_code: sa sort_order: 0 is_default: true auto_translate: false is_default: false domain: mozdstore.com url: https://mozdstore.com/en/?scope=289292369 status: '0' store_id: 67593 theme_customization_id: null created_at: 1759937004 updated_at: 1766303973 branches: ``` -------------------------------- ### Complete Checkout Implementation Source: https://docs.salla.dev/embedded-sdk/modules/checkout/create A full example showing the recommended pattern of registering the result listener before initiating the checkout. ```javascript import { embedded } from "@salla.sa/embedded-sdk"; // 1. Listen for results first embedded.checkout.onResult((result) => { if (result.success) { embedded.ui.toast.success("Purchase complete!"); console.log("Order ID:", result.order_id); } else { embedded.ui.toast.error(result.error?.message || "Checkout failed"); } }); // 2. Initiate checkout embedded.checkout.create( { type: "addon", slug: "premium-analytics" }, { context: { source: "pricing-page" } } ); ``` -------------------------------- ### Get Orders Request Example Source: https://docs.salla.dev/api-5394146?nav=1 Use this cURL command to retrieve orders from the Salla API. Ensure you replace `` with your actual bearer token. ```Shell curl --location --request GET 'https://api.salla.dev/admin/v2/orders?keyword=&payment_method=&status=&from_date=&to_date=&country=&city=&product=&branch=&tags=&expanded=&page=&reference_id=&coupon=&customer_id=&shipping_app_id=&source=&sort_by=&accounting_services=&unread=&assign_employee=&selling_channel=&created_by' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Set store configuration Source: https://docs.salla.dev/doc-422612?nav=01HNFTDZPB31Y2E120R84YXKCX Examples of configuring store-specific settings using both the initialization method and the configuration setter. ```javascript salla.init({ debug: true, store: { id: 123451234, url: "https://my_store.test/", name: "WOW store", settings: { auth: { email_allowed: false } } } }); ``` ```javascript salla.config.set({ debug: true, store: { id: 123451234, url: "https://my_store.test/", name: "WOW store" } }); ``` -------------------------------- ### OpenAPI Specification for List Taxes Endpoint Source: https://docs.salla.dev/5394141e0 Defines the GET /taxes endpoint, including security requirements, pagination parameters, and success/error response examples. ```yaml openapi: 3.0.1 info: title: '' description: '' version: 1.0.0 paths: /taxes: get: summary: List Taxes deprecated: false description: |- This endpoint allows you to list all available taxes for your store. `taxes.read`- Taxes Read Only operationId: List-Taxes tags: - Default module/Merchant API/APIs/Taxes - Taxes parameters: - name: page in: query description: The Pagination page number required: false schema: type: integer responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/taxes_response_body' example: status: 200 success: true data: - id: 2087347200 tax: 5 status: active country: Bahrain pagination: count: 1 total: 1 perPage: 15 currentPage: 1 totalPages: 1 links: [] headers: {} x-apidog-name: Success '401': description: '' content: application/json: schema: $ref: '#/components/schemas/error_unauthorized_401' example: status: 401 success: false error: code: Unauthorized message: >- The access token should have access to one of those scopes: taxes.read headers: {} x-apidog-name: Unauthorized security: - bearer: [] x-salla-php-method-name: list x-salla-php-return-type: Tax x-salla-php-return-base-type: array x-apidog-folder: Default module/Merchant API/APIs/Taxes x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/451700/apis/api-5394141-run components: schemas: taxes_response_body: type: object properties: status: type: number description: >- Response status code, a numeric or alphanumeric identifier used to convey the outcome or status of a request, operation, or transaction in various systems and applications, typically indicating whether the action was successful, encountered an error, or resulted in a specific condition. success: type: boolean description: >- Response flag, boolean indicator used to signal a particular condition or state in the response of a system or application, often representing the presence or absence of certain conditions or outcomes. data: type: array x-stoplight: id: pmmg1k2ottpau items: $ref: '#/components/schemas/Tax' pagination: $ref: '#/components/schemas/Pagination' x-apidog-orders: - status - success - data - pagination x-apidog-ignore-properties: [] x-apidog-folder: '' Pagination: type: object title: Pagination description: >- For a better response behavior as well as maintain the best security level, All retrieving API endpoints use a mechanism to retrieve data in chunks called pagination. Pagination working by return only a specific number of records in each response, and through passing the page number you can navigate the different pages. properties: count: type: number description: Number of returned results. total: type: number description: Number of all results. perPage: type: number description: Number of results per page. maximum: 65 currentPage: type: number description: Number of current page. totalPages: type: number description: Number of total pages. links: type: object properties: next: type: string description: Next Page previous: type: string description: Previous Page x-apidog-orders: - next - previous description: Array of linkes to next and previous pages. required: - next - previous x-apidog-ignore-properties: [] x-apidog-orders: - count - total - perPage - currentPage - totalPages - links required: ``` -------------------------------- ### Track User Sign-Up Implementation Source: https://docs.salla.dev/1804481m0 Example implementation for handling the user sign-up event using the ecommerce-events-base package. ```typescript import { SignedUpPayload, EcommerceEvents, } from "@salla.sa/ecommerce-events-base"; export const eventName = EcommerceEvents.SIGNED_UP; export default (payload: SignedUpPayload): void => { console.log("Signed UP Event:", payload); // Add your custom tracking logic here }; ``` -------------------------------- ### JMESPath Index Expression Source: https://docs.salla.dev/1644018m0 Select a specific element from a list using index expressions, which start from 0. This example demonstrates accessing a nested element within a list. ```json "a.b.c[0].d[1][0]" ``` -------------------------------- ### Example App Settings Object Source: https://docs.salla.dev/1726814m0 Illustrates a typical structure for the `settings` object within an App Function's context, showing common configuration parameters like API keys and URLs. ```javascript { apiKey: "sk_live_abc123", webhookUrl: "https://api.example.com/webhook", syncEnabled: true, notificationEmail: "merchant@example.com", customField: "custom_value" } ``` -------------------------------- ### Preview Theme with Salla CLI Source: https://docs.salla.dev/doc-422776?nav=01HNFTD5Y5ESFQS3P9MJ0721VM Use this command to preview your theme in live mode. Ensure you are in the theme's root folder and logged into your Salla Partners Account and GitHub Account. ```bash > cd theme_folder_name > salla theme preview ``` -------------------------------- ### List Product Quantities OpenAPI Specification Source: https://docs.salla.dev/api-9612796 This OpenAPI specification defines the GET endpoint for listing product quantities. It includes details on parameters, responses, and an example of the response body. ```yaml openapi: 3.0.1 info: title: '' description: '' version: 1.0.0 paths: /products/quantities: get: summary: List Product Quantities deprecated: false description: |- This endpoint allows you to fetch a list of products quantities `products.read`- Products Read Only operationId: get-product-inventory tags: - Default module/Merchant API/APIs/Product Quantity - Product Quantity parameters: - name: branch in: query description: >- Fetch products included in specific branch based on the branch ID. Get a list of Branch IDs from [here]() required: false example: branch=43957834 schema: type: integer responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/productQuantities_response_body' example: status: 200 success: true data: - id: 532443002 name: T-Shirt Blue 2 image: >- https://salla-dev.s3.eu-central-1.amazonaws.comEVxp/ogEEayXo8KuuSUDMiRgxDCFPqr0IGvQsSFVciQyL.png sku_id: null sku: 250-SS quantity: 40 sold_quantity: 18 price: 127 unlimited_quantity: false variant: null - id: 357354565 name: service image: >- https://salla-dev.s3.eu-central-1.amazonaws.comEVxp/7yUJt9GZ80BsWgjnrmRQvItuENkSPlzfTVcgpBgu.png sku_id: 1141551363 sku: null quantity: 0 sold_quantity: 0 price: '127.00' unlimited_quantity: true variant: Fast - red - id: 357354565 name: service image: >- https://salla-dev.s3.eu-central-1.amazonaws.comEVxp/7yUJt9GZ80BsWgjnrmRQvItuENkSPlzfTVcgpBgu.png sku_id: 299356172 sku: null quantity: 0 sold_quantity: 0 price: '127.00' unlimited_quantity: true variant: Slow - white - id: 1730800454 name: SSD image: >- https://salla-dev.s3.eu-central-1.amazonaws.comEVxp/eIecMl7JsqYL29zVfYEwCzokxdYBAdKISlpYKX6M.jpg sku_id: 442024243 sku: sam-ssd-128g quantity: 127 sold_quantity: 340 price: '150.00' unlimited_quantity: false variant: 128G - black - id: 1730800454 name: SSD image: >- https://salla-dev.s3.eu-central-1.amazonaws.comEVxp/eIecMl7JsqYL29zVfYEwCzokxdYBAdKISlpYKX6M.jpg sku_id: 1948639292 sku: sam-ssd-256g quantity: 254 sold_quantity: 340 price: '150.00' unlimited_quantity: false variant: 256G - gold - id: 780490562 name: عطر قريس 100 مل image: >- https://salla-dev.s3.eu-central-1.amazonaws.comEVxp/MgB2A3gXUUAWFMt6cIkWUDN3zhSEoCQdzlkd76Ig.jpg sku_id: null sku: '123123123' quantity: 123 sold_quantity: 450 price: 30 unlimited_quantity: false variant: null - id: 2019718723 name: عطر روشيل 100 مل image: >- https://salla-dev.s3.eu-central-1.amazonaws.comEVxp/WTJWkpX7Jlm1BCoWEDqQSeo35fhlsxTEB4oTXDww.png sku_id: null sku: '4005900764911' quantity: 412 sold_quantity: 187 price: 30 unlimited_quantity: true - id: 1246270796 name: S21 image: >- https://salla-dev.s3.eu-central-1.amazonaws.comEVxp/y2t0iITNahNxMoZKnKvDxjjL2xJPXZhkk6PuPCFX.png sku_id: null sku: S21-1200 quantity: 0 sold_quantity: 26 price: 127 unlimited_quantity: true ``` -------------------------------- ### List Order Items OpenAPI Specification Source: https://docs.salla.dev/api-5565737 This YAML snippet defines the GET endpoint for listing order items. It includes parameters, responses, and example payloads for different scenarios. ```yaml openapi: 3.0.1 info: title: '' description: '' version: 1.0.0 paths: /orders/items: get: summary: List Order Items deprecated: false description: >- This endpoint allows you to retrieve the complete details of specific Order items by passing the `order_id` as query parameter. :::danger[Deprecation Notice] The variables, `codes` and `files`, are deprecated. We recommend using instead the `data.urls.digital_content` variable. ::: `orders.read` - Orders Read Only operationId: get-orders-items tags: - Default module/Merchant API/APIs/Order Items - Order Items parameters: - name: order_id in: query description: >- Order ID. List of Order ID can be found [here](https://docs.salla.dev/api-5394146) required: true example: 90828 schema: type: integer responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/orderItem_response_body' examples: '1': summary: Success | with Options value: status: 200 success: true data: - id: 365435777 name: SSD sku: sam-ssd-256g quantity: 1 currency: SAR weight: 0.51 weight_label: ٥١٠ جم amounts: price_without_tax: amount: 150 currency: SAR total_discount: amount: 0 currency: SAR tax: percent: '15.00' amount: amount: 22.5 currency: SAR total: amount: 150 currency: SAR notes: '' options: - id: 675638105 product_option_id: 1902643925 name: size type: radio value: id: 1090448197 name: 256G price: amount: 0 currency: SAR images: [] codes: [] files: [] reservations: [] '4': summary: Success | with Codes value: status: 200 success: true data: - id: 829577603 name: windows keys sku: '' quantity: 1 currency: SAR weight: 0 weight_label: null amounts: price_without_tax: amount: 100 currency: SAR total_discount: amount: 0 currency: SAR tax: percent: '15.00' amount: amount: 15 currency: SAR total: amount: 100 currency: SAR notes: '' options: [] images: [] codes: - code: sD21S status: sold files: [] product_reservations: [] headers: {} x-apidog-name: Success '401': description: '' content: application/json: schema: $ref: '#/components/schemas/error_unauthorized_401' example: status: 401 success: false error: code: Unauthorized message: >- The access token should have access to one of those scopes: orders.read headers: {} x-apidog-name: Unauthorized '404': description: '' ``` -------------------------------- ### Preview a Theme with CLI Options Source: https://docs.salla.dev/doc-422776?nav=01HNA8QHCPJTCY5VSEZ616JCAK Use this command to launch the theme preview environment with specific store, editor, and browser configurations. ```bash salla theme preview --store=sweet_store --with-editor --browser=chrome ``` -------------------------------- ### Basic List Tile Usage Source: https://docs.salla.dev/doc-422708?nav=01HNFTE06J4QC24T0D5BPRYKMD Demonstrates the basic structure for using the `` component. No specific setup or imports are required beyond including the web component. ```html List item title Optional subtitle Action Icon ``` -------------------------------- ### OpenAPI Specification for Product Option Value Details Source: https://docs.salla.dev/5394199e0 Defines the GET endpoint for retrieving product option value details, including parameters, scopes, and example response bodies. ```yaml openapi: 3.0.1 info: title: '' description: '' version: 1.0.0 paths: /products/options/values/{value}: get: summary: Product Option Value Details deprecated: false description: >- This endpoint allows you to return value details in specific option for a specific product by passing the `value` as a path parameter. `products.read`- Products Read Only operationId: Value-Details tags: - Default module/Merchant API/APIs/Product Option Values - Product Option Values parameters: - name: value in: path description: >- Unique identification number assigned to the Option Value. List of Product Option Value IDs can be found [here](https://docs.salla.dev/api-5394168). required: true example: 0 schema: type: integer responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/productValue_response_body' example: status: 200 success: true data: id: 667315336 name: salamaValue price: amount: 0 currency: SAR display_value: '' option_id: 1833119338 image_url: https://i.ibb.co/jyqRQfQ/avatar-male.webp hashed_display_value: '' skus: - id: 652911549 price: amount: 110 currency: SAR regular_price: amount: 234 currency: SAR sale_price: amount: 100 currency: SAR stock_quantity: 13 barcode: barcode-ABC sku: sku-variant-1551119600 related_option_values: - 667315336 - 322122678 - 569679762 - 1318371393 - id: 1966914519 price: amount: 9.9 currency: SAR regular_price: amount: 0 currency: SAR sale_price: amount: 100 currency: SAR stock_quantity: 20 barcode: '' sku: 23-TD23-32 related_option_values: - 667315336 - 322122678 - 1552401892 - 1318371393 - id: 1799056677 price: amount: 9.9 currency: SAR regular_price: amount: 0 currency: SAR sale_price: amount: 100 currency: SAR stock_quantity: 20 barcode: '' sku: 23-TD23-32 related_option_values: - 667315336 - 322122678 - 1209980149 - 1318371393 - id: 673658412 price: amount: 9.9 currency: SAR regular_price: amount: 0 currency: SAR sale_price: amount: 100 currency: SAR stock_quantity: 20 barcode: '' sku: 23-TD23-32 related_option_values: - 667315336 - 322122678 - 393917653 - 1318371393 headers: {} x-apidog-name: Success '401': description: '' content: application/json: schema: $ref: '#/components/schemas/error_unauthorized_401' example: status: 401 success: false error: code: Unauthorized message: >- The access token should have access to one of those scopes: products.read headers: {} x-apidog-name: Unauthorized '404': ``` -------------------------------- ### Get Product Price HTML Source: https://docs.salla.dev/422718m0 Generates the HTML for displaying a product's price, handling sale prices, starting prices, and regular prices based on product attributes. ```javascript getProductPrice() { let price = ''; if (this.product.is_on_sale) { price = `

${this.getPriceFormat(this.product.sale_price)}

${this.getPriceFormat(this.product?.regular_price)}
`; } else if (this.product.starting_price) { price = `

${this.startingPrice}

${this.getPriceFormat(this.product?.starting_price)}

` } else{ price = `

${this.getPriceFormat(this.product?.price)}

` } return price; } ``` -------------------------------- ### Fetch Product Size Guides Source: https://docs.salla.dev/doc-422651?nav=01HNFTDZPB31Y2E120R84YXKCX Call the `getSizeGuides()` method with the product ID to retrieve its size guide. Ensure the product ID is valid. ```javascript product.getSizeGuides(product_id) ``` -------------------------------- ### JMESPath Index Expression Example Source: https://docs.salla.dev/1644018m0?nav=01KJSXSAKYRX13Q43DPXX7N6EG Illustrates how to use index expressions in JMESPath to select a specific element from a list within a nested JSON structure. Indexing starts from 0. ```json {"a": {"b": {"c": [{"d": [0, [1, 2]]}, {"d": [3, 4]}]}}} ``` ```jmespath a.b.c[0].d[1][0] ```