Salesforce APEX rest service method for Get by ID

Job ID: 32871698

Budget: $30 – $250 USD

Looking for the code implementation for custom REST API in salesforce as a hosted server-less function named sdplicensecheck so that contract subscription line data can by retrieve from salesforce by account id.

Output Json sample below shows that the array of contract subscriptions should be returned with shown salesforce object fields for the account id provided to the rest API
{
"AccountId": "123456789",
"Contracts": [
{
"ContractId": "0001",
"Stage": "Testing",
"SubscriptionId": "1",
"ProductCode": "SDF-E-S100",
"Quantity": "1",
"StartDate": "2022-01-01",
"EndDate": "2022-12-31"
},
{
"ContractId": "0001",
"Stage": "Testing",
"SubscriptionId": "2",
"ProductCode": "SDW-E-S100",
"Quantity": "1",
"StartDate": "2022-01-01",
"EndDate": "2022-12-31"
},
{
"ContractId": "0001",
"Stage": "Testing",
"SubscriptionId": "3",
"ProductCode":"SDP-CA-B100",
"Quantity": "1",
"StartDate": "2022-01-01",
"EndDate": "2022-12-31"
}
]
}