{
    "name": "Toptex",
    "app_type": "toptex",
    "sync_type": "api",
    "operation_type": "import-export",
    "is_active": true,
    "debug_mode": true,
    "authorization": {
        "auth_type": "custom",
        "auth_settings": {
            "request_settings": {
                "url": "https://api.toptex.io/v3/authenticate",
                "body": {
                    "data": {
                        "password": "<password>",
                        "username": "<username>"
                    },
                    "type": "json"
                },
                "method": "post",
                "headers": {
                    "x-api-key": "Yy8RVaECFt3zrtdiKP9FfawfCTjYLvdv1u52SiKr",
                    "Content-Type": "application/json"
                },
                "expires_in_key": "3599",
                "authorization_header_name": "x-toptex-authorization"
            },
            "response_settings": {
                "token_key": "token",
                "token_type": "",
                "expires_in_key": "3600",
                "expires_in_value": "3599",
                "authorization_header_name": "x-toptex-authorization"
            }
        }
    },
    "connections": [
        {
            "name": "Products",
            "type": "api",
            "is_active": true,
            "is_primary": true,
            "resource_type": "product",
            "priority": 1,
            "configuration": {
                "body": {
                    "data": null,
                    "type": "none"
                },
                "method": "GET",
                "headers": {
                    "x-api-key": "Yy8RVaECFt3zrtdiKP9FfawfCTjYLvdv1u52SiKr"
                },
                "endpoint": "https://api.toptex.io/v3/products/all?usage_right=b2b_uniquement",
                "auth_enabled": true,
                "prerequisites": {
                    "product_response": "items",
                    "variable_response": {
                        "variable_path": "colors",
                        "nested_variations": {
                            "is_active": true,
                            "attribute_key": "sizes"
                        }
                    },
                    "main_product_unique_identifier": "catalogReference",
                    "variable_product_unique_identifier": "sizes->sku"
                },
                "advanced_configuration": {
                    "time_delay": ""
                }
            }
        },
        {
            "name": "Pricing",
            "type": "api",
            "is_active": true,
            "is_primary": false,
            "resource_type": "product",
            "priority": 2,
            "configuration": {
                "body": {
                    "data": null,
                    "type": "none"
                },
                "method": "GET",
                "headers": {
                    "x-api-key": "Yy8RVaECFt3zrtdiKP9FfawfCTjYLvdv1u52SiKr"
                },
                "endpoint": "https://api.toptex.io/v3/products/price",
                "auth_enabled": true,
                "prerequisites": {
                    "product_response": "items",
                    "prerequisite_type": "no-variations",
                    "prerequisite_variation_type": "link-variations",
                    "variable_response": null,
                    "main_product_unique_identifier": "sku",
                    "variable_product_unique_identifier": ""
                },
                "advanced_configuration": {
                    "time_delay": ""
                }
            }
        },
        {
            "name": "Inventory",
            "type": "api",
            "is_active": true,
            "is_primary": false,
            "resource_type": "product",
            "priority": 3,
            "configuration": {
                "body": {
                    "data": null,
                    "type": "none"
                },
                "method": "GET",
                "headers": {
                    "x-api-key": "Yy8RVaECFt3zrtdiKP9FfawfCTjYLvdv1u52SiKr"
                },
                "endpoint": "https://api.toptex.io/v3/products/inventory",
                "auth_enabled": true,
                "prerequisites": {
                    "product_response": "items",
                    "variable_response": null,
                    "main_product_unique_identifier": "sku",
                    "variable_product_unique_identifier": ""
                },
                "advanced_configuration": {
                    "time_delay": ""
                }
            }
        }
    ],
    "attribute_mapping": [
        {
            "connection": "Products",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "description",
            "supplier_attribute": "description-><lang>+##<br>##+##<ul><li>##+salesArguments-><lang>+##</li><li>##+salesArguments2-><lang>+##</li><li>##+salesArguments3-><lang>+##</li></ul>##",
            "advanced_configuration": {
                "translation": {
                    "is_active": false,
                    "attributes": [
                        {
                            "apiValue": "",
                            "condition": "equals",
                            "translatedValue": ""
                        }
                    ]
                },
                "add_during_sync": true,
                "update_during_sync": true,
                "fetch_from_other_api": {
                    "is_active": false,
                    "connection": ""
                }
            }
        },
        {
            "connection": "Products",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "images",
            "supplier_attribute": "images",
            "advanced_configuration": {
                "translation": {
                    "is_active": false,
                    "attributes": [
                        {
                            "apiValue": "",
                            "condition": "equals",
                            "translatedValue": ""
                        }
                    ]
                },
                "image_src_attr": "url_image",
                "add_during_sync": true,
                "image_path_attr": "",
                "update_during_sync": true,
                "fetch_from_other_api": {
                    "is_active": false,
                    "connection": ""
                }
            }
        },
        {
            "connection": "Products",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "name",
            "supplier_attribute": "designation-><lang>",
            "advanced_configuration": {
                "translation": {
                    "is_active": false,
                    "attributes": [
                        {
                            "apiValue": "",
                            "condition": "equals",
                            "translatedValue": ""
                        }
                    ]
                },
                "add_during_sync": true,
                "update_during_sync": true,
                "fetch_from_other_api": {
                    "is_active": false,
                    "connection": ""
                }
            }
        },
        {
            "connection": "Pricing",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "regular_price",
            "supplier_attribute": "prices->0->price",
            "advanced_configuration": {
                "translation": {
                    "is_active": false,
                    "attributes": [
                        {
                            "apiValue": "",
                            "condition": "equals",
                            "translatedValue": ""
                        }
                    ]
                },
                "tier_pricing": {
                    "base_path": "",
                    "is_active": false,
                    "format_type": "key-value",
                    "configuration": [],
                    "use_discount_percentage": false
                },
                "add_during_sync": true,
                "update_during_sync": true,
                "price_margin_config": {
                    "amount": "",
                    "operator": "",
                    "is_active": false
                },
                "fetch_from_other_api": {
                    "is_active": false,
                    "connection": ""
                }
            }
        },
        {
            "connection": "Products",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "sku",
            "supplier_attribute": "catalogReference",
            "advanced_configuration": {
                "translation": {
                    "is_active": false,
                    "attributes": [
                        {
                            "apiValue": "",
                            "condition": "equals",
                            "translatedValue": ""
                        }
                    ]
                },
                "add_during_sync": true,
                "update_during_sync": true,
                "fetch_from_other_api": {
                    "is_active": false,
                    "connection": ""
                }
            }
        },
        {
            "connection": "Inventory",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "stock_quantity",
            "supplier_attribute": "warehouses->0->stock",
            "advanced_configuration": {
                "translation": {
                    "is_active": false,
                    "attributes": [
                        {
                            "apiValue": "",
                            "condition": "equals",
                            "translatedValue": ""
                        }
                    ]
                },
                "add_during_sync": true,
                "update_during_sync": true,
                "fetch_from_other_api": {
                    "is_active": false,
                    "connection": ""
                }
            }
        }
    ],
    "operations": [
        {
            "operation": "product-operations",
            "operation_type": "data-sync",
            "is_active": true,
            "configuration": {
                "available_products": {
                    "add": true,
                    "update": true,
                    "product_status": "publish",
                    "update_product_status": false
                },
                "unavailable_products": {
                    "operation": "none",
                    "products_of": "none"
                }
            },
            "connections": [
                "Products"
            ]
        },
        {
            "operation": "product-operations",
            "operation_type": "data-sync",
            "is_active": true,
            "configuration": {
                "available_products": {
                    "add": false,
                    "update": true,
                    "product_status": "publish",
                    "update_product_status": false
                },
                "unavailable_products": {
                    "operation": "none",
                    "products_of": "none"
                }
            },
            "connections": [
                "Pricing"
            ]
        },
        {
            "operation": "product-operations",
            "operation_type": "data-sync",
            "is_active": true,
            "configuration": {
                "available_products": {
                    "add": false,
                    "update": true,
                    "product_status": "publish",
                    "update_product_status": false
                },
                "unavailable_products": {
                    "operation": "none",
                    "products_of": "none"
                }
            },
            "connections": [
                "Inventory"
            ]
        },
        {
            "operation": "page",
            "operation_type": "performance-optimization",
            "is_active": true,
            "configuration": {
                "type": "regular",
                "location": "query-parameter",
                "page_param": "page_number",
                "limit_param": "",
                "limit_value": ""
            },
            "connections": [
                "Products"
            ]
        },
        {
            "operation": "page",
            "operation_type": "performance-optimization",
            "is_active": true,
            "configuration": {
                "type": "regular",
                "location": "query-parameter",
                "page_param": "page_number",
                "limit_param": "",
                "limit_value": ""
            },
            "connections": [
                "Pricing"
            ]
        },
        {
            "operation": "page",
            "operation_type": "performance-optimization",
            "is_active": true,
            "configuration": {
                "type": "regular",
                "location": "query-parameter",
                "page_param": "page_number",
                "limit_param": "",
                "limit_value": ""
            },
            "connections": [
                "Inventory"
            ]
        }
    ]
}