{
  "openapi": "3.1.0",
  "info": {
    "title": "TRAK connector operations for Business Central",
    "version": "1.0.0",
    "description": "Outbound operations used by TRAK. The provider hosts these endpoints. Field lists describe the portion used by the connector."
  },
  "servers": [
    {
      "url": "https://api.businesscentral.dynamics.com/v2.0/{directory}/{environment}/api/v2.0",
      "variables": {
        "directory": {
          "default": "00000000-0000-4000-8000-000000000000"
        },
        "environment": {
          "default": "Sandbox"
        }
      }
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/companies({companyID})/customers": {
      "get": {
        "summary": "Read customers",
        "description": "Row identity: id. Display field: displayName.",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "$top",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "Sample size. The adapter bounds this to 1–200 rows."
          }
        ],
        "responses": {
          "200": {
            "description": "A bounded sample of records. Check external IDs and the continuation indicator before relying on the sample.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Provider error or insufficient access to this entity."
          },
          "401": {
            "description": "ERP rejected the configured credentials."
          },
          "403": {
            "description": "Application lacks permission to this resource."
          },
          "404": {
            "description": "Resource or licensed module could not be found."
          },
          "429": {
            "description": "Rate limit reached; wait before requesting another sample."
          }
        },
        "operationId": "get_companies_companyid_customers"
      }
    },
    "/companies({companyID})/items": {
      "get": {
        "summary": "Read items",
        "description": "Row identity: id. Display field: displayName.",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "$top",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "Sample size. The adapter bounds this to 1–200 rows."
          }
        ],
        "responses": {
          "200": {
            "description": "A bounded sample of records. Check external IDs and the continuation indicator before relying on the sample.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Provider error or insufficient access to this entity."
          },
          "401": {
            "description": "ERP rejected the configured credentials."
          },
          "403": {
            "description": "Application lacks permission to this resource."
          },
          "404": {
            "description": "Resource or licensed module could not be found."
          },
          "429": {
            "description": "Rate limit reached; wait before requesting another sample."
          }
        },
        "operationId": "get_companies_companyid_items"
      }
    },
    "/companies({companyID})/vendors": {
      "get": {
        "summary": "Read suppliers",
        "description": "Row identity: id. Display field: displayName.",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "$top",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "Sample size. The adapter bounds this to 1–200 rows."
          }
        ],
        "responses": {
          "200": {
            "description": "A bounded sample of records. Check external IDs and the continuation indicator before relying on the sample.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Provider error or insufficient access to this entity."
          },
          "401": {
            "description": "ERP rejected the configured credentials."
          },
          "403": {
            "description": "Application lacks permission to this resource."
          },
          "404": {
            "description": "Resource or licensed module could not be found."
          },
          "429": {
            "description": "Rate limit reached; wait before requesting another sample."
          }
        },
        "operationId": "get_companies_companyid_vendors"
      }
    },
    "/companies({companyID})/purchaseOrders": {
      "get": {
        "summary": "Read purchase orders",
        "description": "Row identity: id. Display field: number.",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "$top",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "Sample size. The adapter bounds this to 1–200 rows."
          }
        ],
        "responses": {
          "200": {
            "description": "A bounded sample of records. Check external IDs and the continuation indicator before relying on the sample.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "number": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Provider error or insufficient access to this entity."
          },
          "401": {
            "description": "ERP rejected the configured credentials."
          },
          "403": {
            "description": "Application lacks permission to this resource."
          },
          "404": {
            "description": "Resource or licensed module could not be found."
          },
          "429": {
            "description": "Rate limit reached; wait before requesting another sample."
          }
        },
        "operationId": "get_companies_companyid_purchaseorders"
      }
    },
    "/companies({companyID})/salesInvoices": {
      "get": {
        "summary": "Read sales invoice references",
        "description": "Row identity: id. Display field: number.",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "$top",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "Sample size. The adapter bounds this to 1–200 rows."
          }
        ],
        "responses": {
          "200": {
            "description": "A bounded sample of records. Check external IDs and the continuation indicator before relying on the sample.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "number": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Provider error or insufficient access to this entity."
          },
          "401": {
            "description": "ERP rejected the configured credentials."
          },
          "403": {
            "description": "Application lacks permission to this resource."
          },
          "404": {
            "description": "Resource or licensed module could not be found."
          },
          "429": {
            "description": "Rate limit reached; wait before requesting another sample."
          }
        },
        "operationId": "get_companies_companyid_salesinvoices"
      }
    },
    "/companies({companyID})/employees": {
      "get": {
        "summary": "Read employees",
        "description": "Row identity: id. Display field: displayName.",
        "parameters": [
          {
            "name": "companyID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "$top",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 200
            },
            "description": "Sample size. The adapter bounds this to 1–200 rows."
          }
        ],
        "responses": {
          "200": {
            "description": "A bounded sample of records. Check external IDs and the continuation indicator before relying on the sample.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Provider error or insufficient access to this entity."
          },
          "401": {
            "description": "ERP rejected the configured credentials."
          },
          "403": {
            "description": "Application lacks permission to this resource."
          },
          "404": {
            "description": "Resource or licensed module could not be found."
          },
          "429": {
            "description": "Rate limit reached; wait before requesting another sample."
          }
        },
        "operationId": "get_companies_companyid_employees"
      }
    },
    "/companies": {
      "get": {
        "summary": "List accessible companies",
        "responses": {
          "200": {
            "description": "List accessible companies. Use the exact ID of an accessible company.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "The provider could not complete this check."
          },
          "401": {
            "description": "ERP rejected the configured credentials."
          },
          "403": {
            "description": "Application lacks permission to this resource."
          },
          "404": {
            "description": "Resource or licensed module could not be found."
          },
          "429": {
            "description": "Rate limit reached; wait before requesting another sample."
          }
        },
        "operationId": "get_companies"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {}
  }
}
