### Dynamic Documentation Query Example Source: https://docs.ecwid.com/api-reference/rest-api/categories/category-images/upload-category-image-async.md This example shows how to query the documentation dynamically using an HTTP GET request. The `ask` parameter specifies the question, and the optional `goal` parameter provides context for the desired answer. ```http GET https://docs.ecwid.com/api-reference/rest-api/categories/category-images/upload-category-image-async.md?ask=&goal= ``` -------------------------------- ### Search Customers Request Example Source: https://docs.ecwid.com/api-reference/rest-api/customers/search-customers.md This example demonstrates a basic GET request to search for customers in a specific store. Ensure you have the 'read_customers' scope. ```http GET /api/v3/1003/customers HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### GET Request Example Source: https://docs.ecwid.com/api-reference/rest-api/orders/order-extra-fields/search-order-extra-fields.md Demonstrates how to make a GET request to retrieve order extra fields for a specific order. ```http GET /api/v3/1003/orders/JJ5HH/extraFields HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### HTTP Request Example Source: https://docs.ecwid.com/api-reference/rest-api/discounts/promotions/search-promotions.md Demonstrates a basic GET request to search for promotions. ```http GET /api/v3/1003/promotions HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### Query Documentation API Example Source: https://docs.ecwid.com/site-themes/develop-site-themes/templates.md Demonstrates how to query the documentation dynamically using an HTTP GET request with 'ask' and optional 'goal' query parameters. ```http GET https://docs.ecwid.com/site-themes/develop-site-themes/templates.md?ask=&goal= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.ecwid.com/api-reference/rest-api/products/product-images-and-videos/upload-gallery-product-image-async.md This example demonstrates how to query the documentation dynamically using a GET request with 'ask' and optional 'goal' query parameters. ```http GET https://docs.ecwid.com/api-reference/rest-api/products/product-images-and-videos/upload-gallery-product-image-async.md?ask=&goal= ``` -------------------------------- ### Query Documentation API Source: https://docs.ecwid.com/storefronts/manage-cart-and-checkout/fully-clear-the-cart.md This example demonstrates how to query the documentation dynamically using an HTTP GET request. It includes parameters for asking a question and specifying an end goal. ```http GET https://docs.ecwid.com/storefronts/manage-cart-and-checkout/fully-clear-the-cart.md?ask=&goal= ``` -------------------------------- ### Query Documentation Example Source: https://docs.ecwid.com/api-reference/rest-api/customers/customer-extra-fields/search-customer-extra-fields.md Illustrates how to query the documentation dynamically using the 'ask' and 'goal' query parameters. ```http GET https://docs.ecwid.com/api-reference/rest-api/customers/customer-extra-fields/search-customer-extra-fields.md?ask=&goal= ``` -------------------------------- ### Get Category Request Example Source: https://docs.ecwid.com/api-reference/rest-api/categories/get-category.md This example shows a basic HTTP GET request to retrieve a category by its ID. Ensure you include the Authorization header with your access token. ```http GET /api/v3/1003/categories/9691094 HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### Get Recurring Subscription Response Example Source: https://docs.ecwid.com/api-reference/rest-api/orders/recurring-subscriptions/get-recurring-subscription.md An example JSON response for a GET request to retrieve a recurring subscription. It includes details like status, dates, payment method, and order information. ```json { "subscriptionId": 66839, "customerId": 43343272, "status": "CANCELLED", "statusUpdated": "2021-07-23 21:17:26 +0000", "created": "2021-06-16 12:53:40 +0000", "cancelled": "2021-07-23 21:17:26 +0000", "nextCharge": "2021-07-16 12:53:40 +0000", "createTimestamp": 1623848020508, "updateTimestamp": 1627075046478, "chargeSettings": { "recurringInterval": "MONTH", "recurringIntervalCount": 1 }, "paymentMethod": { "creditCardMaskedNumber": "*1111", "creditCardBrand": "visa" }, "orderTemplate": { "id": "121", "email": "test@test.test", "additionalInfo": { "creditCard": "*1111 (12/2024)", "creditCardExpirationMonth": "12", "creditCardExpirationYear": "2024", "google_customer_id": "11111111.2222222222", "stripeCardId": "pm_1X2xXXX34XXxXxxXxxxXXXX", "stripeCreditCardBrand": "visa", "stripeCreditCardLast4Digit": "1111", "stripeCustomerId": "cus_XXXxxxX12xxxxX", "stripeFingerprint": "xxxxxXXX1X2xxxXX", "stripeLiveMode": "false" }, "orderComments": "", "paymentMethod": "Credit or debit card", "paymentModule": "Stripe", "total": 26.84, "subtotal": 12, "usdTotal": 32.545878290056045, "tax": 4.84, "customerTaxExempt": false, "customerTaxId": "", "customerTaxIdValid": false, "reversedTaxApplied": false, "items": [ { "id": 762397105, "productId": 11111111, "categoryId": 0, "price": 12, "productPrice": 12, "shipping": 10, "tax": 4.84, "fixedShippingRate": 0, "sku": "006789", "name": "Mug", "shortDescription": "This is the best product in the world!", "quantity": 1, "quantityInStock": 37, "weight": 0.2, "trackQuantity": false, "fixedShippingRateOnly": false, "digital": false, "productAvailable": true, "imageUrl": "https://d2j6dbq0eux0bg.cloudfront.net/images/11111/111111.jpg", "recurringChargeSettings": { "recurringInterval": "MONTH", "intervalCount": 1 }, "selectedOptions": [ { "name": "Color", "type": "CHOICE", "value": "White", "valuesArray": [ "White" ], "selections": [ { "selectionTitle": "White", "selectionModifier": 0, "selectionModifierType": "ABSOLUTE" } ] } ], "taxes": [ { "name": "VAT", "value": 22, "total": 4.84, "taxOnDiscountedSubtotal": 2.64, "taxOnShipping": 2.2, "includeInPrice": true } ], "dimensions": { "length": 21, "width": 21, "height": 21 } } ], "billingPerson": { "name": "First Last", "companyName": "", "street": "Otto-Braun-Straße", "city": "Berlin", "countryCode": "DE", "countryName": "Germany", "postalCode": "10178", "stateOrProvinceCode": "BE", "stateOrProvinceName": "Berlin", "phone": "+491625555012" }, "shippingPerson": { "name": "First Last", "companyName": "", "street": "Otto-Braun-Straße", "city": "Berlin", "countryCode": "DE", "countryName": "Germany", "postalCode": "10178", "stateOrProvinceCode": "BE", "stateOrProvinceName": "Berlin", "phone": "+11111111111" }, "shippingOption": { "shippingMethodName": "Local delivery – City", "shippingRate": 10 }, "handlingFee": {}, "pricesIncludeTax": false }, "orders": [ { "id": 266645518, "total": 26.84, "createDate": "2021-06-16 12:53:39 +0000" } ] } ``` -------------------------------- ### Get Customer Request Example Source: https://docs.ecwid.com/api-reference/rest-api/customers/get-customer.md This is an example of an HTTP GET request to retrieve customer details. Ensure you include the correct store ID and customer ID in the URL and provide your Bearer token for authorization. ```http GET /api/v3/1003/customers/177737165 HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### Create Product Request Example Source: https://docs.ecwid.com/api-reference/rest-api/products/create-product.md This example demonstrates a POST request to create a new product with various details including SKU, pricing, categories, options, and shipping information. Ensure you have the 'create_catalog' scope and include your store ID and an Authorization header. ```http POST /api/v3/1003/products HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com Content-Type: application/json Cache-Control: no-cache { "sku": "000012199", "quantity": 10, "name": "New Product", "price": 10, "compareToPrice": 15, "costPrice": 8, "isShippingRequired": false, "categoryIds": [ 9691094 ], "weight": 10, "enabled": true, "description": "A new product description", "productClassId": 0, "volume": 500, "volumeUnit": "ml", "fixedShippingRateOnly": false, "fixedShippingRate": 1.2, "tax": { "enabledManualTaxes": [ 1117939042 ], "taxable": true }, "options": [ { "type": "RADIO", "name": "Size", "choices": [ { "text": "Small", "priceModifier": 0, "priceModifierType": "ABSOLUTE" }, { "text": "Large", "priceModifier": 15, "priceModifierType": "ABSOLUTE" } ], "defaultChoice": 0, "required": true } ], "shipping": { "type": "SELECTED_METHODS", "methodMarkup": 0, "flatRate": 0, "disabledMethods": [ "1396442138-1534946367952" ], "enabledMethods": [] } } ``` -------------------------------- ### App Installed Event Data Source: https://docs.ecwid.com/webhook-automations/learn-ecwid-webhooks/event-data-in-webhooks.md Example of JSON payload when an application is installed to the store. This event is only received by the same app. ```json { "eventId":"80aece08-40e8-4145-8764-6c2f0d38678", "eventCreated":1234567, "storeId":1003, "entityId":"1003", // duplicates store ID "eventType":"application.installed" } ``` -------------------------------- ### Create Project Directory and Initialize npm Source: https://docs.ecwid.com/site-themes/develop-site-themes/getting-started/install-crane-to-your-system.md Use these commands to create a new directory for your project and initialize npm within it. ```bash mkdir my-workspace && cd my-workspace npm init -y ``` -------------------------------- ### Querying Documentation Example Source: https://docs.ecwid.com/api-reference/rest-api/orders/get-repeat-order-url.md Illustrates how to query the documentation dynamically using the `ask` and `goal` query parameters. This is useful for retrieving information not explicitly present on the current page. ```http GET https://docs.ecwid.com/api-reference/rest-api/orders/get-repeat-order-url.md?ask=&goal= ``` -------------------------------- ### Get Product Type Request Example Source: https://docs.ecwid.com/api-reference/rest-api/products/product-types-and-attributes/get-product-type.md Demonstrates a sample GET request to retrieve a product type by its ID. ```http GET /api/v3/1003/classes/0 HTTP/1.1 Host: app.ecwid.com Authorization: Bearer secret_token ``` -------------------------------- ### Create Promotion Response Example Source: https://docs.ecwid.com/api-reference/rest-api/discounts/promotions/create-promotion.md Example response after successfully creating a promotion, returning the new promotion's ID. ```json { "id": 182018 } ``` -------------------------------- ### Example HTTP Request Source: https://docs.ecwid.com/api-reference/rest-api/batch-requests/search-batch-requests-by-status.md An example of an HTTP GET request to search for completed batch requests, including authorization headers. ```http GET /api/v3/1003/batch?status=COMPLETED&limit=100 HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### Get Product Request Example Source: https://docs.ecwid.com/api-reference/rest-api/products/get-product.md This snippet shows an example of an HTTP GET request to retrieve a specific product from your Ecwid store. Ensure you replace `{storeId}` and `{productId}` with your actual store and product identifiers. The `Authorization` header is crucial for authentication. ```http GET /api/v3/1003/products/692730761 HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### Build and Preview Template Source: https://docs.ecwid.com/site-themes/develop-site-themes/getting-started/make-your-first-template.md Commands to build your application and start a local preview server to view your template changes. ```bash npx @lightspeed/crane@latest build ``` ```bash npx @lightspeed/crane@latest preview ``` -------------------------------- ### Create Promotion Request Example Source: https://docs.ecwid.com/api-reference/rest-api/discounts/promotions/create-promotion.md Example of a POST request to create a new promotion with specific discount rules and targets. ```http POST /api/v3/1003/promotions HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com Content-Type: application/json Cache-Control: no-cache { "name": "Free drink for any 3 pizzas", "discountBase": "ITEM", "discountType": "PERCENT", "amount": 100, "enabled": true, "triggers": { "minProductQuantityInCart": 3, "categories": [ 862076252 ] }, "targets": { "maxDiscountedProductQuantity": 2, "categories": [ 375620372 ] } } ``` -------------------------------- ### Search Categories Request Example Source: https://docs.ecwid.com/api-reference/rest-api/categories/search-categories.md This example shows a GET request to search for categories in a specific store. Ensure you have the `read_catalog` scope. ```http GET /api/v3/1003/categories HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### Get Product Order Request Example Source: https://docs.ecwid.com/api-reference/rest-api/categories/manage-order-of-products-in-the-category/get-order-of-products.md Demonstrates an HTTP GET request to retrieve the sorted product IDs for a given category. ```http GET /api/v3/1003/products/sort?parentCategory=0 HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### Querying Documentation Dynamically Source: https://docs.ecwid.com/api-reference/rest-api/products/product-images-and-videos/upload-main-product-image-async.md This example shows how to perform an HTTP GET request to query the documentation dynamically. Use the `ask` parameter for your question and optionally the `goal` parameter to specify your end goal. ```http GET https://docs.ecwid.com/api-reference/rest-api/products/product-images-and-videos/upload-main-product-image-async.md?ask=&goal= ``` -------------------------------- ### Get Category Order Request Example Source: https://docs.ecwid.com/api-reference/rest-api/categories/manage-order-of-categories-in-the-store/get-order-of-categories.md Demonstrates an HTTP GET request to retrieve the sorted category IDs for a parent category. ```http GET /api/v3/1003/categories/sort?parentCategory=0 HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### Run Local Preview Source: https://docs.ecwid.com/site-themes/develop-site-themes/dev-recommendations/build-validation-and-deployment.md Build and preview the theme locally to test various page types and states. This step is crucial before testing in the Instant Site Editor. ```bash npm run build npm run preview ``` -------------------------------- ### Get Recurring Subscription Request Example Source: https://docs.ecwid.com/api-reference/rest-api/orders/recurring-subscriptions/get-recurring-subscription.md Demonstrates an HTTP GET request to retrieve a specific recurring subscription by its ID. Ensure you have the 'read_subscriptions' scope. ```http GET /api/v3/1003/subscriptions/66839 HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### Install @lightspeed/ecom-headless Source: https://docs.ecwid.com/site-themes/develop-site-themes/headless-api.md Install the headless API client using npm. ```bash npm install @lightspeed/ecom-headless ``` -------------------------------- ### Get Batch Status Request Example Source: https://docs.ecwid.com/api-reference/rest-api/batch-requests/get-batch-status.md Demonstrates a GET request to check the status of a batch operation. Replace {storeId} and {ticketId} with your specific values. ```http GET /api/v3/1003/batch?ticket=11kl140a2-966f-1a9f-b4e6-fc451bc78570 HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### Querying Documentation Dynamically Source: https://docs.ecwid.com/api-reference/rest-api/customers/customer-groups/update-customer-group.md Illustrates how to query the documentation using a GET request with 'ask' and optional 'goal' query parameters. ```http GET https://docs.ecwid.com/api-reference/rest-api/customers/customer-groups/update-customer-group.md?ask=&goal= ``` -------------------------------- ### Get Product Variation Request Example Source: https://docs.ecwid.com/api-reference/rest-api/products/product-variations/get-product-variation.md Demonstrates a GET request to retrieve a specific product variation by its ID. Includes necessary headers like Authorization. ```http GET /api/v3/1003/products/692730761/combinations/422488528 HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### Define a Showcase with `showcase.init()` Source: https://docs.ecwid.com/site-themes/develop-site-themes/getting-started/make-your-first-section.md Use `showcase.init()` to create a showcase with a unique ID, preview image, block name, layout ID, and default content and design values. Ensure content and design keys match your settings files. ```typescript // showcases/1.ts import { content, design, showcase, } from '@lightspeed/crane-api'; export default showcase.init({ showcaseId: '1', previewImage: { set: { ORIGINAL: { url: 'hero_banner_section_showcase_1_preview.jpeg', width: 500, height: 300, }, }, }, blockName: '$label.showcase_1.blockName', layoutId: 'Hero_Banner', content: { hero_title: content.default.inputbox({ text: '$label.showcase_1.hero_title.text', }), hero_description: content.default.textarea({ text: '$label.showcase_1.hero_description.text', }), hero_image: content.default.image({ imageData: { set: { MOBILE_WEBP_LOW_RES: { url: 'hero_webp-200x150.jpeg', }, MOBILE_WEBP_HI_RES: { url: 'hero_webp-2000x1500.jpeg', }, WEBP_LOW_RES: { url: 'hero_webp-200x150.jpeg', }, WEBP_HI_2X_RES: { url: 'hero_webp-2000x1500.jpeg', }, }, borderInfo: {}, }, }), cta_button: content.default.button({ title: '$label.showcase_1.cta_button.title', buttonType: 'HYPER_LINK', link: 'https://www.example.com', }), }, design: { title_design: design.default.text({ font: 'global.fontFamily.body', size: 40, bold: true, italic: false, color: '#313131', }), description_design: design.default.text({ font: 'global.fontFamily.body', size: 18, bold: false, italic: false, color: '#313131', }), background_design: design.default.background({ style: 'COLOR', color: 'global.color.background', }), }, }); ``` -------------------------------- ### Get Last Order Request Example Source: https://docs.ecwid.com/api-reference/rest-api/orders/get-last-order.md Demonstrates a basic HTTP GET request to retrieve the last order. Ensure you include your store ID and an authorization token. ```http GET /api/v3/1003/orders HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### GET Request to Search Customer Groups Source: https://docs.ecwid.com/api-reference/rest-api/customers/customer-groups/search-customer-groups.md This example shows a basic GET request to retrieve all customer groups. Ensure you include your store ID and an authorization token. ```http GET /api/v3/1003/customer_groups HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### Get Customer Contact Request Example Source: https://docs.ecwid.com/api-reference/rest-api/customers/customer-contacts/get-customer-contact.md Demonstrates the HTTP GET request to retrieve a specific customer contact. Ensure you include the Authorization header with your access token. ```http GET /api/v3/1003/customers/177737165/contacts/113861381 HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### Preview Crane Application Locally Source: https://docs.ecwid.com/site-themes/develop-site-themes/getting-started/start-with-crane-app.md Starts a local development server to test your sections. Open the provided URL in a browser to view changes. Rebuild and refresh after making modifications. ```bash npx @lightspeed/crane@latest preview ``` -------------------------------- ### Get Product Reviews Stats Request Example Source: https://docs.ecwid.com/api-reference/rest-api/products/product-reviews/get-product-reviews-stats.md Demonstrates an HTTP GET request to retrieve product review statistics. Ensure you include the Authorization header with your access token. ```http GET /api/v3/1003/reviews/filters_data HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### Build and Preview Crane Application Source: https://docs.ecwid.com/site-themes/develop-site-themes/getting-started/deep-dive-into-crane-cli.md Compile your application code using the build command and start a local preview server to test your changes. Open the provided URL in your browser to view the application. ```bash # Build your application npx @lightspeed/crane@latest build # Start preview server npx @lightspeed/crane@latest preview ``` -------------------------------- ### Query Documentation API Example Source: https://docs.ecwid.com/storefronts/manage-customers-on-the-storefront/get-logged-in-customers-details.md Demonstrates how to query the documentation dynamically using an HTTP GET request. This is useful for retrieving specific information or related documentation sections not explicitly present on the current page. ```http GET https://docs.ecwid.com/storefronts/manage-customers-on-the-storefront/get-logged-in-customers-details.md?ask=&goal= ``` -------------------------------- ### GET Request for Tax Invoices Source: https://docs.ecwid.com/api-reference/rest-api/orders/order-invoices/get-tax-invoices-for-order.md This example shows how to make a GET request to retrieve tax invoices for a specific order. Ensure you include the Authorization header with your access token. ```http GET /api/v3/1003/orders/JJ5HH/invoices HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.ecwid.com/changelog/march-2025 Use this GET request to ask questions about the documentation. Include an optional 'goal' parameter for tailored responses. ```http GET https://docs.ecwid.com/changelog/march-2025.md?ask=&goal= ``` -------------------------------- ### Example iframe URL with encrypted payload Source: https://docs.ecwid.com/launch-apps/native-and-external-apps/access-store-data-from-the-app.md This is an example of the iframe URL Ecwid calls when a user installs or opens your Native app. The `payload` parameter contains encrypted store information. ```text https://www.example.com/my-app-iframe-page?payload=353035362c226163636573735f746f6b656e223a22776d6 ``` -------------------------------- ### GET Request to Search Product Brands Source: https://docs.ecwid.com/api-reference/rest-api/products/search-product-brands.md This example shows a basic GET request to retrieve product brands from a specific store. Ensure you include the Authorization header with your access token. ```http GET /api/v3/1003/brands HTTP/1.1 Authorization: Bearer secret_token Host: app.ecwid.com ``` -------------------------------- ### Query Documentation with GET Request Source: https://docs.ecwid.com/api-reference/rest-api/orders/get-last-order.md Demonstrates how to perform an HTTP GET request to query the documentation dynamically. Use the `ask` parameter for specific questions and the optional `goal` parameter for broader context. ```http GET https://docs.ecwid.com/api-reference/rest-api/orders/get-last-order.md?ask=&goal= ```