Hi,
As Layan said, your understanding is correct. To make the sequence clearer, there are two parts.
Building blocks in D365FO:
1. Request contract class, with the input such as the customer account (DataContract and DataMember attributes).
2. Response contract class, with the output such as the name, credit limit and orders.
3. Service class, with the operation method that takes the request contract and returns the response contract.
4. A Service object in the AOT that points to the service class and its operation.
5. A Service group that contains that service, which is what exposes it at the endpoint.
Runtime call sequence:
1. The external system gets an OAuth token from Microsoft Entra ID (the app registration must be set up for D365FO).
2. It sends a POST to https://<environment>/api/services/<ServiceGroup>/<Service>/<Operation> with the request contract as JSON.
3. D365FO runs the service operation, which reads the data and fills the response contract.
4. The response contract is returned to the caller as JSON.