### Install Dependencies and Run Theme Source: https://ikas.dev/docs/theme/getting-started/introduction After creating your theme and configuring it, navigate to the theme's directory, install dependencies using yarn, and start the development server. Currently, only yarn is supported. ```bash cd your-theme yarn install yarn dev ``` -------------------------------- ### Retrieve Product Attributes Examples Source: https://ikas.dev/docs/api/admin-api/product-attributes Examples showing how to fetch product attributes using cURL and Node.js. ```bash curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{"query":"{ listProductAttribute { id name createdAt } }"}' ``` ```javascript const axios = require('axios'); const data = {"query":`{ listProductAttribute { id name createdAt } } `}; const config = { method: 'POST', url: 'https://api.myikas.com/api/v1/admin/graphql', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer your_token' }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { if (error.response) { console.log(JSON.stringify(error.response.data)); } }); ``` -------------------------------- ### Retrieve Price Lists Examples Source: https://ikas.dev/docs/api/admin-api/price-lists Examples showing how to fetch price lists using cURL and Node.js with the axios library. ```bash curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{"query":"{ listPriceList { id name } }"}' ``` ```javascript const axios = require('axios'); const data = {"query":`{ listPriceList { id name } } `}; const config = { method: 'POST', url: 'https://api.myikas.com/api/v1/admin/graphql', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer your_token' }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { if (error.response) { console.log(JSON.stringify(error.response.data)); } }); ``` -------------------------------- ### Retrieve Category List Examples Source: https://ikas.dev/docs/api/admin-api/category Examples for fetching categories using cURL and Node.js. ```bash curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{"query":"{ listCategory { id name } }"}' ``` ```javascript const axios = require('axios'); const data = {"query":`{ listCategory { id name } } `}; const config = { method: 'POST', url: 'https://api.myikas.com/api/v1/admin/graphql', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer your_token' }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { if (error.response) { console.log(JSON.stringify(error.response.data)); } }); ``` -------------------------------- ### Add a Custom Timeline Entry Example Source: https://ikas.dev/docs/api/admin-api/timeline Examples of how to add a custom timeline entry using cURL or Node.js. ```bash curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{"query":"mutation { addCustomTimelineEntry( input: { message: \"deneme\" sourceId: \"44265c6d-6d58-4e29-9544-1f6305df9bf9\" sourceType: CUSTOMER } ) }"}' ``` ```javascript const axios = require('axios'); const data = {"query":`mutation { addCustomTimelineEntry( input: { message: "deneme" sourceId: "44265c6d-6d58-4e29-9544-1f6305df9bf9" sourceType: CUSTOMER } ) } `}; const config = { method: 'POST', url: 'https://api.myikas.com/api/v1/admin/graphql', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer your_token' }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { if (error.response) { console.log(JSON.stringify(error.response.data)); } }); ``` -------------------------------- ### Empty Response Example Source: https://ikas.dev/docs/api/admin-api/sales-channels An example of an empty response, which might indicate a successful but non-returning operation or an issue. ```json {} ``` -------------------------------- ### Retrieve List of Storefronts Source: https://ikas.dev/docs/api/admin-api/storefronts Examples for fetching storefronts using cURL and Node.js. ```bash curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{"query":"{ listStorefront(id: { eq: \"storefront_id\" }) { id name } } "}' ``` ```javascript const axios = require('axios'); const data = {"query":`{ listStorefront(id: { eq: "storefront_id" }) { id name } } `}; const config = { method: 'POST', url: 'https://api.myikas.com/api/v1/admin/graphql', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer your_token' }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { if (error.response) { console.log(JSON.stringify(error.response.data)); } }); ``` -------------------------------- ### Example Response for ListProductTag Source: https://ikas.dev/docs/api/admin-api/product-tag Sample JSON response when successfully retrieving a list of product tags. ```json { "data": { "listProductTag": [ { "id": "a8befae6-2cb9-487a-bd7f-5e0bfff3676b", "name": "Tag name" } ] } } ``` -------------------------------- ### Storefront List Response Source: https://ikas.dev/docs/api/admin-api/storefronts Example JSON response for the listStorefront query. ```json { "data": { "listStorefront": [ { "id": "78c58c28-d191-4ab1-a8df-4b23283a7fb4", "name": "Storefront's Name" } ] } } ``` -------------------------------- ### Configure Responsive Image Layout Source: https://ikas.dev/docs/theme/prop-types/image Example of using the responsive layout type with specific aspect ratio and objectFit settings. ```tsx ``` -------------------------------- ### Retrieve Product Tags using Node.js (axios) Source: https://ikas.dev/docs/api/admin-api/product-tag Example using Node.js with the axios library to query for product tags. ```javascript const axios = require('axios'); const data = {"query":`{ listProductTag { id name } } `}; const config = { method: 'POST', url: 'https://api.myikas.com/api/v1/admin/graphql', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer your_token' }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { if (error.response) { console.log(JSON.stringify(error.response.data)); } }); ``` -------------------------------- ### Get Access Token using Node.js Source: https://ikas.dev/docs/api/getting-started/authentication This Node.js snippet demonstrates how to get an access token using the axios library. ```javascript var axios = require("axios").default; var options = { method: 'POST', url: 'https://.myikas.com/api/admin/oauth/token', headers: { 'content-type': 'application/x-www-form-urlencoded' }, data: { grant_type: 'client_credentials', client_id: '', client_secret: '' } }; axios.request(options) .then((response) => { console.log(response.data); }).catch((error) => { console.error(error); }); ``` -------------------------------- ### Create Order via GraphQL API Source: https://ikas.dev/docs/api/admin-api/orders Examples for executing the createOrderWithTransactions mutation using different programming environments. ```bash curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{"query":"mutationundefined"}' ``` ```javascript const axios = require('axios'); const data = {"mutation":`{ createOrderWithTransactions( input: { disableAutoCreateCustomer: true order: { billingAddress: { addressLine1: 'ikas A.Ş. Koru Mah. Ahmet Taner Kışlalı Cad. No:4/12 North Star İş Merkezi' city: { id: '6f9272a3-9924-4223-baf8-9b21c9360f0c', name: 'Ankara' } country: { code: 'TUR' id: 'da8c5f2a-8d37-48a8-beff-6ab3793a1861' name: 'Turkey' } firstName: 'ikas' lastName: 'docs' isDefault: false } currencyCode: 'TRY' orderLineItems: [ { price: 299 quantity: 1 variant: { id: 'bd9b2bd8-0110-4ded-84c0-b8298332e469' name: 'ikas Ürünü Siyah Kılıf - iPhone 11 Pro Max Kılıf Silikon' } } ] customer: { id: 'fa8b6fbc-210d-4488-88ab-a7bea0a2648b' } orderAdjustments: [ { amount: 149.5 amountType: AMOUNT campaignId: '653aa7c2-4d3c-42ba-aba9-94060f52660d' name: 'Kargo Bypass' order: 1 type: DECREMENT } ] salesChannelId: '9fa400f3-fbf1-4ee7-bc26-3cae7f9c3427' shippingAddress: { addressLine1: 'ikas A.Ş. Koru Mah. Ahmet Taner Kışlalı Cad. No:4/12 North Star İş Merkezi' city: { id: '6f9272a3-9924-4223-baf8-9b21c9360f0c', name: 'Ankara' } country: { code: 'TUR' id: 'da8c5f2a-8d37-48a8-beff-6ab3793a1861' name: 'Turkey' } firstName: 'ikas' lastName: 'docs' isDefault: false } shippingLines: [{ price: 21, title: 'Kkk' }] shippingMethod: SHIPMENT } transactions: [ { amount: 149.5 paymentGatewayId: 'e3e9f662-511c-11ec-bf63-0242ac130002' } ] } ) {billingAddress { addressLine1 addressLine2 city { code id name } company country { code id iso2 iso3 name } district { code id name } firstName id identityNumber isDefault lastName phone postalCode state { code id name } taxNumber taxOffice } branch { id name } branchSessionId cancelReason cancelledAt clientIp createdAt currencyCode currencyRates { code originalRate rate } customer { email firstName id identityNumber isGuestCheckout ``` -------------------------------- ### Product stock location response Source: https://ikas.dev/docs/api/admin-api/stock-locations Example JSON response for the product stock location query. ```json { "data": { "listProductStockLocation": { "count": 2, "hasNext": false, "limit": 200, "page": 1, "data": [ { "createdAt": 1626700964797, "deleted": false, "id": "122fa5fa-2271-4f90-a26a-fb67539b788b", "productId": "08665baf-a982-4042-9d08-01b0ea21a2eb", "stockCount": 0, "stockLocationId": "1712d863-82f8-465c-a096-9d599ff94d37", "updatedAt": 1626701111813, "variantId": "40c802f1-6755-420a-8817-2976bbcfacde" }, { "createdAt": 1626700701526, "deleted": false, "id": "b3f265f5-6588-4b67-aaae-e2d722589541", "productId": "08665baf-a982-4042-9d08-01b0ea21a2eb", "stockCount": 0, "stockLocationId": "a0d19a13-7603-4d75-9ed7-dc414b1df8df", "updatedAt": 1626855914363, "variantId": "40c802f1-6755-420a-8817-2976bbcfacde" } ] } } } ``` -------------------------------- ### Product Attributes Response Source: https://ikas.dev/docs/api/admin-api/product-attributes Example JSON response structure for the listProductAttribute query. ```json { "data": { "listProductAttribute": [ { "id": "a8befae6-2cb9-487a-bd7f-5e0bfff3676b", "name": "Product attribute name", "createdAt": 1634019877744 } ] } } ``` -------------------------------- ### API Response JSON Source: https://ikas.dev/docs/api/admin-api/merchant This is an example of a JSON response from the API, detailing user information. ```json { "data": { "me": { "addedDate": 1637050545408, "email": null, "id": "92be8a2f-47e4-471b-8c17-bc17d3de90fe", "name": null, "partnerId": "02032105-e67f-42e9-aaff-32b608c500f9", "salesChannelId": null, "scope": "read_customers,write_customers", "scopes": null, "storeAppId": "68e29a17-ae29-484b-9e94-839a108dcf57", "supportsMultipleInstallation": null } } } ``` -------------------------------- ### Retrieve a list of brands using cURL Source: https://ikas.dev/docs/api/admin-api/product-brand Example of how to retrieve a list of product brands using a POST request with cURL. Ensure to replace `` with your actual token. ```bash curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{"query":"{ listProductBrand { id name createdAt } }"}' ``` -------------------------------- ### Retrieve a list of countries Source: https://ikas.dev/docs/api/admin-api/locations Examples for fetching country data using cURL or Node.js with Axios. ```bash curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{"query":"{ listCountry { id name locationTranslations { tr en } iso2 iso3 phoneCode capital currency native region subregion emoji emojiString } } "}' ``` ```javascript const axios = require('axios'); const data = {"query":`{ listCountry { id name locationTranslations { tr en } iso2 iso3 phoneCode capital currency native region subregion emoji emojiString } } `}; const config = { method: 'POST', url: 'https://api.myikas.com/api/v1/admin/graphql', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer your_token' }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { if (error.response) { console.log(JSON.stringify(error.response.data)); } }); ``` -------------------------------- ### Create Webhook using Node.js Source: https://ikas.dev/docs/api/admin-api/webhooks Example using Node.js with the axios library to send a POST request to the GraphQL API to save a new webhook. ```javascript const axios = require('axios'); const data = {"query":`mutation { saveWebhook( input: { scopes: "store/customer/created" endpoint: "https://www.google.com/" } ) { createdAt deleted endpoint id scope updatedAt } } `}; const config = { method: 'POST', url: 'https://api.myikas.com/api/v1/admin/graphql', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer your_token' }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { if (error.response) { console.log(JSON.stringify(error.response.data)); } }); ``` -------------------------------- ### Call API with Access Token using Node.js Source: https://ikas.dev/docs/api/getting-started/authentication This Node.js example shows how to send a GraphQL query with an access token using axios. ```javascript const axios = require('axios'); const data = {"query":`{me { id }}`}; const config = { method: 'POST', url: 'https://api.myikas.com/api/v1/admin/graphql', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer your_token' }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { if (error.response) { console.log(JSON.stringify(error.response.data)); } }); ``` -------------------------------- ### Initiate Social Login Source: https://ikas.dev/docs/theme/api/stores/ikas-customer-store Use this function to start the social login process by redirecting the user to the selected provider. Supports Facebook and Google. ```typescript async socialLogin(provider: "facebook" | "google") ``` -------------------------------- ### GET /IkasProductGetY Source: https://ikas.dev/docs/theme/api/models/ikas-product-gety Retrieves product campaign information based on the provided amount, discount ratio, and filter criteria. ```APIDOC ## GET /IkasProductGetY ### Description Retrieves product campaign data based on specified amount, discount ratio, and filter criteria. ### Parameters #### Query Parameters - **amount** (number) - Required - The amount value for the product campaign. - **discountRatio** (number) - Required - The discount ratio applied. - **filter** (IkasProductCampaignFilter) - Required - Filter criteria defined by the IkasProductCampaignFilter reference. ``` -------------------------------- ### API Response for Saving Product Stock Locations Source: https://ikas.dev/docs/api/admin-api/stock-locations This is an example of a successful response when saving product stock locations via the API. ```json { "data": { "saveProductStockLocations": true } } ``` -------------------------------- ### List States Source: https://ikas.dev/docs/api/admin-api/locations Examples for fetching states filtered by countryId using cURL or Node.js. ```bash curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{"query":"{ listState(countryId: { eq: \"country_id\" }) { id name stateCode countryId } } "}' ``` ```javascript const axios = require('axios'); const data = {"query":`{ listState(countryId: { eq: "country_id" }) { id name stateCode countryId } } `}; const config = { method: 'POST', url: 'https://api.myikas.com/api/v1/admin/graphql', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer your_token' }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { if (error.response) { console.log(JSON.stringify(error.response.data)); } }); ``` -------------------------------- ### Create Webhook using cURL Source: https://ikas.dev/docs/api/admin-api/webhooks Example using cURL to send a POST request to the GraphQL API to save a new webhook. ```bash curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{"query":"mutation { saveWebhook( input: { scopes: \"store/customer/created\" endpoint: \"https://www.google.com/\" } ) { createdAt deleted endpoint id scope updatedAt }}"}' ``` -------------------------------- ### Get Global Tax Settings Source: https://ikas.dev/docs/api/type-definitions/admin-api/queries/get-global-tax-settings Use this mutation to get global settings. ```APIDOC ## GET /websites/ikas_dev/globalTaxSettings ### Description Retrieves the global tax settings for the website. ### Method GET ### Endpoint /websites/ikas_dev/globalTaxSettings ### Response #### Success Response (200) - **GlobalTaxSettings** (object) - The global tax settings object. #### Response Example ```json { "taxSettings": { "enabled": true, "defaultVatRate": 20, "currency": "EUR" } } ``` ``` -------------------------------- ### Call API with Access Token using cURL Source: https://ikas.dev/docs/api/getting-started/authentication Example of how to make a POST request to the GraphQL API with an authorization header. ```bash curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{"query":"{me { id }}"}' ``` -------------------------------- ### Retrieve Webhooks using Node.js Source: https://ikas.dev/docs/api/admin-api/webhooks Example using Node.js with the axios library to send a POST request to the GraphQL API to list active webhooks. ```javascript const axios = require('axios'); const data = {"query":`{ listWebhook { createdAt deleted endpoint id scope updatedAt } } `}; const config = { method: 'POST', url: 'https://api.myikas.com/api/v1/admin/graphql', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer your_token' }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { if (error.response) { console.log(JSON.stringify(error.response.data)); } }); ``` -------------------------------- ### Initialization and Utilities Source: https://ikas.dev/docs/theme/api/stores/ikas-customer-store APIs for initializing the customer store and utility functions. ```APIDOC ## POST /api/customer/consent ### Description Callback to be invoked when the customer grants consent for cookies. ### Method POST ### Endpoint /api/customer/consent ### Request Example ```json { "consentGranted": true } ``` ## GET /api/customer/initialized ### Description Checks if the customer store has been successfully initialized. ### Method GET ### Endpoint /api/customer/initialized ## GET /api/customer/captcha-token-initialized ### Description Checks if the captcha token has been initialized. ### Method GET ### Endpoint /api/customer/captcha-token-initialized ## POST /api/customer/check-email ### Description Checks if an email address is already registered. ### Method POST ### Endpoint /api/customer/check-email ### Parameters #### Request Body - **email** (string) - Required - The email address to check ### Request Example ```json { "email": "test@example.com" } ``` ``` -------------------------------- ### Initialize Customer Review List Source: https://ikas.dev/docs/theme/api/models/ikas-customer-review-list Initializes the list and fetches the first page of data. ```typescript function getInitial(): Promise ``` -------------------------------- ### Retrieve Product Tags using cURL Source: https://ikas.dev/docs/api/admin-api/product-tag Example using cURL to send a POST request to the GraphQL endpoint to list product tags. ```bash curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{"query":"{ listProductTag { id name } }"}' ``` -------------------------------- ### Define TransactionInstallmentPrice Type Source: https://ikas.dev/docs/api/type-definitions/admin-api/objects/transaction-installment-price Defines the GraphQL type for transaction installment prices. Use this type to represent installment details for a transaction. ```graphql type TransactionInstallmentPrice { installmentCount: Float installmentPrice: Float originalRate: Float rate: Float totalPrice: Float } ``` -------------------------------- ### Build Theme with Yarn Source: https://ikas.dev/docs/theme/publishing-a-theme Run this command to build your theme source code before uploading. Ensure the build is successful before proceeding. ```bash yarn build ``` -------------------------------- ### String Filter Usage Example Source: https://ikas.dev/docs/api/type-definitions/admin-api/inputs/string-filter-input Example of using the 'like' filter for regex pattern matching. This matches documents where the 'name' field contains 'AAA'. ```graphql merchantId: { like: AAA } ``` -------------------------------- ### Create New ikas Theme Source: https://ikas.dev/docs/theme/getting-started/introduction Use this command to generate a new ikas theme template on your local machine. Ensure you have Node.js and npm/yarn installed. ```bash npx create-ikas-theme@latest ``` -------------------------------- ### Search Functionality Example Source: https://ikas.dev/docs/api/type-definitions/admin-api/queries/list-category The search argument allows for flexible searching across specified fields like 'name' and 'description'. This example demonstrates searching for 'AAA'. ```graphql search: AAA ``` -------------------------------- ### SearchProductCampaignBuyXThenGetY Type Source: https://ikas.dev/docs/api/type-definitions/admin-api/objects/search-product-campaign-buy-xthen-get-y Defines the structure for a 'Buy X Then Get Y' product campaign. This includes the conditions for buying X items and the reward for getting Y items, along with optional usage limits. ```APIDOC ## SearchProductCampaignBuyXThenGetY ### Description Represents a 'Buy X Then Get Y' product campaign configuration. ### Fields - **buyX** (SearchProductCampaignBuyX!) - Required - Specifies the conditions for the 'buy X' part of the campaign. - **getY** (SearchProductCampaignGetY!) - Required - Specifies the conditions for the 'get Y' part of the campaign. - **maxUsagePerOrder** (Float) - Optional - The maximum number of times this campaign can be used per order. ``` -------------------------------- ### Define ProductOptionFileSettings Type Source: https://ikas.dev/docs/api/type-definitions/admin-api/objects/product-option-file-settings Schema definition for file-related settings in product options. ```graphql type ProductOptionFileSettings { allowedExtensions: [String!] maxQuantity: Float minQuantity: Float } ``` -------------------------------- ### Product Image Upload (Node.js) Source: https://ikas.dev/docs/api/admin-api/products This Node.js example uses Axios to upload a product image. Configure the request with your product details, image URL or base64 string, and authentication token. ```javascript var axios = require("axios").default; var options = { method: 'POST', url: 'https://api.myikas.com/api/v1/admin/product/upload/image', headers: { 'content-type': 'application/json', 'Authorization: Bearer ' }, data: { productImage: { variantIds: '', url?: , base64?: , order: '', isMain: '' } } }; axios.request(options) .then((response) => { console.log(response.data); }).catch((error) => { console.error(error); }); ``` -------------------------------- ### BuyXThenGetYInput Type Source: https://ikas.dev/docs/api/type-definitions/admin-api/inputs/buy-xthen-get-yinput Defines the input structure for a 'Buy X, Then Get Y' promotion. It includes the necessary inputs for the 'buy' and 'get' actions, and an optional field for maximum usage per order. ```APIDOC ## BuyXThenGetYInput ### Description Represents the input for a promotion where a customer buys a certain quantity of item X to receive item Y. ### Fields - **buyX** (BuyXInput!) - Required - Specifies the conditions for the 'buy' part of the promotion. - **getY** (GetYInput!) - Required - Specifies the conditions for the 'get' part of the promotion. - **maxUsagePerOrder** (Int) - Optional - The maximum number of times this promotion can be applied to a single order. ``` -------------------------------- ### Delete Webhook using Node.js (Axios) Source: https://ikas.dev/docs/api/admin-api/webhooks This Node.js script uses Axios to send a GraphQL mutation to delete a webhook. Ensure you have Axios installed (`npm install axios`). Replace `your_token` with your actual access token. ```javascript const axios = require('axios'); const data = {"query":`mutation { deleteWebhook(scopes: ["store/customer/created"]) } `}; const config = { method: 'POST', url: 'https://api.myikas.com/api/v1/admin/graphql', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer your_token' }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { if (error.response) { console.log(JSON.stringify(error.response.data)); } }); ``` -------------------------------- ### Get Customer Reviews - TypeScript Source: https://ikas.dev/docs/theme/api/models/ikas-product Asynchronously retrieves customer reviews for the product. Supports pagination with optional limit and page parameters. Returns a Promise resolving to an IkasCustomerReviewList. ```typescript async function getCustomerReviews(params?: { limit?: number; page?: number }): Promise ``` -------------------------------- ### ProductOptionFileSettings Type Source: https://ikas.dev/docs/api/type-definitions/admin-api/objects/product-option-file-settings Defines the structure for product option file settings. ```APIDOC ## ProductOptionFileSettings Type ### Description Represents the settings for file uploads associated with product options. ### Fields #### `allowedExtensions` (String!) - Required - A list of allowed file extensions. #### `maxQuantity` (Float) - Optional - The maximum quantity allowed for the file. #### `minQuantity` (Float) - Optional - The minimum quantity allowed for the file. ``` -------------------------------- ### GET /websites/ikas_dev/saleschannel Source: https://ikas.dev/docs/api/type-definitions/admin-api/queries/get-sales-channel Retrieves information about the sales channel. ```APIDOC ## GET /websites/ikas_dev/saleschannel ### Description Using this API, you can view your sales channel. ### Method GET ### Endpoint /websites/ikas_dev/saleschannel ### Response #### Success Response (200) - **SalesChannel** (object) - Information about the sales channel. ``` -------------------------------- ### GET /merchant/licenses Source: https://ikas.dev/docs/api/type-definitions/admin-api/queries/get-merchant-licence Retrieves all licenses owned by a merchant. ```APIDOC ## GET /merchant/licenses ### Description Using this API, you can view all licenses owned by a merchant. ### Method GET ### Endpoint /merchant/licenses ### Response #### Success Response (200) - **MerchantLicence** (MerchantLicence) - Details of the merchant's licenses. ``` -------------------------------- ### Retrieve a list of products (Node.js) Source: https://ikas.dev/docs/api/admin-api/products Example using Node.js with the axios library to send a POST request to the GraphQL endpoint for retrieving product data. Ensure you replace '' with your actual token. ```javascript const axios = require('axios'); const data = {"query":`{ listProduct { data { id name createdAt } } } `}; const config = { method: 'POST', url: 'https://api.myikas.com/api/v1/admin/graphql', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer your_token' }, data : data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { if (error.response) { console.log(JSON.stringify(error.response.data)); } }); ``` -------------------------------- ### GET /websites/ikas_dev/getLastImportJobData Source: https://ikas.dev/docs/api/type-definitions/admin-api/queries/get-last-import-job-data Retrieves the data for the last import job. ```APIDOC ## GET /websites/ikas_dev/getLastImportJobData ### Description Retrieves the data associated with the most recent import job. ### Method GET ### Endpoint /websites/ikas_dev/getLastImportJobData ### Response #### Success Response (200) - **data** (GetLastImportJobDataResponse) - The response object containing the last import job data. ``` -------------------------------- ### GET getAuthorizedApp Source: https://ikas.dev/docs/api/type-definitions/admin-api/queries/get-authorized-app Retrieves the properties of a merchant and merchant staff. ```APIDOC ## GET getAuthorizedApp ### Description By using this api you can get properties of merchant and merchant staff. ### Response #### Success Response (200) - **AuthorizedApp** (object) - The properties of the merchant and merchant staff. ``` -------------------------------- ### Initialize Product Option Values Function Source: https://ikas.dev/docs/theme/api/models/ikas-product-option Initializes the values for a product option. This function has a void return type, indicating it performs an action without returning a specific value. ```typescript function initValues(): void ``` -------------------------------- ### Create Sales Channel with cURL Source: https://ikas.dev/docs/api/admin-api/sales-channels Use this cURL command to create a new sales channel. Ensure you replace '' with your actual token. ```bash curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{"query":"mutation { saveSalesChannel( input: { name: \"AAA\" priceListId: \"priceListId\" stockLocations: { id: \"stockLocationId\", order: 4 } } ) { createdAt deleted id name priceListId stockLocations { order } paymentGateways { order } type updatedAt }}"}' ``` -------------------------------- ### Get Authorized App Source: https://ikas.dev/docs/api/admin-api/merchant Retrieves information about the authorized application. ```APIDOC ## POST /api/v1/admin/graphql ### Description Retrieves information about the authorized application. ### Method POST ### Endpoint https://api.myikas.com/api/v1/admin/graphql ### Request Body - **query** (String!) - The GraphQL query to fetch authorized app details. ### Request Example ```json { "query": "{ getAuthorizedApp { addedDate createdAt deleted id partnerId salesChannelId scope storeAppId supportsMultipleInstallation updatedAt }}" } ``` ### Response #### Success Response (200) - **data.getAuthorizedApp** (Object) - An object containing authorized app details. - **addedDate** (Timestamp) - The date the app was added. - **createdAt** (Timestamp) - The creation timestamp of the record. - **deleted** (Boolean) - Indicates if the app record is deleted. - **id** (String!) - The unique identifier for the authorized app. - **partnerId** (String) - The identifier of the partner associated with the app. - **salesChannelId** (String) - The identifier of the sales channel. - **scope** (String) - The scope of permissions granted to the app. - **storeAppId** (String) - The identifier of the store app. - **supportsMultipleInstallation** (Boolean) - Indicates if the app supports multiple installations. - **updatedAt** (Timestamp) - The last update timestamp of the record. #### Response Example ```json { "data": { "getAuthorizedApp": { "addedDate": 1637050545408, "createdAt": 1637050545409, "deleted": false, "id": "92be8a2f-47e4-471b-8c17-bc17d3de90fe", "partnerId": "02032105-e67f-42e9-aaff-32b608c500f9", "salesChannelId": null, "scope": "read_customers,write_customers", "storeAppId": "68e29a17-ae29-484b-9e94-839a108dcf57", "supportsMultipleInstallation": null, "updatedAt": 1637050545409 } } } ``` ``` -------------------------------- ### Get Merchant Detail Source: https://ikas.dev/docs/api/admin-api/merchant Retrieves detailed information about the merchant. ```APIDOC ## POST /api/v1/admin/graphql ### Description Retrieves detailed information about the merchant. ### Method POST ### Endpoint https://api.myikas.com/api/v1/admin/graphql ### Request Body - **query** (String!) - The GraphQL query to fetch merchant details. ### Request Example ```json { "query": "{ getMerchant { email firstName id lastName merchantName merchantSequence phoneNumber storeName }}" } ``` ### Response #### Success Response (200) - **data.getMerchant** (Object) - An object containing merchant details. - **email** (String!) - The merchant staff's email address. - **firstName** (String!) - The merchant's first name. - **id** (String!) - The unique identifier for the merchant. - **lastName** (String!) - The merchant's last name. - **merchantName** (String) - The merchant staff's last name. - **merchantSequence** (Float) - A sequence number for the merchant. - **phoneNumber** (String) - The merchant's phone number. - **storeName** (String) - The merchant's store name. #### Response Example ```json { "data": { "getMerchant": { "email": "taylan-app@gmail.com", "firstName": "taylan", "id": "f2813818-6d01-4f48-b205-a94041ee703d", "lastName": "ilkyaz", "merchantName": "Taylan İlkyaz", "merchantSequence": 310, "phoneNumber": null, "storeName": "taylan-app" } } } ``` ``` -------------------------------- ### GET /merchant/authorized_apps Source: https://ikas.dev/docs/api/admin-api/merchant Retrieves a list of applications authorized by the merchant. ```APIDOC ## GET /merchant/authorized_apps ### Description Retrieves a list of applications that the merchant has authorized, providing details about each app's integration. ### Method GET ### Endpoint /merchant/authorized_apps ### Response #### Success Response (200) - **id** (ID!) - Required - Unique identifier for the authorized app entry. - **addedDate** (Timestamp!) - Required - The date the app was added. - **partnerId** (String!) - Required - Identifier for the application partner. - **salesChannelId** (String) - The id of the sales channel owned by the merchant. - **scope** (String!) - Required - Defines the permissions granted to the app. - **storeAppId** (String!) - Required - The application's ID in the app store. - **supportsMultipleInstallation** (Boolean) - Indicates if the merchant can install more than one instance of this application. #### Response Example ```json [ { "id": "auth-app-456", "addedDate": "2023-10-27T10:00:00Z", "partnerId": "partner-abc", "scope": "read_products", "storeAppId": "app-xyz", "supportsMultipleInstallation": true } ] ``` ``` -------------------------------- ### GET /merchant/detail Source: https://ikas.dev/docs/api/admin-api/merchant Retrieves detailed information about a specific merchant. ```APIDOC ## GET /merchant/detail ### Description Retrieves detailed information for a specific merchant, including contact and address details. ### Method GET ### Endpoint /merchant/detail ### Parameters #### Query Parameters - **id** (String!) - Required - The unique identifier of the merchant to retrieve. ### Response #### Success Response (200) - **id** (String!) - Required - Unique identifier for the merchant. - **address** (MerchantAddress) - Merchant's address information. - **email** (String!) - Required - The merchant staff's email address. - **firstName** (String!) - Required - The merchant's first name. - **lastName** (String!) - Required - The merchant's last name. - **merchantName** (String) - The merchant staff's last name. - **merchantSequence** (Float) - **phoneNumber** (String) - The merchant's phone number. - **storeName** (String) - The merchant's store name. #### Response Example ```json { "id": "merchant-123", "address": { "addressLine1": "123 Main St", "city": { "name": "Anytown" }, "country": { "name": "USA" }, "postalCode": "12345" }, "email": "merchant@example.com", "firstName": "John", "lastName": "Doe", "storeName": "Example Store" } ``` ``` -------------------------------- ### IkasProductOption Methods Source: https://ikas.dev/docs/theme/api/models/ikas-product-option Methods available for interacting with product options, including file uploads and value initialization. ```APIDOC ## Methods ### productOptionFileUpload Uploads files associated with the product option. - **Parameters**: - **files** (File[]) - Array of files to upload. - **Returns**: Promise - Array of file identifiers. ### values (setter) Sets the values for the option. - **Parameters**: - **values** (string[]) - Array of values to set. - **Returns**: string[] ### childOptions (setter) Sets the child options for the option. - **Parameters**: - **options** (IkasProductOption[]) - Array of child options. - **Returns**: IkasProductOption[] ### initValues Initializes the values for the option. - **Returns**: void ``` -------------------------------- ### Product Image Upload (BASH) Source: https://ikas.dev/docs/api/admin-api/products Use this cURL command to upload a product image. Ensure you replace placeholders with your actual product ID, variant ID, and access token. ```bash curl --request POST \ --url 'https://api.myikas.com/api/v1/admin/product/upload/image' \ --header 'content-type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw productId= \ --data-raw variantId= \ --data-raw order= \ --data-raw isMain= ``` -------------------------------- ### GET /me Source: https://ikas.dev/docs/api/type-definitions/admin-api/queries/me Retrieves the profile information for the currently authenticated user. ```APIDOC ## GET /me ### Description Retrieves the profile information for the currently authenticated user. ### Method GET ### Endpoint /me ### Response #### Success Response (200) - **MeResponse** (object) - The profile information of the current user. ``` -------------------------------- ### Authorized App Response Source: https://ikas.dev/docs/api/admin-api/merchant Example JSON response for the getAuthorizedApp query. ```json { "data": { "getAuthorizedApp": { "addedDate": 1637050545408, "createdAt": 1637050545409, "deleted": false, "id": "92be8a2f-47e4-471b-8c17-bc17d3de90fe", "partnerId": "02032105-e67f-42e9-aaff-32b608c500f9", "salesChannelId": null, "scope": "read_customers,write_customers", "storeAppId": "68e29a17-ae29-484b-9e94-839a108dcf57", "supportsMultipleInstallation": null, "updatedAt": 1637050545409 } } } ```