{
  "openapi": "3.0.1",
  "info": {
    "title": "Adra Shared API 1.0",
    "description": "API for sharing common data with the Adra Product Suite.",
    "version": "1.0",
    "contact": {
      "name": "API Support",
      "url": "https://success.adra.com/s/",
      "email": "support@adra.com"
    },
    "license": {
      "name": "Proprietary License",
      "url": "https://www.trintech.com/terms-and-conditions/adra/"
    },
    "x-feedbackLink": {
      "url": "https://success.adra.com/s/resources/ideas",
      "label": "Give Feedback"
    }
  },
"servers": [
    {
      "url": "https://sharedapi.adra.com",
      "description": "Production server"
    },
    {
      "url": "https://sharedapi.adrastage.com",
      "description": "Stage server"
    },
    {
      "url": "https://sharedapi.adratest.com",
      "description": "Test server"
    },
    {
      "url": "https://sharedapi.adradev.com",
      "description": "Dev server"
    }
  ],
  "tags": [
    {
      "name": "Legal Entities",
      "description": "## Overview\nLegal entities represent the organizational units within an engagement that require separate accounting or reporting. These can include:\n\n- Subsidiaries\n- Branches\n- Regional offices\n- Operating divisions\n\n## Structure\nEach legal entity contains essential information:\n\n- **Identification**: Unique identifiers and codes\n  - Legal Entity ID\n  - Legal Entity GUID\n  - Legal Entity Code\n  - Organization Number\n\n- **Basic Information**:\n  - Legal Entity Name\n  - Status (Active/Inactive)\n\n- **Location Details**:\n  - Country Code\n  - Address Information\n  - City and Postal Code\n\n- **Financial Settings**:\n  - Currency Code\n  - Additional Configuration\n\n## Usage\nLegal entities are fundamental to:\n\n- Organizing financial data\n- Managing compliance requirements\n- Structuring reporting hierarchies\n- Maintaining separate books of accounts\n\nThey serve as the foundation for financial consolidation and segregation of business."
    }
  ],
  "externalDocs": {
    "description": "Adra Success Center",
    "url": "https://success.adra.com/s/knowledge-center"
  },
  "paths": {
    "/api/v1.0/engagements/{engagementSid}/legal-entities": {
      "get": {
        "tags": ["Public"],
        "summary": "Get legal entities by Engagement GUID",
        "operationId": "GetLegalEntitiesByEngagementGuid",
        "parameters": [
          {
            "name": "engagementSid",
            "in": "path",
            "description": "Short identifier for engagement (as in URLs)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$filter",
            "in": "query",
            "description": "OData $filter parameter",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$orderby",
            "in": "query",
            "description": "OData $orderby parameter",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "$top",
            "in": "query",
            "description": "OData $top parameter",
            "required": true,
            "schema": {
              "maximum": 500,
              "minimum": 0,
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "$skip",
            "in": "query",
            "description": "OData $skip parameter",
            "schema": {
              "maximum": 500,
              "minimum": 0,
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "$count",
            "in": "query",
            "description": "OData $count parameter",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegalEntityQueryResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "adra_client_credentials": ["shared_api.public"],
            "adra_personal_access_token": ["shared_api.public"]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "LegalEntity": {
        "required": [
          "id",
          "engagementId",
          "code",
          "name",
          "countryCode",
          "currencyCode",
          "active"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "engagementId": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "countryCode": {
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "organizationNo": {
            "type": "string",
            "nullable": true
          },
          "address1": {
            "type": "string",
            "nullable": true
          },
          "address2": {
            "type": "string",
            "nullable": true
          },
          "postalCode": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "extraInfo": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "LegalEntityQueryResult": {
        "type": "object",
        "properties": {
          "value": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LegalEntity"
            }
          },
          "@odata.count": {
            "type": "string",
            "nullable": true
          },
          "@odata.nextPage": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "adra_oauth_client_cred": {
        "type": "oauth2",
        "description": "OAuth 2.0 Bearer Client Credentials Scheme",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://login.adra.com/connect/token",
            "scopes": {
              "shared_api.full_access": "shared_api.full_access"
            }
          }
        }
      },
      "adra_personal_access_token": {
        "type": "http",
        "description": "OAuth 2.0 Bearer Reference Token Scheme",
        "scheme": "Bearer"
      }
    }
  }
}