{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/curlec/json-schema/curlec-linked-account-schema.json",
  "title": "LinkedAccount",
  "description": "A sub-merchant (Linked Account) created under a Route marketplace account. Linked Accounts can receive transfers and settlements. Prefix: acc_",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/curlec-linked-accounts-api-openapi.yml#/components/schemas/LinkedAccount",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Account ID. Prefix: acc_"
    },
    "type": {
      "type": "string",
      "enum": [
        "route"
      ],
      "description": "Account type. Always 'route' for Route marketplace accounts."
    },
    "status": {
      "type": "string",
      "enum": [
        "created",
        "suspended"
      ],
      "description": "Account status."
    },
    "email": {
      "type": "string",
      "description": "Contact email. Cannot be updated after creation."
    },
    "phone": {
      "type": "string",
      "description": "Contact phone number with country code (e.g., +919876543210)."
    },
    "legal_business_name": {
      "type": "string",
      "description": "Registered legal name of the business."
    },
    "business_type": {
      "type": "string",
      "enum": [
        "route"
      ],
      "description": "Business type. Cannot be updated after creation."
    },
    "profile": {
      "type": "object",
      "properties": {
        "category": {
          "type": "string",
          "description": "Business category (e.g., healthcare, education, ecommerce)."
        },
        "subcategory": {
          "type": "string",
          "description": "Business subcategory."
        },
        "addresses": {
          "type": "object",
          "properties": {
            "registered": {
              "type": "object",
              "properties": {
                "street1": {
                  "type": "string"
                },
                "street2": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                },
                "postal_code": {
                  "type": "string"
                },
                "country": {
                  "type": "string"
                }
              }
            },
            "operation": {
              "type": "object",
              "properties": {
                "street1": {
                  "type": "string"
                },
                "street2": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                },
                "postal_code": {
                  "type": "string"
                },
                "country": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "legal_info": {
      "type": "object",
      "properties": {
        "pan": {
          "type": "string",
          "description": "Business PAN number."
        },
        "gst": {
          "type": "string",
          "description": "GST number (22 chars)."
        }
      }
    },
    "contact_name": {
      "type": "string",
      "description": "Name of the primary contact person."
    },
    "contact_info": {
      "type": "object",
      "properties": {
        "chargeback": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string"
            },
            "phone": {
              "type": "string"
            },
            "policy_url": {
              "type": "string"
            }
          }
        },
        "refund": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string"
            },
            "phone": {
              "type": "string"
            },
            "policy_url": {
              "type": "string"
            }
          }
        },
        "support": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string"
            },
            "phone": {
              "type": "string"
            },
            "policy_url": {
              "type": "string"
            }
          }
        }
      }
    },
    "apps": {
      "type": "object",
      "properties": {
        "websites": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "android": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          }
        },
        "ios": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "notes": {
      "$ref": "#/$defs/Notes"
    },
    "created_at": {
      "type": "integer"
    }
  },
  "$defs": {
    "Notes": {
      "type": "object",
      "description": "Key-value pairs for storing custom metadata. Maximum 15 pairs. Each key and value must not exceed 256 characters.",
      "additionalProperties": {
        "type": "string"
      },
      "maxProperties": 15
    }
  }
}