{
    "name": "Trends",
    "app_type": "trends",
    "sync_type": "api",
    "is_active": true,
    "debug_mode": false,
    "authorization": {
        "auth_type": "basic",
        "auth_settings": {
            "client_id": "<username>",
            "client_secret": "<password>",
            "authorization_header_name": "Authorization"
        }
    },
    "connections": [
        {
            "name": "Categories",
            "type": "api",
            "is_active": true,
            "is_primary": false,
            "resource_type": "product",
            "priority": 1,
            "configuration": {
                "auth_enabled": true,
                "method": "GET",
                "endpoint": "https://nz.api.trends.nz/api/v1/categories.json",
                "headers": [],
                "body": {
                    "type": "none",
                    "data": null
                },
                "prerequisites": null,
                "advanced_configuration": {
                    "time_delay": ""
                }
            }
        },
        {
            "name": "Products",
            "type": "api",
            "is_active": true,
            "is_primary": true,
            "resource_type": "product",
            "priority": 2,
            "configuration": {
                "method": "GET",
                "endpoint": "https://nz.api.trends.nz/api/v1/products.json",
                "auth_enabled": true,
                "headers": [],
                "body": {
                    "type": "none",
                    "data": null
                },
                "prerequisites": {
                    "product_response": "data",
                    "variable_response": {
                        "variable_path": "images",
                        "nested_variations": {
                            "is_active": false,
                            "attribute_key": ""
                        }
                    },
                    "main_product_unique_identifier": "code",
                    "variable_product_unique_identifier": "stock_code"
                },
                "advanced_configuration": {
                    "time_delay": ""
                }
            }
        },
        {
            "name": "Stock",
            "type": "api",
            "is_active": true,
            "is_primary": false,
            "resource_type": "product",
            "priority": 3,
            "configuration": {
                "method": "GET",
                "endpoint": "https://nz.api.trends.nz/api/v1/stock/{|SKU|}.json",
                "auth_enabled": true,
                "headers": [],
                "body": {
                    "type": "none",
                    "data": null
                },
                "prerequisites": {
                    "product_response": "data",
                    "variable_response": null,
                    "main_product_unique_identifier": "stock_code",
                    "variable_product_unique_identifier": ""
                },
                "advanced_configuration": {
                    "time_delay": ""
                }
            }
        }
    ],
    "attribute_mapping": [
        {
            "connection": "Products",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "sku",
            "supplier_attribute": "code",
            "advanced_configuration": null
        },
        {
            "connection": "Products",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "name",
            "supplier_attribute": "name",
            "advanced_configuration": null
        },
        {
            "connection": "Products",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "description",
            "supplier_attribute": "description",
            "advanced_configuration": null
        },
        {
            "connection": "Products",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "regular_price",
            "supplier_attribute": "pricing->prices->0->price",
            "advanced_configuration": {
                "tier_pricing": {
                    "is_active": true,
                    "format_type": "static-keys",
                    "base_path": "pricing->prices",
                    "use_discount_percentage": false,
                    "configuration": {
                        "quantity_key": "quantity",
                        "price_key": "price"
                    }
                }
            }
        },
        {
            "connection": "Stock",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "stock_quantity",
            "supplier_attribute": "quantity",
            "advanced_configuration": null
        },
        {
            "connection": "Products",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "images",
            "supplier_attribute": "images->0->link",
            "advanced_configuration": {
                "image_src_attr": "",
                "image_path_attr": "https:"
            }
        }
    ],
    "operations": [
        {
            "operation": "product-operations",
            "operation_type": "data-sync",
            "is_active": true,
            "configuration": {
                "available_products": {
                    "add": true,
                    "update": true,
                    "update_product_status": false,
                    "product_status": "publish"
                },
                "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,
                    "update_product_status": false,
                    "product_status": "publish"
                },
                "unavailable_products": {
                    "operation": "none",
                    "products_of": "none"
                }
            },
            "connections": [
                "Stock"
            ]
        },
        {
            "operation": "batch",
            "operation_type": "performance-optimization",
            "is_active": false,
            "configuration": {
                "batch_size": 10
            },
            "connections": [
                "Products"
            ]
        },
        {
            "operation": "page",
            "operation_type": "performance-optimization",
            "is_active": true,
            "configuration": {
                "type": "regular",
                "location": "query-parameter",
                "page_param": "page_no",
                "limit_param": "page_size",
                "limit_value": "250"
            },
            "connections": [
                "Products"
            ]
        }
    ]
}