{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rutter/json-schema/rutter-get-connection-status-response-schema.json",
  "title": "GetConnectionStatusResponse",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rutter-connections-api-openapi.yml#/components/schemas/GetConnectionStatusResponse",
  "type": "object",
  "properties": {
    "status": {
      "type": "object",
      "properties": {
        "default_subsidiary_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "The Rutter ID of the subsidiary selected by the end-customer in Rutter Link. Matches the `id` returned by `GET /accounting/subsidiaries` and the `subsidiary_id` accepted by write endpoints. Null until the first sync has fetched subsidiaries, or if no subsidiary was selected. The selection does not restrict which subsidiaries Rutter syncs. Supported for NetSuite."
        },
        "last_sync_completed_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "is_healthy": {
          "type": "boolean"
        },
        "is_ready": {
          "type": "boolean"
        },
        "link_url": {
          "type": "string"
        },
        "platform": {
          "type": "string"
        },
        "needs_update_status": {
          "type": "object",
          "properties": {
            "needs_update": {
              "type": "boolean"
            }
          },
          "required": [
            "needs_update"
          ],
          "additionalProperties": false
        },
        "disabled_status": {
          "type": "object",
          "properties": {
            "is_disabled": {
              "type": "boolean"
            },
            "disabled_reason": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "SHOP_API_KEY_EXPIRED",
                "SHOP_NOT_FOUND",
                "SHOP_ID_IS_INVALID",
                "SHOP_IS_DISABLED_OR_EXPIRED",
                "SHOP_IS_LOCKED",
                "SHOP_PAYMENT_REQUIRED",
                "TUNNEL_ERROR",
                "WEB_SERVICE_IS_DISABLED",
                "SHOP_IS_UNAVAILABLE",
                "CERT_EXPIRED",
                "FAILED TO AUTHENTICATE",
                "NEEDS_REAUTH",
                "REQUEST_TIMEOUT",
                "MANUALLY_DISABLED",
                "UNKNOWN",
                "null"
              ]
            }
          },
          "required": [
            "is_disabled",
            "disabled_reason"
          ],
          "additionalProperties": false
        },
        "historical_sync_status": {
          "type": "object",
          "properties": {
            "historical_sync_completed": {
              "type": "boolean"
            },
            "total": {
              "type": "object",
              "additionalProperties": {
                "type": "object",
                "properties": {
                  "oldest_entity_date": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "newest_entity_date": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "ready": {
                    "type": "boolean"
                  },
                  "synced_count": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "If null, this field is unsupported for this platform. If the estimated synced count is greater than 1,000,000, the value will be an estimate."
                  }
                },
                "required": [
                  "oldest_entity_date",
                  "newest_entity_date",
                  "ready",
                  "synced_count"
                ],
                "additionalProperties": false
              }
            },
            "num_batches_completed": {
              "type": [
                "number",
                "null"
              ]
            },
            "synced_balance_sheets_count": {
              "type": [
                "number",
                "null"
              ],
              "description": "If null, this field is unsupported for this platform. If the estimated synced count is greater than 1,000,000, the value will be an estimate."
            },
            "synced_cash_flows_count": {
              "type": [
                "number",
                "null"
              ],
              "description": "If null, this field is unsupported for this platform. If the estimated synced count is greater than 1,000,000, the value will be an estimate."
            },
            "synced_income_statements_count": {
              "type": [
                "number",
                "null"
              ],
              "description": "If null, this field is unsupported for this platform. If the estimated synced count is greater than 1,000,000, the value will be an estimate."
            },
            "synced_orders_count": {
              "type": [
                "number",
                "null"
              ],
              "description": "If null, this field is unsupported for this platform. If the estimated synced count is greater than 1,000,000, the value will be an estimate."
            },
            "synced_transactions_count": {
              "type": [
                "number",
                "null"
              ],
              "description": "If null, this field is unsupported for this platform. If the estimated synced count is greater than 1,000,000, the value will be an estimate."
            },
            "expected_entity_counts": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "object",
                "properties": {
                  "batch_num": {
                    "type": "number"
                  },
                  "entity": {
                    "type": "string"
                  },
                  "is_estimate": {
                    "type": "boolean"
                  },
                  "count": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                "required": [
                  "batch_num",
                  "entity",
                  "is_estimate",
                  "count"
                ],
                "additionalProperties": false
              },
              "description": "The expected number of objects fetched during initial sync. Supported for QuickBooks"
            },
            "batches": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "batch_num": {
                    "type": "number"
                  },
                  "progress_info": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "oldest_batch_entity_date": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "newest_batch_entity_date": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "IN_PROGRESS",
                            "COMPLETED",
                            "NOT_STARTED",
                            "FAILED"
                          ]
                        }
                      },
                      "required": [
                        "oldest_batch_entity_date",
                        "newest_batch_entity_date",
                        "status"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Legacy field. Only works on Commerce platforms."
                  },
                  "config": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "timeFrameInMonths": {
                        "type": "number"
                      },
                      "entities": {
                        "type": "object",
                        "properties": {
                          "accounts": {
                            "type": "string",
                            "enum": [
                              "REQUIRED",
                              "PREFERRED_BUT_OPTIONAL",
                              "AVOID"
                            ]
                          },
                          "balanceSheets": {
                            "type": "string",
                            "enum": [
                              "REQUIRED",
                              "PREFERRED_BUT_OPTIONAL",
                              "AVOID"
                            ]
                          },
                          "companyInfo": {
                            "type": "string",
                            "enum": [
                              "REQUIRED",
                              "PREFERRED_BUT_OPTIONAL",
                              "AVOID"
                            ]
                          },
                          "customers": {
                            "type": "string",
                            "enum": [
                              "REQUIRED",
                              "PREFERRED_BUT_OPTIONAL",
                              "AVOID"
                            ]
                          },
                          "incomeStatements": {
                            "type": "string",
                            "enum": [
                              "REQUIRED",
                              "PREFERRED_BUT_OPTIONAL",
                              "AVOID"
                            ]
                          },
                          "invoices": {
                            "type": "string",
                            "enum": [
                              "REQUIRED",
                              "PREFERRED_BUT_OPTIONAL",
                              "AVOID"
                            ]
                          },
                          "items": {
                            "type": "string",
                            "enum": [
                              "REQUIRED",
                              "PREFERRED_BUT_OPTIONAL",
                              "AVOID"
                            ]
                          },
                          "payouts": {
                            "type": "string",
                            "enum": [
                              "REQUIRED",
                              "PREFERRED_BUT_OPTIONAL",
                              "AVOID"
                            ]
                          },
                          "purchaseOrders": {
                            "type": "string",
                            "enum": [
                              "REQUIRED",
                              "PREFERRED_BUT_OPTIONAL",
                              "AVOID"
                            ]
                          },
                          "store": {
                            "type": "string",
                            "enum": [
                              "REQUIRED",
                              "PREFERRED_BUT_OPTIONAL",
                              "AVOID"
                            ]
                          },
                          "transactions": {
                            "type": "string",
                            "enum": [
                              "REQUIRED",
                              "PREFERRED_BUT_OPTIONAL",
                              "AVOID"
                            ]
                          },
                          "vendors": {
                            "type": "string",
                            "enum": [
                              "REQUIRED",
                              "PREFERRED_BUT_OPTIONAL",
                              "AVOID"
                            ]
                          },
                          "products": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "variants": {
                                    "type": "object",
                                    "properties": {
                                      "inventory": {
                                        "type": "string",
                                        "enum": [
                                          "REQUIRED",
                                          "PREFERRED_BUT_OPTIONAL",
                                          "AVOID"
                                        ]
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "variants"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "string",
                                "enum": [
                                  "REQUIRED",
                                  "PREFERRED_BUT_OPTIONAL",
                                  "AVOID"
                                ]
                              }
                            ]
                          },
                          "orders": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "platform_id": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "billing_address": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "customer": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "fulfillment_status": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "fulfillments": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "iso_currency_code": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "line_items": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "order_number": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "payment_status": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "refunds": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "shipping_address": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "total_discount": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "total_price": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "total_shipping": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "total_tax": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "transactions": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "created_at": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  },
                                  "updated_at": {
                                    "type": "string",
                                    "enum": [
                                      "REQUIRED",
                                      "PREFERRED_BUT_OPTIONAL",
                                      "AVOID"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "string",
                                "enum": [
                                  "REQUIRED",
                                  "PREFERRED_BUT_OPTIONAL",
                                  "AVOID"
                                ]
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "timeFrameInMonths",
                      "entities"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "batch_num",
                  "progress_info",
                  "config"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "historical_sync_completed",
            "total",
            "num_batches_completed",
            "synced_balance_sheets_count",
            "synced_cash_flows_count",
            "synced_income_statements_count",
            "synced_orders_count",
            "synced_transactions_count",
            "expected_entity_counts",
            "batches"
          ],
          "additionalProperties": false
        },
        "created_at": {
          "type": "string"
        }
      },
      "required": [
        "default_subsidiary_id",
        "last_sync_completed_at",
        "is_healthy",
        "is_ready",
        "link_url",
        "platform",
        "needs_update_status",
        "disabled_status",
        "historical_sync_status",
        "created_at"
      ],
      "additionalProperties": false
    },
    "connection": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "orgId": {
          "type": "string"
        },
        "platform": {
          "type": "string",
          "enum": [
            "AMAZON",
            "EBAY",
            "ETSY",
            "FNAC",
            "WALMART",
            "SHOPEE",
            "LAZADA",
            "MERCADOLIBRE",
            "ALIBABA",
            "WAYFAIR",
            "SHEIN",
            "NOON",
            "SHOPLINE",
            "PRESTASHOP",
            "SHOPIFY",
            "MAGENTO",
            "WOO_COMMERCE",
            "SQUARESPACE",
            "WIX",
            "SHOPER",
            "SHOPLAZZA",
            "BIG_COMMERCE",
            "SALLA",
            "ZID",
            "TIKTOKSHOP",
            "COMMERCELAYER",
            "WEBFLOW",
            "GUMROAD",
            "ECWID",
            "PAYPAL",
            "SQUARE",
            "STRIPE",
            "CLOVER",
            "MOLLIE",
            "PAYNL",
            "AUTHORIZENET",
            "RECHARGE",
            "CHARGIFY",
            "CHARGEBEE",
            "RECURLY",
            "KASHFLOW",
            "SAGE_INTACCT",
            "SAGE_INTACCT_V2",
            "DYNAMICS365",
            "DYNAMICS365FO",
            "ZOHOBOOKS",
            "EXACTONLINE",
            "FREEAGENT",
            "QUICKBOOKS",
            "QUICKBOOKS_DESKTOP",
            "FRESHBOOKS",
            "XERO",
            "SAGE_BUSINESS_CLOUD",
            "SAGE_50",
            "VISTA",
            "NETSUITE",
            "WAVE",
            "DUALENTRY",
            "CAMPFIRE",
            "RILLET",
            "SOFTLEDGER",
            "VISMA",
            "SPIRIS",
            "LEXWARE",
            "MONEYBIRD",
            "SAGE200CLOUD",
            "MX",
            "PLAID",
            "TELLER",
            "RAMP",
            "ODOO",
            "ACUMATICA",
            "FULFIL",
            "TALLY",
            "SAPBUSINESSONE",
            "SAPS4HANA",
            "WORKDAY",
            "ANFIX",
            "ORACLEFUSION",
            "HOLDED",
            "MYOBBUSINESS",
            "FORTNOX",
            "GOOGLE",
            "FACEBOOK",
            "TIKTOK",
            "INTUIT_BANK_FEEDS",
            "PLAID_BANK_FEEDS",
            "SAGE",
            "SAGE_BANK_FEEDS",
            "YODLEE_BANK_FEEDS",
            "QUICKBOOKS_HRIS",
            "BAMBOO_HR",
            "GUSTO",
            "DEEL",
            "RIPPLING"
          ]
        }
      },
      "required": [
        "id",
        "orgId",
        "platform"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "status",
    "connection"
  ]
}