Component subscriptions

Endpoint can be called by:

GET /contractChanges/{id}?includeComponentSubscriptions=All&includeContract=false

Parameter values for the includeComponentSubscriptions:

Parameter valueDescription
AllContains unchanged and changed component subscriptions
ChangedContains only changed component subscriptions
None(Default) Contains no component subscriptions

Example response for a component subscription change

{
    "Id": "645b79cbd112e6cdaf20ab1a",
    "Type": "Timebased",
    "Timestamp": "2023-05-10T11:02:33.5350000Z",
    "ContractId": "645b60b7d112e6cdaf20a9f9",
    "ComponentSubscriptions": [
        {
            "Id": "645b7940d112e6cdaf20ab01",
            "Before": {
                "Id": "645b7940d112e6cdaf20ab01",
                "ComponentId": "63e62a0d9864a09b6e4b204b",
                "Quantity": 1,
                "StartDate": "2023-05-10T11:00:03.0000000Z",
                "Status": "Active"
            },
            "After": {
                "Id": "645b7940d112e6cdaf20ab01",
                "ComponentId": "63e62a0d9864a09b6e4b204b",
                "Quantity": 1,
                "StartDate": "2023-05-10T11:00:03.0000000Z",
                "Status": "Ended",
                "EndDate": "2023-05-10T11:02:33.5350000Z"
            }
        },
        {
            "Id": "645b795fd112e6cdaf20ab08",
            "Before": {
                "Id": "645b795fd112e6cdaf20ab08",
                "ComponentId": "63e62a0d9864a09b6e4b204b",
                "Quantity": 2,
                "StartDate": "2023-06-10T09:26:55.0170000Z",
                "Status": "Inactive"
            },
            "After": {
                "Id": "645b795fd112e6cdaf20ab08",
                "ComponentId": "63e62a0d9864a09b6e4b204b",
                "Quantity": 2,
                "StartDate": "2023-06-10T09:26:55.0170000Z",
                "Status": "Inactive"
            }
        }
    ]
}

T1 Component subscription creation and a direct start

{
    "ContractId": "647dc503715e7089c55b7798",
    "CustomerId": "647dc503715e7089c55b7794",
    "ExternalCustomerId": "753666",
    "ContractChangeId": "647dc58d715e7089c55b77bc",
    "ContractChangeType": "ComponentSubscriptionChange",
    "Event": "ContractChanged",
    "EntityId": "63b2d4405b49105c19fa7714"
}
{   
     "Id": "647dc58d715e7089c55b77bc",    
     "Type": "ComponentSubscriptionChange",    
     "Timestamp": "2023-06-05T11:22:53.1330000Z",    
     "ContractId": "647dc503715e7089c55b7798",    
     "ChangeDate": "2023-06-05T11:22:41.0000000Z",    
     "NewPlanVariantId": "63e62a0d9864a09b6e4b2048",    
     "NewPlanId": "63e62a0d9864a09b6e4b2045",    
     "ComponentSubscriptions": [
        {            
                    "Id": "647dc58d715e7089c55b77b8",
                    "After": {
                        "Id": "647dc58d715e7089c55b77b8",     
                        "ComponentId": "63e62a0d9864a09b6e4b204b",               
                        "Quantity": 1,
                        "StartDate": "2023-06-05T11:22:41.0000000Z",
                        "Status": "Active"    
                     }
        } 
   ]
}

T2 Component subscription quantity change

{
    "ContractId": "647dc503715e7089c55b7798",
    "CustomerId": "647dc503715e7089c55b7794",
    "ExternalCustomerId": "753666",
    "ContractChangeId": "647dc5de715e7089c55b77c6",
    "ContractChangeType": "ComponentSubscriptionChange",
    "Event": "ContractChanged",
    "EntityId": "63b2d4405b49105c19fa7714"
}
{   
     "Id": "647dc5de715e7089c55b77c6",    
     "Type": "ComponentSubscriptionChange",    
     "Timestamp": "2023-06-05T11:22:53.1330000Z",    
     "ContractId": "647dc503715e7089c55b7798",    
     "ChangeDate": "2023-06-05T11:22:41.0000000Z",    
     "NewPlanVariantId": "63e62a0d9864a09b6e4b2048",    
     "NewPlanId": "63e62a0d9864a09b6e4b2045",    
     "ComponentSubscriptions": [
               {            
                    "Id": "647dc58d715e7089c55b77b8",
                    "Before": {
                        "Id": "647dc58d715e7089c55b77b8",     
                        "ComponentId": "63e62a0d9864a09b6e4b204b",               
                        "Quantity": 1,
                        "StartDate": "2023-06-05T11:22:41.0000000Z",
                        "Status": "Active"    
                     },
                    "After": {
                        "Id": "647dc58d715e7089c55b77b8",     
                        "ComponentId": "63e62a0d9864a09b6e4b204b",               
                        "Quantity": 1,
                        "StartDate": "2023-06-05T11:22:41.0000000Z",
                        "EndDate": "2023-07-06T11:21:35.1830000Z",
                        "Status": "Active"    
                     }
               },
               {           
                    "Id": "647dc5de715e7089c55b77c3",
                    "After": { 
                        "Id": "647dc5de715e7089c55b77c3",
                        "ComponentId": "63e62a0d9864a09b6e4b204b",                
                        "Quantity": 2,
                        "StartDate": "2023-07-06T11:21:35.1830000Z",                
                        "Status": "Inactive"    
                   }
               }
            ]
}

