{
    "name": "Shopify",
    "app_type": "shopify",
    "sync_type": "api",
    "is_active": true,
    "debug_mode": false,
    "authorization": {
        "auth_type": "<shopify_auth_type>",
        "auth_settings": {
            "key": "X-Shopify-Access-Token",
            "secret": "<x_shopify_access_token>",
            "request_settings": {
                "access_token_url": "https://<domain>/admin/oauth/access_token",
                "client_id": "<client_id>",
                "client_secret": "<client_secret>",
                "grant_type": "client_credentials",
                "send_client_credentials": [
                    "body"
                ],
                "authorization_header_name": "X-Shopify-Access-Token"
            },
            "response_settings": {
                "token_key": "access_token",
                "expires_in_key": "expires_in",
                "expires_in": 86399,
                "token_type": ""
            }
        }
    },
    "connections": [
        {
            "name": "Products",
            "type": "api",
            "is_active": true,
            "is_primary": true,
            "resource_type": "product",
            "priority": 1,
            "configuration": {
                "auth_enabled": true,
                "method": "GET",
                "endpoint": "https://<domain>/admin/api/2023-10/products.json",
                "headers": {
                    "Content-Type": "application/json"
                },
                "body": {},
                "prerequisites": {
                    "product_response": "products",
                    "variable_response": {
                        "variable_path": "variants"
                    },
                    "main_product_unique_identifier": "id",
                    "variable_product_unique_identifier": "id"
                }
            }
        },
        {
            "name": "Order",
            "type": "api",
            "is_active": false,
            "is_primary": false,
            "resource_type": "order",
            "priority": 2,
            "configuration": {
                "method": "POST",
                "endpoint": "https://<domain>/admin/api/2024-01/orders.json",
                "auth_enabled": true,
                "headers": {
                    "Content-Type": "application/json"
                },
                "body": {
                    "type": "json",
                    "data": {
                        "order": {
                            "email": "john.doe@example.com",
                            "line_items": [
                                {
                                    "variant_id": 47608757682459,
                                    "quantity": 2
                                }
                            ],
                            "billing_address": {
                                "first_name": "John",
                                "last_name": "Doe",
                                "address1": "969 Market",
                                "phone": "555-555-5555",
                                "city": "San Francisco",
                                "province": "California",
                                "country": "United States",
                                "zip": "94103"
                            },
                            "shipping_address": {
                                "first_name": "John",
                                "last_name": "Doe",
                                "address1": "969 Market",
                                "phone": "555-555-5555",
                                "city": "San Francisco",
                                "province": "California",
                                "country": "United States",
                                "zip": "94103"
                            }
                        }
                    }
                },
                "prerequisites": {
                    "product_response": "",
                    "prerequisite_type": "no-variations",
                    "prerequisite_variation_type": "group-variations",
                    "variable_response": null,
                    "main_product_unique_identifier": "12345",
                    "variable_product_unique_identifier": ""
                },
                "advanced_configuration": {
                    "time_delay": ""
                }
            }
        }
    ],
    "attribute_mapping": [
        {
            "connection": "Products",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "sku",
            "supplier_attribute": "id",
            "advanced_configuration": null
        },
        {
            "connection": "Products",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "name",
            "supplier_attribute": "title",
            "advanced_configuration": null
        },
        {
            "connection": "Products",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "description",
            "supplier_attribute": "body_html",
            "advanced_configuration": null
        },
        {
            "connection": "Products",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "regular_price",
            "supplier_attribute": "variants->0->price",
            "advanced_configuration": null
        },
        {
            "connection": "Products",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "stock_quantity",
            "supplier_attribute": "variants->0->inventory_quantity",
            "advanced_configuration": null
        },
        {
            "connection": "Products",
            "product_type": "parent",
            "type": "core",
            "wc_attribute": "images",
            "supplier_attribute": "images",
            "advanced_configuration": {
                "image_src_attr": "src"
            }
        }
    ],
    "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": "page",
            "operation_type": "performance-optimization",
            "is_active": true,
            "configuration": {
                "type": "cursor",
                "location": "query-parameter",
                "cursor_parameter": "link",
                "next_cursor_key": "link",
                "next_cursor_key_location": "header",
                "end_pagination_key": "has_more",
                "is_next_cursor_url": true,
                "cursor_extraction_format": "rel-next"
            },
            "connections": [
                "Products"
            ]
        }
    ],
    "order_sync": [
        {
            "name": "Order",
            "connection_id": "Order",
            "is_active": false,
            "configuration": {
                "order_suppliers": [
                    "<supplier_id>"
                ],
                "direct_association": {
                    "order->email": "billing->email"
                },
                "nested_association": [
                    {
                        "order->line_items": "line_items",
                        "direct_association": [
                            {
                                "vendorKey": "variant_id",
                                "wooKey": "sku"
                            },
                            {
                                "vendorKey": "quantity",
                                "wooKey": "purchase_quantity"
                            }
                        ]
                    },
                    {
                        "order->billing_address": "billing",
                        "direct_association": [
                            {
                                "vendorKey": "first_name",
                                "wooKey": "first_name"
                            },
                            {
                                "vendorKey": "last_name",
                                "wooKey": "last_name"
                            },
                            {
                                "vendorKey": "address1",
                                "wooKey": "address_1"
                            },
                            {
                                "vendorKey": "phone",
                                "wooKey": "phone"
                            },
                            {
                                "vendorKey": "city",
                                "wooKey": "city"
                            },
                            {
                                "vendorKey": "province",
                                "wooKey": "state"
                            },
                            {
                                "vendorKey": "country",
                                "wooKey": "country"
                            },
                            {
                                "vendorKey": "zip",
                                "wooKey": "postcode"
                            }
                        ]
                    },
                    {
                        "order->shipping_address": "shipping",
                        "direct_association": [
                            {
                                "vendorKey": "first_name",
                                "wooKey": "first_name"
                            },
                            {
                                "vendorKey": "last_name",
                                "wooKey": "last_name"
                            },
                            {
                                "vendorKey": "address1",
                                "wooKey": "address_1"
                            },
                            {
                                "vendorKey": "phone",
                                "wooKey": "phone"
                            },
                            {
                                "vendorKey": "city",
                                "wooKey": "city"
                            },
                            {
                                "vendorKey": "province",
                                "wooKey": "state"
                            },
                            {
                                "vendorKey": "country",
                                "wooKey": "country"
                            },
                            {
                                "vendorKey": "zip",
                                "wooKey": "postcode"
                            }
                        ]
                    }
                ]
            },
            "is_conditional_sync_enabled": false
        }
    ]
}