### Install and Initialize Çiçeksepeti API Client Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Install the package via npm and initialize the client with your API key. The client supports resources for product, order, category, cargo, sellerquestion, and canceledOrder. ```javascript // Install via npm // $ npm install --save ciceksepeti-api const Ciceksepeti = require('ciceksepeti-api'); // Initialize the client with your API key from Çiçeksepeti seller panel const ciceksepeti = new Ciceksepeti({ apiKey: 'your-api-key-from-ciceksepeti-seller-panel' }); // The client is now ready to use // Available resources: product, order, category, cargo, sellerquestion, canceledOrder ``` -------------------------------- ### Get Product Response Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Example response structure for retrieving a single product by stock code. ```js { productName: '...', ... } ``` -------------------------------- ### Install Çiçeksepeti API package Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/README.md Use npm to install the package as a dependency in your project. ```shell $ npm install --save ciceksepeti-api ``` -------------------------------- ### List Products Response Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Example response structure for the product listing operation. ```js { totalCount: 155, products: [] } ``` -------------------------------- ### GET ciceksepeti.product.get Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Finds a specific product by its stock code. ```APIDOC ## GET ciceksepeti.product.get ### Description Finds a product by stock code. ### Parameters #### Query Parameters - **stockCode** (string) - Required - The stock code of the product ### Response #### Success Response (200) - **productName** (string) - Name of the product #### Response Example { "productName": "..." } ``` -------------------------------- ### Ciceksepeti API Client Initialization Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/README.md This snippet shows how to install the library and initialize the Ciceksepeti API client with your API key. ```shell # Installation: $ npm install --save ciceksepeti-api ``` ```javascript const Ciceksepeti = require('ciceksepeti-api') const ciceksepeti = new Ciceksepeti({ apiKey: 'your-api-key', }) ``` -------------------------------- ### GET ciceksepeti.sellerquestion.list Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Retrieves seller questions based on provided filters. ```APIDOC ## GET ciceksepeti.sellerquestion.list ### Description Gets seller questions on Çiçeksepeti. ### Query Parameters - **id** (number) - Optional - **productCode** (string) - Optional - **answered** (boolean) - Optional - **startDate** (string) - Optional - **endDate** (string) - Optional - **branchActionId** (number) - Optional - **agentActionId** (number) - Optional - **approve** (boolean) - Optional - **sortType** (number) - Optional - **sortField** (number) - Optional - **page** (number) - Optional ### Response #### Success Response (200) - **items** (array) - List of questions - **hasNextPage** (boolean) - Pagination indicator ``` -------------------------------- ### Count Products Response Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Example response structure for the product counting operation. ```js { totalCount: 155 } ``` -------------------------------- ### GET ciceksepeti.product.list Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Lists products on Çiçeksepeti based on optional filters. ```APIDOC ## GET ciceksepeti.product.list ### Description Lists products on Çiçeksepeti. ### Parameters #### Query Parameters - **status** (enum) - Optional - 'draft', 'waiting_for_approval', 'published', 'rejected', 'passive', 'published_waiting_for_approval', 'out_of_stock' - **page** (number) - Optional - Page number - **pageSize** (number) - Optional - Number of items per page - **sortBy** (enum) - Optional - 'name_asc', 'name_desc', 'stock_asc', 'stock_desc', 'price_asc', 'price_desc', 'created_date_asc', 'created_date_desc' - **stockCode** (string) - Optional - Stock code - **variantName** (string) - Optional - Variant name ### Response #### Success Response (200) - **totalCount** (number) - Total number of products - **products** (array) - List of products #### Response Example { "totalCount": 155, "products": [] } ``` -------------------------------- ### GET /product/get Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Retrieves detailed information for a specific product by its stock code. ```APIDOC ## GET /product/get ### Description Retrieves detailed information for a specific product by its stock code. ### Method GET ### Parameters #### Query Parameters - **stockCode** (string) - Required - The unique stock code of the product ### Response #### Success Response (200) - **productName** (string) - Name of the product - **categoryName** (string) - Category name - **StockQuantity** (number) - Current stock quantity - **SalesPrice** (number) - Sales price - **productStatusType** (string) - Current status of the product ``` -------------------------------- ### GET ciceksepeti.category.list Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Retrieves a list of all categories. ```APIDOC ## GET ciceksepeti.category.list ### Description Lists categories on Çiçeksepeti. ### Response #### Success Response (200) - **categories** (array) - List of categories. ``` -------------------------------- ### GET ciceksepeti.product.count Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Counts products on Çiçeksepeti based on optional filters. ```APIDOC ## GET ciceksepeti.product.count ### Description Counts products on Çiçeksepeti. ### Parameters #### Query Parameters - **status** (enum) - Optional - 'draft', 'waiting_for_approval', 'published', 'rejected', 'passive', 'published_waiting_for_approval', 'out_of_stock' - **variantName** (string) - Optional - Variant name ### Response #### Success Response (200) - **totalCount** (number) - Total count of products #### Response Example { "totalCount": 155 } ``` -------------------------------- ### GET ciceksepeti.product.batchStatus Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Checks the status of a previously submitted batch operation. ```APIDOC ## GET ciceksepeti.product.batchStatus ### Description Checks batch status using the batchId returned from update or create operations. ### Parameters #### Path Parameters - **batchId** (string) - Required - The batch ID to check ### Response #### Success Response (200) - **batchId** (string) - The batch ID - **itemCount** (number) - Number of items in batch - **items** (array) - Status details of items #### Response Example { "batchId": "...", "itemCount": 123, "items": [] } ``` -------------------------------- ### GET /product/list Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Retrieves a paginated list of products from the store with optional filtering by status, sorting, and search parameters. ```APIDOC ## GET /product/list ### Description Retrieves a paginated list of products from your Çiçeksepeti store with optional filtering by status, sorting, and search parameters. ### Method GET ### Parameters #### Query Parameters - **status** (string) - Optional - Filter by status ('draft', 'waiting_for_approval', 'published', 'rejected', 'passive', 'published_waiting_for_approval', 'out_of_stock') - **page** (number) - Optional - Page number for pagination - **pageSize** (number) - Optional - Number of items per page - **sortBy** (string) - Optional - Sort order ('name_asc', 'name_desc', 'stock_asc', 'stock_desc', 'price_asc', 'price_desc', 'created_date_asc', 'created_date_desc') - **stockCode** (string) - Optional - Filter by specific stock code - **variantName** (string) - Optional - Filter by variant name ### Response #### Success Response (200) - **totalCount** (number) - Total number of products matching criteria - **products** (array) - List of product objects ``` -------------------------------- ### Get Product Details by Stock Code Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Retrieve comprehensive details for a single product using its unique stock code. Handles potential errors if the product is not found. ```javascript const Ciceksepeti = require('ciceksepeti-api'); const ciceksepeti = new Ciceksepeti({ apiKey: 'your-api-key' }); try { const product = await ciceksepeti.product.get({ stockCode: 'SKU-12345' }); console.log('Product Name:', product.productName); console.log('Category:', product.categoryName); console.log('Stock:', product.StockQuantity); console.log('Price:', product.SalesPrice); console.log('Status:', product.productStatusType); // Output: Full product object with all attributes } catch (error) { console.error('Product not found:', error.message); } ``` -------------------------------- ### Get Order Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Retrieves a specific order by its order number. ```APIDOC ## Get Order ### Description Retrieves a specific order by its order number. ### Method GET ### Endpoint /api/orders/{orderNo} ### Parameters #### Path Parameters - **orderNo** (number) - Required - The order number to retrieve. #### Query Parameters - **orderItemNo** (number) - Optional - The order item number to retrieve. ### Response #### Success Response (200) - **orderId** (number) - The unique identifier for the order. - ... (other order details) #### Response Example ```json { "orderId": 123456789, "...": "..." } ``` ``` -------------------------------- ### GET /batch-status/{batchId} Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Retrieves the processing status of a product batch operation. ```APIDOC ## GET /batch-status/{batchId} ### Description Retrieves the processing status of a product batch operation (create, update, or stock/price update). ### Parameters #### Path Parameters - **batchId** (string) - Required - The ID returned from a previous operation ### Response #### Success Response (200) - **batchId** (string) - The batch ID - **itemCount** (number) - Total items processed - **items** (array) - List of item statuses including data, status, and failureReasons ``` -------------------------------- ### Batch Status Response Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Example response structure for checking the status of a batch operation. ```js { batchId: '...', itemCount: 123, items: [], } ``` -------------------------------- ### GET /orders Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Retrieves a list of orders based on date range, status, or specific identifiers. ```APIDOC ## GET /orders ### Description Retrieves orders with filtering by date range, status, or specific order numbers. Date range cannot exceed 14 days. ### Query Parameters - **startDate** (string) - Optional - Start date for filtering (YYYY-MM-DD) - **endDate** (string) - Optional - End date for filtering (YYYY-MM-DD) - **pageSize** (number) - Optional - Number of results per page - **page** (number) - Optional - Page index - **status** (string) - Optional - Order status ('new', 'preparing', 'shipped', 'will_be_shipped', 'delivered') - **orderNo** (number) - Optional - Specific order number - **orderItemNo** (number) - Optional - Specific order item number ### Response #### Success Response (200) - **totalCount** (number) - Total number of orders found - **totalPages** (number) - Total number of pages - **orders** (array) - List of order objects ``` -------------------------------- ### GET /product/count Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Returns the total count of products matching the specified filter criteria. ```APIDOC ## GET /product/count ### Description Returns the total count of products matching the specified filter criteria. ### Method GET ### Parameters #### Query Parameters - **status** (string) - Optional - Filter by status - **variantName** (string) - Optional - Filter by variant name ### Response #### Success Response (200) - **totalCount** (number) - Total count of products ``` -------------------------------- ### Get Category Attributes Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Fetches required attributes and valid values for a specific category, which are necessary for product creation. ```javascript const Ciceksepeti = require('ciceksepeti-api'); const ciceksepeti = new Ciceksepeti({ apiKey: 'your-api-key' }); const attributes = await ciceksepeti.category.attributes({ id: 12345 }); console.log('Category:', attributes.categoryName); console.log('Category ID:', attributes.categoryId); attributes.categoryAttributes.forEach(attr => { console.log(`\nAttribute: ${attr.attributeName} (ID: ${attr.attributeId})`); console.log(`Required: ${attr.required}`); console.log(`Varianter: ${attr.varianter}`); console.log(`Type: ${attr.type}`); console.log('Values:'); attr.attributeValues.forEach(val => { console.log(` - ${val.name} (ID: ${val.id})`); }); }); // Use these attribute IDs when creating products: // attributes: [{ id: attributeId, valueId: attributeValueId, textLength: 0 }] ``` -------------------------------- ### GET ciceksepeti.canceledOrder.list Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Retrieves a list of canceled orders based on specified filters. ```APIDOC ## GET ciceksepeti.canceledOrder.list ### Description Gets canceled orders on Çiçeksepeti. ### Parameters #### Query Parameters - **orderItemStatus** (enum) - Optional - 'return_started', 'return_in_cargo', 'return_in_supplier', 'return_waiting_for_supplier_approval' - **pageSize** (number) - Required - Number of items per page - **page** (number) - Required - Page number - **startDate** (string) - Optional - Start date filter - **endDate** (string) - Optional - End date filter ### Response #### Success Response (200) - **orderItemsList** (array) - List of canceled order items ``` -------------------------------- ### GET /orders/{orderNo} Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Retrieves detailed information for a specific order by order number. ```APIDOC ## GET /orders/{orderNo} ### Description Retrieves detailed information for a specific order by order number. ### Parameters #### Path Parameters - **orderNo** (number) - Required - The order number to retrieve #### Query Parameters - **orderItemNo** (number) - Optional - Specific order item number ### Response #### Success Response (200) - **orderId** (number) - Order ID - **receiverName** (string) - Receiver name - **receiverAddress** (string) - Delivery address - **receiverCity** (string) - City - **receiverPhone** (string) - Phone number - **name** (string) - Product name - **quantity** (number) - Quantity - **totalPrice** (number) - Total price - **deliveryDate** (string) - Delivery date - **cardMessage** (string) - Card message - **orderProductStatus** (string) - Status ``` -------------------------------- ### GET /orders/count Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Returns the total count of orders matching specified criteria within a date range. ```APIDOC ## GET /orders/count ### Description Returns the total count of orders matching specified criteria within a date range. ### Query Parameters - **startDate** (string) - Required - Start date (YYYY-MM-DD) - **endDate** (string) - Required - End date (YYYY-MM-DD) - **status** (string) - Optional - Filter by status - **isOrderStatusActive** (boolean) - Optional - Filter by active status ### Response #### Success Response (200) - **totalCount** (number) - Total count of matching orders ``` -------------------------------- ### Count Products by Filter Criteria Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Get the total count of products that match specific filter criteria. This is useful for understanding inventory or product status without retrieving full product details. ```javascript const Ciceksepeti = require('ciceksepeti-api'); const ciceksepeti = new Ciceksepeti({ apiKey: 'your-api-key' }); // Count all published products const count = await ciceksepeti.product.count({ status: 'published' }); console.log(`Published products: ${count.totalCount}`); // Output: { totalCount: 155 } // Count out of stock products const outOfStock = await ciceksepeti.product.count({ status: 'out_of_stock', variantName: 'Birthday Special' }); ``` -------------------------------- ### Get Order Details by Order Number Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Retrieves detailed information for a specific order using its order number. Can also retrieve details for a specific order item within an order. ```javascript const Ciceksepeti = require('ciceksepeti-api'); const ciceksepeti = new Ciceksepeti({ apiKey: 'your-api-key' }); const order = await ciceksepeti.order.get({ orderNo: 123456789 }); console.log('Order ID:', order.orderId); console.log('Receiver:', order.receiverName); console.log('Address:', order.receiverAddress); console.log('City:', order.receiverCity); console.log('Phone:', order.receiverPhone); console.log('Product:', order.name); console.log('Quantity:', order.quantity); console.log('Total Price:', order.totalPrice); console.log('Delivery Date:', order.deliveryDate); console.log('Card Message:', order.cardMessage); console.log('Status:', order.orderProductStatus); // Get specific order item const orderItem = await ciceksepeti.order.get({ orderNo: 123456789, orderItemNo: 111222333 }); ``` -------------------------------- ### Initialize Ciceksepeti client Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/README.md Create a new instance by providing an object containing your API key. ```js const Ciceksepeti = require('ciceksepeti-api') const ciceksepeti = new Ciceksepeti({ apiKey: 'your-api-key', }) ``` -------------------------------- ### Create Products with Çiçeksepeti API Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Initializes a new product creation request and checks the resulting batch status. Requires valid API credentials and product details. ```javascript const Ciceksepeti = require('ciceksepeti-api'); const ciceksepeti = new Ciceksepeti({ apiKey: 'your-api-key' }); const newProducts = [ { productName: 'Red Rose Bouquet', mainProductCode: 'ROSE-MAIN-001', stockCode: 'ROSE-RED-001', categoryId: 12345, description: 'Beautiful arrangement of 12 fresh red roses', mediaLink: 'https://example.com/video.mp4', deliveryType: 'with_cargo', deliveryMessageType: 'gift_cargo_same_day', stockQuantity: 100, salesPrice: 299.99, listPrice: 399.99, barcode: '8901234567890', images: [ 'rose-bouquet-main.jpg', 'rose-bouquet-detail.jpg' ], attributes: [ { id: 2000353, valueId: 2010697, textLength: 0 } ] } ]; const result = await ciceksepeti.product.create(newProducts); console.log('Batch ID:', result.batchId); // Output: { batchId: 'abc123-def456-...' } // Check the status of product creation const status = await ciceksepeti.product.batchStatus(result.batchId); console.log('Creation status:', status); // deliveryType options: 'with_service', 'with_cargo', 'with_service_and_cargo' // deliveryMessageType options: 'cicek_service', 'gift_cargo_same_day', 'gift_cargo_1_3_days', 'gift_cargo_1_2_days' ``` -------------------------------- ### POST ciceksepeti.product.create Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Creates new products on the platform. ```APIDOC ## POST ciceksepeti.product.create ### Description Creates new products on Çiçeksepeti. ### Parameters #### Request Body - **items** (array) - Required - List of new product objects ### Response #### Success Response (200) - **batchId** (string) - ID of the creation batch #### Response Example { "batchId": "..." } ``` -------------------------------- ### POST /products Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Creates new products on the platform and returns a batch ID for tracking. ```APIDOC ## POST /products ### Description Creates new products on Çiçeksepeti. Returns a batch ID for tracking the creation status. ### Request Body - **productName** (string) - Required - Name of the product - **mainProductCode** (string) - Required - Main product identifier - **stockCode** (string) - Required - Unique stock identifier - **categoryId** (number) - Required - Category ID - **description** (string) - Required - Product description - **mediaLink** (string) - Optional - URL for media - **deliveryType** (string) - Required - Options: 'with_service', 'with_cargo', 'with_service_and_cargo' - **deliveryMessageType** (string) - Required - Options: 'cicek_service', 'gift_cargo_same_day', 'gift_cargo_1_3_days', 'gift_cargo_1_2_days' - **stockQuantity** (number) - Required - Initial stock count - **salesPrice** (number) - Required - Selling price - **listPrice** (number) - Required - List price - **barcode** (string) - Required - Product barcode - **images** (array) - Required - List of image filenames - **attributes** (array) - Required - List of product attributes ### Response #### Success Response (200) - **batchId** (string) - Unique identifier for the batch operation ``` -------------------------------- ### Answer Seller Questions Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Responds to customer questions using various branch actions. Requires an initialized Ciceksepeti client. ```javascript const Ciceksepeti = require('ciceksepeti-api'); const ciceksepeti = new Ciceksepeti({ apiKey: 'your-api-key' }); // Public answer to a question await ciceksepeti.sellerquestion.answer(123456, { answer: 'Yes, this bouquet includes 12 fresh red roses and comes with a complimentary vase.', branchAction: 'answer_question' }); // Private answer (not visible to other customers) await ciceksepeti.sellerquestion.answer(123456, { answer: 'Please contact our support for order-specific inquiries.', branchAction: 'answer_question_private', branchActionDetail: 'question_is_about_order' }); // Report inappropriate question await ciceksepeti.sellerquestion.answer(123456, { branchAction: 'inappropriate_question', branchDescription: 'This question contains inappropriate content.' }); // Mark as belonging to another seller await ciceksepeti.sellerquestion.answer(123456, { branchAction: 'question_belongs_to_another_seller' }); // branchAction options: // 'answer_question' - Public answer (requires answer) // 'answer_question_private' - Private answer (requires answer + branchActionDetail) // 'inappropriate_question' - Report question (requires branchDescription) // 'question_belongs_to_another_seller' - Redirect question // branchActionDetail options (for private answers): // 'answered_before', 'question_is_about_order', 'other' ``` -------------------------------- ### Ciceksepeti Constructor Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/README.md Details on how to create a new Ciceksepeti instance, including required options and potential exceptions. ```APIDOC ## `Ciceksepeti(options)` ### Description Creates a new `Ciceksepeti` instance. ### Arguments - `options` - Required - A plain JavaScript object that contains the configuration options. ### Options - `apiKey` - A string that specifies the API key of the app. ### Return value A `Ciceksepeti` instance. ### Exceptions Throws an `Error` exception if the required options are missing. ``` -------------------------------- ### Create Product Item Structure Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Schema for items used in product creation operations. ```js { productName: "Test urunu", // required mainProductCode: "testmain2", // required stockCode: "test2", // required description: "test acıklaması", // required mediaLink: "test", deliveryMessageType: "gift_cargo_same_day", // required deliveryType: "with_cargo", // required stockQuantity: 25, // required salesPrice: 56.99, // required listPrice: 99.99, // required barcode: "test123", images: [ "test-test-kc6500945-1-392bf4631cf04904a3f0df31a6c10642.jpg" ], attributes: [ { "id": 2000353, "valueId": 2010697, "textLength": 0 } ] } ``` -------------------------------- ### PUT /products Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Updates existing product information using a batch operation. ```APIDOC ## PUT /products ### Description Updates existing product information. Returns a batch ID for tracking. ### Request Body - **productName** (string) - Optional - Updated name - **mainProductCode** (string) - Required - Main product identifier - **stockCode** (string) - Required - Unique stock identifier - **isActive** (boolean) - Optional - Active status - **description** (string) - Optional - Updated description - **deliveryType** (string) - Optional - Updated delivery type - **deliveryMessageType** (string) - Optional - Updated delivery message type - **images** (array) - Optional - Updated image list - **barcode** (string) - Optional - Updated barcode - **attributes** (array) - Optional - Updated attributes ### Response #### Success Response (200) - **batchId** (string) - Unique identifier for the batch operation ``` -------------------------------- ### List Products with Filtering and Sorting Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Retrieve a paginated list of products, optionally filtering by status, sorting by various criteria, and searching by stock code or variant name. Available status options include 'draft', 'published', 'passive', etc. Available sortBy options include 'price_asc', 'stock_desc', etc. ```javascript const Ciceksepeti = require('ciceksepeti-api'); const ciceksepeti = new Ciceksepeti({ apiKey: 'your-api-key' }); // List all published products, sorted by price descending const result = await ciceksepeti.product.list({ status: 'published', page: 1, pageSize: 50, sortBy: 'price_desc' }); console.log(`Total products: ${result.totalCount}`); console.log(result.products); // Output: { totalCount: 155, products: [...] } // Filter by stock code or variant name const filteredResult = await ciceksepeti.product.list({ stockCode: 'SKU-12345', variantName: 'Red Rose Bouquet' }); // Available status options: // 'draft', 'waiting_for_approval', 'published', 'rejected', // 'passive', 'published_waiting_for_approval', 'out_of_stock' // Available sortBy options: // 'name_asc', 'name_desc', 'stock_asc', 'stock_desc', // 'price_asc', 'price_desc', 'created_date_asc', 'created_date_desc' ``` -------------------------------- ### List Seller Questions Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Retrieves customer questions with support for filtering by date, status, product code, or specific ID. ```javascript const Ciceksepeti = require('ciceksepeti-api'); const ciceksepeti = new Ciceksepeti({ apiKey: 'your-api-key' }); // Get unanswered questions from the last month const questions = await ciceksepeti.sellerquestion.list({ startDate: '2024-01-01', endDate: '2024-01-31', answered: false, page: 1 }); console.log('Has more pages:', questions.hasNextPage); questions.items.forEach(q => { console.log(`Question ID: ${q.id}`); console.log(`Product: ${q.product.name}`); console.log(`Question: ${q.question}`); console.log(`Date: ${q.questionDate}`); console.log('---'); }); // Get questions for a specific product const productQuestions = await ciceksepeti.sellerquestion.list({ productCode: 'ROSE-RED-001', page: 1, startDate: '2024-01-01', endDate: '2024-01-31' }); // Get a specific question by ID const specificQuestion = await ciceksepeti.sellerquestion.list({ id: 123456, page: 1 }); ``` -------------------------------- ### POST ciceksepeti.product.update Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Updates existing product details. ```APIDOC ## POST ciceksepeti.product.update ### Description Updates products. ### Parameters #### Request Body - **items** (array) - Required - List of product objects to update ### Response #### Success Response (200) - **batchId** (string) - ID of the update batch #### Response Example { "batchId": "..." } ``` -------------------------------- ### POST ciceksepeti.product.updateStockOrPrice Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Updates stock or price of products in a batch. ```APIDOC ## POST ciceksepeti.product.updateStockOrPrice ### Description Updates stock or price of products. Note: You cannot update stock and price simultaneously, and listPrice requires salesPrice. ### Parameters #### Request Body - **items** (array) - Required - List of items to update ### Response #### Success Response (200) - **batchId** (string) - ID of the update batch #### Response Example { "batchId": "..." } ``` -------------------------------- ### POST ciceksepeti.sellerquestion.answer Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Submits an answer to a specific seller question. ```APIDOC ## POST ciceksepeti.sellerquestion.answer ### Description Answers a seller question on Çiçeksepeti. ### Parameters #### Path Parameters - **id** (number) - Required - The id of the question. ### Request Body - **answer** (string) - Optional - **branchAction** (enum) - Optional - "answer_question", "answer_question_private", "inappropriate_question", "question_belongs_to_another_seller" - **branchActionDetail** (enum) - Optional - "answered_before", "question_is_about_order", "other" - **branchDescription** (string) - Optional ``` -------------------------------- ### List Product Categories Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Retrieves the full hierarchical structure of product categories available on the platform. ```javascript const Ciceksepeti = require('ciceksepeti-api'); const ciceksepeti = new Ciceksepeti({ apiKey: 'your-api-key' }); const categories = await ciceksepeti.category.list(); console.log('Categories:', categories.categories); // Display category tree function printCategories(cats, indent = 0) { cats.forEach(cat => { console.log(' '.repeat(indent) + `${cat.id}: ${cat.name}`); if (cat.subCategories && cat.subCategories.length > 0) { printCategories(cat.subCategories, indent + 1); } }); } printCategories(categories.categories); // Output: { categories: [{ id, name, parentCategoryId, subCategories: [...] }] } ``` -------------------------------- ### List Seller Questions Response Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md The expected JSON response structure when retrieving a list of seller questions. ```js { items: item[], hasNextPage: true, } ``` -------------------------------- ### POST ciceksepeti.cargo.sendWithCiceksepeti Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Initiates a shipment using the Ciceksepeti cargo service. ```APIDOC ## POST ciceksepeti.cargo.sendWithCiceksepeti ### Description Sends a cargo using Çiçek Sepeti's cargo service. ### Request Body - **orderItemIds** (array) - Required - Array of orderItemId (number). ``` -------------------------------- ### Update Product Stock or Price Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Updates either stock quantities or prices for multiple products. Stock and price cannot be updated in the same request. ```javascript const Ciceksepeti = require('ciceksepeti-api'); const ciceksepeti = new Ciceksepeti({ apiKey: 'your-api-key' }); // Update stock quantities const stockUpdates = [ { stockCode: 'ROSE-RED-001', stockQuantity: 150 }, { stockCode: 'ROSE-WHITE-001', stockQuantity: 75 } ]; const stockResult = await ciceksepeti.product.updateStockOrPrice(stockUpdates); console.log('Stock update batch:', stockResult.batchId); // Update prices (listPrice requires salesPrice) const priceUpdates = [ { stockCode: 'ROSE-RED-001', salesPrice: 349.99, listPrice: 449.99 }, { stockCode: 'ROSE-WHITE-001', salesPrice: 299.99, listPrice: 399.99 } ]; const priceResult = await ciceksepeti.product.updateStockOrPrice(priceUpdates); console.log('Price update batch:', priceResult.batchId); // Check batch status const status = await ciceksepeti.product.batchStatus(priceResult.batchId); console.log('Items processed:', status.itemCount); console.log('Item statuses:', status.items); // Output: { batchId: '...', itemCount: 2, items: [...] } ``` -------------------------------- ### List Orders with Filters Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Retrieves orders by filtering through date range, status, or specific order numbers. The date range cannot exceed 14 days. Available status options include 'new', 'preparing', 'shipped', 'will_be_shipped', and 'delivered'. ```javascript const Ciceksepeti = require('ciceksepeti-api'); const ciceksepeti = new Ciceksepeti({ apiKey: 'your-api-key' }); // List orders within a date range const orders = await ciceksepeti.order.list({ startDate: '2024-01-01', endDate: '2024-01-14', pageSize: 50, page: 0, status: 'new' }); console.log(`Total orders: ${orders.totalCount}`); console.log(`Total pages: ${orders.totalPages}`); orders.orders.forEach(order => { console.log(`Order #${order.orderId} - ${order.receiverName} - ${order.totalPrice}`); }); // Get order by order number (no date range required) const specificOrder = await ciceksepeti.order.list({ orderNo: 123456789, pageSize: 1, page: 0 }); // Get order by order item number const itemOrder = await ciceksepeti.order.list({ orderItemNo: 987654321, pageSize: 1, page: 0 }); // Available status options: 'new', 'preparing', 'shipped', 'will_be_shipped', 'delivered' ``` -------------------------------- ### Update Stock or Price Item Structure Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Schema for items used in stock or price updates. ```js { stockCode: '...', stockQuantity: 123, listPrice: 123, salesPrice: 123, } ``` -------------------------------- ### List Orders Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Lists orders on Çiçeksepeti with various filtering options. ```APIDOC ## List Orders ### Description Lists orders on Çiçeksepeti with various filtering options. ### Method GET ### Endpoint /api/orders ### Parameters #### Query Parameters - **startDate** (string) - Optional - Start date for filtering orders. - **endDate** (string) - Optional - End date for filtering orders. - **pageSize** (number) - Required - Number of orders per page. - **page** (number) - Required - Page number. - **status** (enum) - Optional - Filter by order status ('new', 'preparing', 'shipped', 'will_be_shipped', 'delivered'). - **orderNo** (string) - Optional - Filter by order number. - **orderItemNo** (string) - Optional - Filter by order item number. - **isOrderStatusActive** (bool) - Optional - Filter by active order status. ### Response #### Success Response (200) - **totalCount** (number) - Total number of orders. - **totalPages** (number) - Total number of pages. - **orders** (array) - Array of order objects. #### Response Example ```json { "totalCount": 123, "totalPages": 4, "orders": [] } ``` ``` -------------------------------- ### Update Existing Products Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Updates product information for existing items. Returns a batch ID to track the update progress. ```javascript const Ciceksepeti = require('ciceksepeti-api'); const ciceksepeti = new Ciceksepeti({ apiKey: 'your-api-key' }); const productsToUpdate = [ { productName: 'Premium Red Rose Bouquet', mainProductCode: 'ROSE-MAIN-001', stockCode: 'ROSE-RED-001', isActive: true, description: 'Premium arrangement of 12 fresh red roses with elegant packaging', deliveryType: 'with_cargo', deliveryMessageType: 'gift_cargo_same_day', images: [ 'rose-bouquet-main-v2.jpg', 'rose-bouquet-detail-v2.jpg', 'rose-bouquet-packaging.jpg' ], barcode: '8901234567890', attributes: [ { id: 2000353, valueId: 2010697, textLength: 0 } ] } ]; const result = await ciceksepeti.product.update(productsToUpdate); console.log('Update Batch ID:', result.batchId); // Output: { batchId: 'xyz789-...' } ``` -------------------------------- ### Batch Operation Response Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Standard response format for batch update or creation operations. ```js { batchId: '...' } ``` -------------------------------- ### POST /orders/invoice Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Sends invoice documents to customers for completed orders. ```APIDOC ## POST /orders/invoice ### Description Sends invoice documents to customers for completed orders. Supports both base64 documents and URL links. ### Request Body - **invoiceItems** (array) - Required - List of invoice objects containing orderItemId and either documentUrl or document (base64) ``` -------------------------------- ### PUT /products/stock-or-price Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Updates stock quantities or prices for multiple products. Note: Stock and price cannot be updated in the same request. ```APIDOC ## PUT /products/stock-or-price ### Description Updates stock quantities or prices for multiple products. ### Request Body - **stockCode** (string) - Required - Unique stock identifier - **stockQuantity** (number) - Optional - New stock quantity - **salesPrice** (number) - Optional - New sales price - **listPrice** (number) - Optional - New list price (required if salesPrice is provided) ### Response #### Success Response (200) - **batchId** (string) - Unique identifier for the batch operation ``` -------------------------------- ### Update Product Item Structure Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Schema for items used in product update operations. ```js { productName: "Test urunu", // required mainProductCode: "testmain2", // required stockCode: "test2", // required isActive: true, // required description: "test acıklaması", // required mediaLink: "test", deliveryMessageType: "gift_cargo_same_day", // required deliveryType: "with_cargo", // required barcode: "test123", images: [ "test-test-kc6500945-1-392bf4631cf04904a3f0df31a6c10642.jpg" ], attributes: [ { "id": 2000353, "valueId": 2010697, "textLength": 0 } ] } ``` -------------------------------- ### POST /cargo/measurements Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Submits cargo measurement data (deci/volume) for order items. ```APIDOC ## POST /cargo/measurements ### Description Submits cargo measurement data (deci/volume) for order items. ### Request Body - **measurements** (array) - Required - List of objects containing orderProductId, deci, and quantity ``` -------------------------------- ### POST ciceksepeti.cargo.changeCompany Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Updates the cargo company associated with order products. ```APIDOC ## POST ciceksepeti.cargo.changeCompany ### Description Changes the cargo company for specified order products. ### Request Body - **items** (array) - Required - Array of objects containing orderProductId (number) and cargoCompany (enum: mng_kargo, yurtici_Kargo, surat_kargo, aras_kargo, ptt_kargo, ups_kargo, horoz_lojistik, borusan_lojistik). ``` -------------------------------- ### POST ciceksepeti.cargo.sendMeasurements Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Updates cargo measurements for specific order products. ```APIDOC ## POST ciceksepeti.cargo.sendMeasurements ### Description Changes cargo measurement for a list of order items. ### Request Body - **items** (array) - Required - Array of objects containing orderProductId (number), deci (number), and quantity (number). ``` -------------------------------- ### Send Invoice Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Sends an invoice to the customer for specified order items. ```APIDOC ## Send Invoice ### Description Sends an invoice to the customer for specified order items. ### Method POST ### Endpoint /api/orders/invoice ### Parameters #### Request Body - **items** (array) - Required - An array of objects, each representing an order item for which to send an invoice. - **orderItemId** (number) - Required - The ID of the order item. - **document** (string) - Optional - The invoice document in base64 format or as a PDF file. - **documentUrl** (string) - Optional - A URL pointing to the invoice document. **Note:** Either `document` or `documentUrl` must be provided for each item. ### Request Example ```json { "items": [ { "orderItemId": 12345, "document": "JVBERi0xLjQKJc..." }, { "orderItemId": 67890, "documentUrl": "http://example.com/invoice.pdf" } ] } ``` ### Response #### Success Response (200) - (Details of the success response would be specified here, e.g., confirmation message or status) #### Response Example ```json { "message": "Invoices sent successfully." } ``` ``` -------------------------------- ### Send Invoice via URL or Base64 Source: https://context7.com/coskntkk/ciceksepeti-api/llms.txt Sends invoice documents to customers for completed orders. Supports providing documents via a URL or as a base64 encoded string. Use either 'document' or 'documentUrl', not both. ```javascript const Ciceksepeti = require('ciceksepeti-api'); const fs = require('fs'); const ciceksepeti = new Ciceksepeti({ apiKey: 'your-api-key' }); // Send invoice via URL const invoiceItems = [ { orderItemId: 123456789, documentUrl: 'https://your-server.com/invoices/invoice-123456789.pdf' } ]; await ciceksepeti.order.sendInvoice(invoiceItems); console.log('Invoice sent via URL'); // Send invoice via base64 encoded document const pdfBuffer = fs.readFileSync('invoice.pdf'); const base64Doc = pdfBuffer.toString('base64'); const invoiceWithDoc = [ { orderItemId: 987654321, document: base64Doc } ]; await ciceksepeti.order.sendInvoice(invoiceWithDoc); console.log('Invoice sent via document'); // Note: Use either 'document' OR 'documentUrl', not both ``` -------------------------------- ### POST ciceksepeti.canceledOrder.approveOrReject Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Approves or rejects a specific canceled order item. ```APIDOC ## POST ciceksepeti.canceledOrder.approveOrReject ### Description Approves or rejects the canceled order item by the seller. ### Parameters #### Request Body - **orderItemId** (number) - Required - ID of the order item - **process** (enum) - Required - 'approve' or 'reject' ### Response #### Success Response (200) - **isSuccess** (boolean) - Status of the operation - **message** (string) - Result message ``` -------------------------------- ### POST ciceksepeti.canceledOrder.recieved Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md Confirms that the canceled order items have been received by the seller. ```APIDOC ## POST ciceksepeti.canceledOrder.recieved ### Description Approves that the order item is received by the seller. ### Parameters #### Request Body - **orderItemIds** (number[]) - Required - List of order item IDs ### Response #### Success Response (200) - **orderItems** (array) - List of processed order items ``` -------------------------------- ### List Canceled Orders Response Source: https://github.com/coskntkk/ciceksepeti-api/blob/main/documentation.md The expected response structure when retrieving a list of canceled orders. ```js { orderItemsList: orderItem[], } ```