T3 Component quantity change getting activated

{
    "ContractId": "647dbc1a715e7089c55b7696",
    "CustomerId": "647dbc1a715e7089c55b7692",
    "ExternalCustomerId": "631765",
    "ContractChangeId": "647dc63a6ff4e193d5eb0498",
    "ContractChangeType": "Timebased",
    "Event": "ContractChanged",
    "EntityId": "63b2d4405b49105c19fa7714"
}
{   
     "Id": "647dc63a6ff4e193d5eb0498",    
     "Type": "Timebased",    
     "Timestamp": "2023-07-06T11:21:35.1830000Z",    
     "ContractId": "647dc503715e7089c55b7798",       
     "NewPlanVariantId": "63e62a0d9864a09b6e4b2048",    
     "NewPlanId": "63e62a0d9864a09b6e4b2045",    
     "ComponentSubscriptions": [
               {            
                    "Id": "647dc58d715e7089c55b77b8",
                    "Before": {
                        "Id": "647dc58d715e7089c55b77b8",     
                        "ComponentId": "63e62a0d9864a09b6e4b204b",               
                        "Quantity": 1,
                        "StartDate": "2023-06-05T11:22:41.0000000Z",
                        "Status": "Active"    
                     },
                    "After": {
                        "Id": "647dc58d715e7089c55b77b8",     
                        "ComponentId": "63e62a0d9864a09b6e4b204b",               
                        "Quantity": 1,
                        "StartDate": "2023-06-05T11:22:41.0000000Z",
                        "EndDate": "2023-07-06T11:21:35.1830000Z",
                        "Status": "Ended"    
                     }
               },
               {           
                    "Id": "647dc5de715e7089c55b77c3",
                    "Before": { 
                        "Id": "647dc5de715e7089c55b77c3",
                        "ComponentId": "63e62a0d9864a09b6e4b204b",                
                        "Quantity": 2,
                        "StartDate": "2023-07-06T11:21:35.1830000Z",                
                        "Status": "Inactive"    
                   },
                    "After": { 
                        "Id": "647dc5de715e7089c55b77c3",
                        "ComponentId": "63e62a0d9864a09b6e4b204b",                
                        "Quantity": 2,
                        "StartDate": "2023-07-06T11:21:35.1830000Z",                
                        "Status": "Active"    
                   }
               }
            ]
}

T4 Component subscription direct end

{
    "ContractId": "647dbc1a715e7089c55b7696",
    "CustomerId": "647dbc1a715e7089c55b7692",
    "ExternalCustomerId": "631765",
    "ContractChangeId": "647dc69a0db8219696d3068f",
    "ContractChangeType": "DiscountSubscriptionChange",
    "Event": "ContractChanged",
    "EntityId": "63b2d4405b49105c19fa7714"
}
{   
     "Id": "647dc63a6ff4e193d5eb0498",    
     "Type": "ComponentSubscriptionChange",    
     "Timestamp": "2023-07-07T12:25:05.1230000Z",    
     "ContractId": "647dc503715e7089c55b7798", 
     "ChangeDate": "2023-07-07T12:25:05.1230000Z",      
     "NewPlanVariantId": "63e62a0d9864a09b6e4b2048",    
     "NewPlanId": "63e62a0d9864a09b6e4b2045",    
     "ComponentSubscriptions": [
               {            
                    "Id": "647dc58d715e7089c55b77b8",
                    "Before": {
                        "Id": "647dc58d715e7089c55b77b8",     
                        "ComponentId": "63e62a0d9864a09b6e4b204b",               
                        "Quantity": 1,
                        "StartDate": "2023-06-05T11:22:41.0000000Z",
                        "Status": "Ended"    
                     },
                    "After": {
                        "Id": "647dc58d715e7089c55b77b8",     
                        "ComponentId": "63e62a0d9864a09b6e4b204b",               
                        "Quantity": 1,
                        "StartDate": "2023-06-05T11:22:41.0000000Z",
                        "EndDate": "2023-07-06T11:21:35.1830000Z",
                        "Status": "Ended"    
                     }
               },
               {           
                    "Id": "647dc5de715e7089c55b77c3",
                    "Before": { 
                        "Id": "647dc5de715e7089c55b77c3",
                        "ComponentId": "63e62a0d9864a09b6e4b204b",                
                        "Quantity": 2,
                        "StartDate": "2023-07-06T11:21:35.1830000Z",                
                        "Status": "Active"    
                   },
                    "After": { 
                        "Id": "647dc5de715e7089c55b77c3",
                        "ComponentId": "63e62a0d9864a09b6e4b204b",                
                        "Quantity": 2,
                        "StartDate": "2023-07-06T11:21:35.1830000Z",
                        "EndDate": "2023-07-07T12:25:05.1230000Z",                
                        "Status": "Ended"    
                   }
               }
            ]
}

Response object contains:

  • A complete list of component subscriptions as a list with Before and After states for each object,
  • Detection of active component subscriptions has to be done, evaluating around the Timestamp of the contract change compared to the StartDate or EndDate of the ComponentSubscription.