{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rutter/json-schema/rutter-create-connection-body-schema.json",
  "title": "CreateConnectionBody",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rutter-connections-api-openapi.yml#/components/schemas/CreateConnectionBody",
  "allOf": [
    {
      "type": "object",
      "properties": {
        "platform": {
          "$ref": "#/$defs/CreateConnectionPlatforms"
        },
        "amazon_seller_marketplace": {
          "type": "string",
          "description": "The Amazon marketplace for the seller, used to build the Seller Central consent URL. Required to create an Amazon connection without credentials (returns a `platform_auth_url`). One of: UNITED_STATES, CANADA, MEXICO, BRAZIL, BELGIUM, UNITED_KINGDOM, GERMANY, FRANCE, SPAIN, ITALY, NETHERLANDS, SWEDEN, POLAND, SAUDI_ARABIA, EGYPT, TURKEY, UNITED_ARAB_EMIRATES, INDIA, JAPAN, AUSTRALIA, SINGAPORE."
        },
        "redirect_url": {
          "type": "string",
          "description": "Optional. Where to send the merchant after Rutter completes the OAuth callback for the platform_auth_url flow. If omitted, Rutter's default Link completion page is used."
        },
        "scope": {
          "type": "string"
        },
        "syncConfig": {
          "type": "object",
          "properties": {
            "initialSync": {
              "type": "object",
              "properties": {
                "batches": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "timeFrameInMonths": {
                        "type": "number",
                        "exclusiveMinimum": true,
                        "minimum": 0
                      },
                      "entities": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "ACCOUNT",
                            "ACCOUNT_BALANCE",
                            "ACCOUNT_BALANCE_BY_SUBSIDIARY",
                            "ACCOUNTING_CUSTOMER",
                            "ACCOUNTING_CUSTOMER_REFUND",
                            "ACCOUNTING_TRANSACTION",
                            "ACCOUNT_TRANSACTION",
                            "AP_AGING_REPORT_SUMMARY",
                            "AP_AGING_REPORT_DATA",
                            "AR_AGING_REPORT_SUMMARY",
                            "AR_AGING_REPORT_DATA",
                            "ATTACHMENT",
                            "BALANCE_SHEET",
                            "BANK_DEPOSIT",
                            "BANK_FEED_ACCOUNT",
                            "BANK_FEED_CONTACT",
                            "BANK_FEED_PAYMENT_NETWORK",
                            "BANK_FEED_TRANSACTION",
                            "BANK_TRANSFER",
                            "BILL",
                            "BILL_CREDIT_APPLICATION",
                            "BILL_CREDIT_UNAPPLICATION",
                            "BILL_CREDIT_MEMO",
                            "BILL_PAYMENT",
                            "CASH_FLOW",
                            "CATEGORIES",
                            "CLASS",
                            "COMPANY_INFO",
                            "CURRENCIES",
                            "CUSTOM_RECORD",
                            "DEPARTMENT",
                            "EXCHANGE_RATE",
                            "EXPENSE",
                            "EXPENSE_REFUND",
                            "INCOME_STATEMENT",
                            "INVOICE",
                            "INVOICE_CREDIT_APPLICATION",
                            "INVOICE_CREDIT_UNAPPLICATION",
                            "INVOICE_CREDIT_MEMO",
                            "INVOICE_PAYMENT",
                            "ITEMS",
                            "JOURNAL_ENTRY",
                            "LOCATION",
                            "PAYMENT_TERM",
                            "PAYMENT_METHOD",
                            "PROJECT",
                            "PURCHASE_ORDER",
                            "SALES_ORDER",
                            "SALES_RECEIPT",
                            "SUBSIDIARY",
                            "TASK",
                            "TAX_AGENCY",
                            "TAX_AREA",
                            "TAX_RATES",
                            "TAX_DETAIL",
                            "UPDATED_TRANSACTION",
                            "VENDOR",
                            "COLLECTION",
                            "COMMERCE_CUSTOMER",
                            "CUSTOMER_GROUP",
                            "INVENTORY_EVENTS",
                            "ORDER",
                            "FULFILLMENT",
                            "PAYOUT",
                            "PRODUCT",
                            "PRODUCT_VARIANT",
                            "STORE",
                            "SUBSCRIPTION",
                            "TRANSACTION"
                          ]
                        }
                      }
                    },
                    "required": [
                      "timeFrameInMonths",
                      "entities"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "batches"
              ],
              "additionalProperties": false
            },
            "incrementalSync": {
              "type": "object",
              "properties": {
                "syncPeriodInMinutes": {
                  "type": "number",
                  "minimum": 60,
                  "maximum": 20160
                },
                "entities": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "ACCOUNT",
                      "ACCOUNT_BALANCE",
                      "ACCOUNT_BALANCE_BY_SUBSIDIARY",
                      "ACCOUNTING_CUSTOMER",
                      "ACCOUNTING_CUSTOMER_REFUND",
                      "ACCOUNTING_TRANSACTION",
                      "ACCOUNT_TRANSACTION",
                      "AP_AGING_REPORT_SUMMARY",
                      "AP_AGING_REPORT_DATA",
                      "AR_AGING_REPORT_SUMMARY",
                      "AR_AGING_REPORT_DATA",
                      "ATTACHMENT",
                      "BALANCE_SHEET",
                      "BANK_DEPOSIT",
                      "BANK_FEED_ACCOUNT",
                      "BANK_FEED_CONTACT",
                      "BANK_FEED_PAYMENT_NETWORK",
                      "BANK_FEED_TRANSACTION",
                      "BANK_TRANSFER",
                      "BILL",
                      "BILL_CREDIT_APPLICATION",
                      "BILL_CREDIT_UNAPPLICATION",
                      "BILL_CREDIT_MEMO",
                      "BILL_PAYMENT",
                      "CASH_FLOW",
                      "CATEGORIES",
                      "CLASS",
                      "COMPANY_INFO",
                      "CURRENCIES",
                      "CUSTOM_RECORD",
                      "DEPARTMENT",
                      "EXCHANGE_RATE",
                      "EXPENSE",
                      "EXPENSE_REFUND",
                      "INCOME_STATEMENT",
                      "INVOICE",
                      "INVOICE_CREDIT_APPLICATION",
                      "INVOICE_CREDIT_UNAPPLICATION",
                      "INVOICE_CREDIT_MEMO",
                      "INVOICE_PAYMENT",
                      "ITEMS",
                      "JOURNAL_ENTRY",
                      "LOCATION",
                      "PAYMENT_TERM",
                      "PAYMENT_METHOD",
                      "PROJECT",
                      "PURCHASE_ORDER",
                      "SALES_ORDER",
                      "SALES_RECEIPT",
                      "SUBSIDIARY",
                      "TASK",
                      "TAX_AGENCY",
                      "TAX_AREA",
                      "TAX_RATES",
                      "TAX_DETAIL",
                      "UPDATED_TRANSACTION",
                      "VENDOR",
                      "COLLECTION",
                      "COMMERCE_CUSTOMER",
                      "CUSTOMER_GROUP",
                      "INVENTORY_EVENTS",
                      "ORDER",
                      "FULFILLMENT",
                      "PAYOUT",
                      "PRODUCT",
                      "PRODUCT_VARIANT",
                      "STORE",
                      "SUBSCRIPTION",
                      "TRANSACTION"
                    ]
                  }
                }
              },
              "required": [
                "syncPeriodInMinutes",
                "entities"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "initialSync",
            "incrementalSync"
          ],
          "additionalProperties": false,
          "description": "Optional sync configuration for the connection. Supported for Campfire, Dualentry, Dynamics 365 Business Central, Dynamics 365 Fo, FreshBooks, Lexware, Moneybird, NetSuite, QuickBooks, QuickBooks Desktop, Rillet, Sage Business Cloud, Sage Intacct, Sage Intacct v2, Spiris, Stripe, Visma, Xero, and Zoho Books."
        }
      },
      "required": [
        "platform"
      ],
      "additionalProperties": false
    },
    {
      "anyOf": [
        {
          "$ref": "#/$defs/BigCommerceCredentials"
        },
        {
          "$ref": "#/$defs/AmazonCredentials"
        },
        {
          "$ref": "#/$defs/ShopifyCredentials"
        },
        {
          "$ref": "#/$defs/PrestaShopCredentials"
        },
        {
          "$ref": "#/$defs/ShoperCredentials"
        },
        {
          "$ref": "#/$defs/WooCommerceCredentials"
        },
        {
          "$ref": "#/$defs/MagentoCredentials"
        },
        {
          "$ref": "#/$defs/EbayCredentials"
        },
        {
          "$ref": "#/$defs/LazadaCredentials"
        },
        {
          "$ref": "#/$defs/FnacCredentials"
        },
        {
          "$ref": "#/$defs/SquareCredentials"
        },
        {
          "$ref": "#/$defs/StripeCredentials"
        },
        {
          "$ref": "#/$defs/QuickbooksCredentials"
        },
        {
          "$ref": "#/$defs/NetsuiteCredentials"
        },
        {
          "$ref": "#/$defs/WalmartCredentials"
        },
        {
          "$ref": "#/$defs/XeroCredentials"
        },
        {
          "$ref": "#/$defs/ZohoBooksCredentials"
        },
        {
          "$ref": "#/$defs/SageIntacctV2Credentials"
        }
      ]
    }
  ],
  "$defs": {
    "AmazonCredentials": {
      "type": "object",
      "properties": {
        "amazon_access_key_id": {
          "type": "string",
          "description": "AWS User Access Key ID"
        },
        "oauth_client_id": {
          "type": "string",
          "description": "SP-API App Client ID"
        },
        "amazon_secret_access_key": {
          "type": "string",
          "description": "AWS User Secret Access Key"
        },
        "amazon_seller_region": {
          "type": "string",
          "enum": [
            "na",
            "eu",
            "fe"
          ],
          "description": "Region of Amazon seller - must be one of na (North America), eu (Europe), or fe (Far East)."
        },
        "amazon_selling_partner_role": {
          "type": "string",
          "description": "AWS Role ARN used in SP-API app"
        },
        "oauth_client_secret": {
          "type": "string",
          "description": "SP-API App Client Secret"
        },
        "oauth_refresh_token": {
          "type": "string",
          "description": "SP-API Refresh Token"
        }
      },
      "required": [
        "amazon_access_key_id",
        "oauth_client_id",
        "amazon_secret_access_key",
        "amazon_seller_region",
        "amazon_selling_partner_role",
        "oauth_client_secret",
        "oauth_refresh_token"
      ],
      "description": "Credentials for Amazon"
    },
    "BigCommerceCredentials": {
      "type": "object",
      "properties": {
        "oauth_client_id": {
          "type": "string",
          "description": "BigCommerce App Client ID"
        },
        "oauth_access_token": {
          "type": "string",
          "description": "BigCommerce Store Access Token"
        },
        "store_url": {
          "type": "string",
          "description": "BigCommerce merchant .mybigcommerce.com domain URL"
        },
        "oauth_client_secret": {
          "type": "string",
          "description": "BigCommerce App Client Secret"
        }
      },
      "required": [
        "oauth_access_token",
        "store_url"
      ],
      "description": "Credentials for BigCommerce"
    },
    "CreateConnectionPlatforms": {
      "type": "string",
      "enum": [
        "BIG_COMMERCE",
        "AMAZON",
        "SHOPIFY",
        "PRESTASHOP",
        "SHOPER",
        "WOO_COMMERCE",
        "MAGENTO",
        "EBAY",
        "LAZADA",
        "FNAC",
        "SQUARE",
        "STRIPE",
        "QUICKBOOKS",
        "NETSUITE",
        "WALMART",
        "XERO",
        "ZOHOBOOKS",
        "SAGE_INTACCT_V2",
        "INTUIT_BANK_FEEDS",
        "SAGE_BANK_FEEDS",
        "PLAID_BANK_FEEDS"
      ],
      "description": "The underlying platform."
    },
    "EbayCredentials": {
      "type": "object",
      "properties": {
        "oauth_client_id": {
          "type": "string",
          "description": "Ebay Developer OAuth Client ID"
        },
        "oauth_client_secret": {
          "type": "string",
          "description": "Ebay Developer OAuth Client Secret"
        },
        "oauth_refresh_token": {
          "type": "string",
          "description": "Ebay OAuth Refresh Token"
        }
      },
      "required": [
        "oauth_client_id",
        "oauth_client_secret",
        "oauth_refresh_token"
      ],
      "description": "Credentials for eBay"
    },
    "FnacCredentials": {
      "type": "object",
      "properties": {
        "partner_id": {
          "type": "string",
          "description": "Partner ID"
        },
        "shop_id": {
          "type": "string",
          "description": "Shop ID"
        },
        "key": {
          "type": "string",
          "description": "Key"
        }
      },
      "required": [
        "partner_id",
        "shop_id",
        "key"
      ],
      "description": "Credentials for Fnac"
    },
    "LazadaCredentials": {
      "type": "object",
      "properties": {
        "oauth_client_id": {
          "type": "string",
          "description": "OAuth Client ID"
        },
        "country": {
          "type": "string",
          "description": "Country Code for Merchant (e.g. id, sg, th)"
        },
        "oauth_access_token": {
          "type": "string",
          "description": "OAuth Access Token"
        },
        "oauth_client_secret": {
          "type": "string",
          "description": "OAuth Client Secret"
        },
        "oauth_refresh_token": {
          "type": "string",
          "description": "OAuth Refresh Token"
        }
      },
      "required": [
        "oauth_client_id",
        "country",
        "oauth_access_token",
        "oauth_client_secret",
        "oauth_refresh_token"
      ],
      "description": "Credentials for Lazada"
    },
    "MagentoCredentials": {
      "type": "object",
      "properties": {
        "basic_password": {
          "type": "string",
          "description": "Magento Admin User Password"
        },
        "basic_username": {
          "type": "string",
          "description": "Magento Admin User Username"
        },
        "store_url": {
          "type": "string",
          "description": "Magento merchant website URL"
        }
      },
      "required": [
        "basic_password",
        "basic_username",
        "store_url"
      ],
      "description": "Credentials for Magento"
    },
    "NetsuiteCredentials": {
      "type": "object",
      "properties": {
        "token_id": {
          "type": "string",
          "description": "Token ID"
        },
        "consumer_key": {
          "type": "string",
          "description": "Consumer Key"
        },
        "consumer_secret": {
          "type": "string",
          "description": "Consumer Secret"
        },
        "store_name": {
          "type": "string",
          "description": "Store Name (for sandbox you should put it in the form '1000000_SB1')"
        },
        "token_secret": {
          "type": "string",
          "description": "Token Secret"
        }
      },
      "required": [
        "token_id",
        "consumer_key",
        "consumer_secret",
        "store_name",
        "token_secret"
      ],
      "description": "Credentials for Netsuite"
    },
    "PrestaShopCredentials": {
      "type": "object",
      "properties": {
        "api_key": {
          "type": "string",
          "description": "PrestaShop API Key"
        },
        "store_url": {
          "type": "string",
          "description": "PrestaShop merchant domain URL"
        }
      },
      "required": [
        "api_key",
        "store_url"
      ],
      "description": "Credentials for PrestaShop"
    },
    "QuickbooksCredentials": {
      "type": "object",
      "properties": {
        "oauth_client_id": {
          "type": "string",
          "description": "OAuth Client ID"
        },
        "realm_id": {
          "type": "string",
          "description": "Realm ID"
        },
        "oauth_client_secret": {
          "type": "string",
          "description": "OAuth Client Secret"
        },
        "oauth_refresh_token": {
          "type": "string",
          "description": "OAuth Refresh Token"
        },
        "environment": {
          "type": "string",
          "description": "Environment (e.g. sandbox)"
        }
      },
      "required": [
        "oauth_client_id",
        "realm_id",
        "oauth_client_secret",
        "oauth_refresh_token"
      ],
      "description": "Credentials for Quickbooks"
    },
    "SageIntacctV2Credentials": {
      "type": "object",
      "properties": {
        "oauth_client_id": {
          "type": "string",
          "description": "OAuth Client ID"
        },
        "oauth_client_secret": {
          "type": "string",
          "description": "OAuth Client Secret"
        },
        "oauth_refresh_token": {
          "type": "string",
          "description": "OAuth Refresh Token"
        }
      },
      "required": [
        "oauth_client_id",
        "oauth_client_secret",
        "oauth_refresh_token"
      ],
      "description": "Credentials for Sage Intacct V2."
    },
    "ShoperCredentials": {
      "type": "object",
      "properties": {
        "oauth_access_token": {
          "type": "string",
          "description": "Shoper merchant OAuth Access Token"
        },
        "oauth_refresh_token": {
          "type": "string",
          "description": "Shoper merchant OAuth Refresh Token"
        },
        "store_url": {
          "type": "string",
          "description": "Shoper merchant domain URL"
        }
      },
      "required": [
        "oauth_access_token",
        "oauth_refresh_token",
        "store_url"
      ],
      "description": "Credentials for Shoper"
    },
    "ShopifyCredentials": {
      "anyOf": [
        {
          "$ref": "#/$defs/ShopifyPrivateCredentials"
        },
        {
          "$ref": "#/$defs/ShopifyPublicCredentials"
        }
      ],
      "description": "Credentials for Shopify Private App"
    },
    "ShopifyPrivateCredentials": {
      "type": "object",
      "properties": {
        "basic_password": {
          "type": "string",
          "description": "Private Shopify App Password"
        },
        "basic_username": {
          "type": "string",
          "description": "Private Shopify App API Key"
        },
        "store_url": {
          "type": "string",
          "description": "Shopify merchant .myshopify.com domain URL"
        }
      },
      "required": [
        "basic_password",
        "basic_username",
        "store_url"
      ],
      "description": "Credentials for Shopify Private App"
    },
    "ShopifyPublicCredentials": {
      "type": "object",
      "properties": {
        "oauth_client_id": {
          "type": "string",
          "description": "Shopify Public App Client ID"
        },
        "oauth_access_token": {
          "type": "string",
          "description": "Shopify Merchant Access Token"
        },
        "oauth_client_secret": {
          "type": "string",
          "description": "Shopify Public App Client Secret"
        },
        "store_url": {
          "type": "string",
          "description": "Shopify merchant .myshopify.com domain URL"
        }
      },
      "required": [
        "oauth_client_id",
        "oauth_access_token",
        "oauth_client_secret",
        "store_url"
      ],
      "description": "Credentials for Shopify Public App"
    },
    "SquareCredentials": {
      "type": "object",
      "properties": {
        "oauth_client_id": {
          "type": "string",
          "description": "Square Developer OAuth Client ID"
        },
        "oauth_client_secret": {
          "type": "string",
          "description": "Square Developer OAuth Client Secret"
        },
        "oauth_refresh_token": {
          "type": "string",
          "description": "Square OAuth Refresh Token"
        }
      },
      "required": [
        "oauth_client_id",
        "oauth_client_secret",
        "oauth_refresh_token"
      ],
      "description": "Credentials for Square"
    },
    "StripeCredentials": {
      "type": "object",
      "properties": {
        "account_id": {
          "type": "string",
          "description": "Stripe Account ID"
        },
        "oauth_access_token": {
          "type": "string",
          "description": "Stripe OAuth Access Token"
        }
      },
      "required": [
        "account_id",
        "oauth_access_token"
      ],
      "description": "Credentials for Stripe"
    },
    "WalmartCredentials": {
      "type": "object",
      "properties": {
        "oauth_client_id": {
          "type": "string",
          "description": "Walmart Developer OAuth Client ID"
        },
        "seller_id": {
          "type": "string",
          "description": "For OAuth connections, the Walmart Seller ID."
        },
        "oauth_client_secret": {
          "type": "string",
          "description": "Walmart Developer OAuth Client Secret"
        },
        "oauth_refresh_token": {
          "type": "string",
          "description": "Walmart OAuth Refresh Token. If provided, the connection is created as an OAuth 2.0 connection."
        }
      },
      "required": [
        "oauth_client_id",
        "oauth_client_secret"
      ],
      "description": "Credentials for Walmart"
    },
    "WooCommerceCredentials": {
      "type": "object",
      "properties": {
        "basic_password": {
          "type": "string",
          "description": "WooCommerce Rest API Consumer Secret"
        },
        "basic_username": {
          "type": "string",
          "description": "WooCommerce Rest API Consumer Key"
        },
        "store_url": {
          "type": "string",
          "description": "WooCommerce merchant website URL"
        }
      },
      "required": [
        "basic_password",
        "basic_username",
        "store_url"
      ],
      "description": "Credentials for WooCommerce"
    },
    "XeroCredentials": {
      "type": "object",
      "properties": {
        "oauth_client_id": {
          "type": "string",
          "description": "OAuth Client ID"
        },
        "tenant_id": {
          "type": "string",
          "description": "The Xero Tenant ID"
        },
        "user_id": {
          "type": "string",
          "description": "The Xero User ID"
        },
        "oauth_client_secret": {
          "type": "string",
          "description": "OAuth Client Secret"
        },
        "oauth_refresh_token": {
          "type": "string",
          "description": "OAuth Refresh Token"
        }
      },
      "required": [
        "oauth_client_id",
        "tenant_id",
        "user_id",
        "oauth_client_secret",
        "oauth_refresh_token"
      ],
      "description": "Credentials for Xero"
    },
    "ZohoBooksCredentials": {
      "type": "object",
      "properties": {
        "oauth_client_id": {
          "type": "string",
          "description": "OAuth Client ID"
        },
        "organization_id": {
          "type": "string",
          "description": "Zoho Books Organization ID"
        },
        "oauth_access_token": {
          "type": "string",
          "description": "OAuth Access Token"
        },
        "oauth_client_secret": {
          "type": "string",
          "description": "OAuth Client Secret"
        },
        "oauth_refresh_token": {
          "type": "string",
          "description": "OAuth Refresh Token"
        },
        "region": {
          "type": "string",
          "description": "Zoho region (e.g., com, eu, in, com.au)"
        }
      },
      "required": [
        "oauth_client_id",
        "organization_id",
        "oauth_access_token",
        "oauth_client_secret",
        "oauth_refresh_token"
      ],
      "description": "Credentials for Zoho Books"
    }
  }
}