- Welcome to our Dev Docs!
- Use Cases
- Contract Changes
- Contract with a trial phase with a start in the future
Contract with a trial phase with a start in the future
This use case will describe a scenario, where a contract will start in the future and will have a trail phase, which is automatically followed by a normal paid phase.
Example 43. ContractCreated Webhook
{ "ContractId": "6463d85f0507e90bf5acfd94", "CustomerId": "6463d85f0507e90bf5acfd90", "ExternalCustomerId": "925871", "ContractChangeId": "6463d85f0507e90bf5acfd9e", "Event": "ContractCreated", "EntityId": "63b2d4405b49105c19fa7714" }
Example 44. ContractChanged Webhook
{ "ContractId": "6463d85f0507e90bf5acfd94", "CustomerId": "6463d85f0507e90bf5acfd90", "ExternalCustomerId": "925871", "ContractChangeId": "6463d85f0507e90bf5acfd9e", "ContractChangeType": "Signup", "Event": "ContractChanged", "EntityId": "63b2d4405b49105c19fa7714" }
Example 45. Contract Change Details Webhook
Response from the endpoint GET /api/contractchanges/ContractChangeId
.
{ "Id": "6463d85f0507e90bf5acfd9e", "Type": "Signup", "Timestamp": "2023-05-16T19:24:15.5920000Z", "OrderId": "6463d85f938dee33e497db61", "ContractId": "6463d85f0507e90bf5acfd94", "ChangeDate": "2023-05-16T19:26:15.2890000Z", "NewPlanVariantId": "64478300c37cfa946c6d6140", "NewPlanId": "644782f0c37cfa946c6d6135", "Contract": { "Id": "6463d85f0507e90bf5acfd94", "After": { "Phases": [ { "Type": "Trial", "StartDate": "2023-05-16T19:26:15.2890000Z", "PlanVariantId": "64478300c37cfa946c6d6140", "PlanId": "644782f0c37cfa946c6d6135", "Quantity": 1, "InheritStartDate": false }, { "Type": "Normal", "StartDate": "2023-06-16T19:26:15.2890000Z", "PlanVariantId": "64478300c37cfa946c6d6140", "PlanId": "644782f0c37cfa946c6d6135", "Quantity": 1, "InheritStartDate": false } ] } } }
Example 46. ContractChanged Webhook
{ "ContractId": "6463d85f0507e90bf5acfd94", "CustomerId": "6463d85f0507e90bf5acfd90", "ExternalCustomerId": "925871", "ContractChangeId": "6463d8d7fa52c0d8ca29cf2b", "ContractChangeType": "Timebased", "Event": "ContractChanged", "EntityId": "63b2d4405b49105c19fa7714" }
Example 47. Contract Change Details Webhook
Response from the endpoint GET /api/contractchanges/ContractChangeId
.
{ "Id": "6463d8d7fa52c0d8ca29cf2b", "Type": "Timebased", "Timestamp": "2023-05-16T19:26:15.2890000Z", "ContractId": "6463d85f0507e90bf5acfd94", "Contract": { "Id": "6463d85f0507e90bf5acfd94", "Before": { "Phases": [ { "Type": "Trial", "StartDate": "2023-05-16T19:26:15.2890000Z", "PlanVariantId": "64478300c37cfa946c6d6140", "PlanId": "644782f0c37cfa946c6d6135", "Quantity": 1, "InheritStartDate": false }, { "Type": "Normal", "StartDate": "2023-06-16T19:26:15.2890000Z", "PlanVariantId": "64478300c37cfa946c6d6140", "PlanId": "644782f0c37cfa946c6d6135", "Quantity": 1, "InheritStartDate": false } ] }, "After": { "CurrentPhase": { "Type": "Trial", "StartDate": "2023-05-16T19:26:15.2890000Z", "PlanVariantId": "64478300c37cfa946c6d6140", "PlanId": "644782f0c37cfa946c6d6135", "Quantity": 1, "InheritStartDate": false }, "Phases": [ { "Type": "Trial", "StartDate": "2023-05-16T19:26:15.2890000Z", "PlanVariantId": "64478300c37cfa946c6d6140", "PlanId": "644782f0c37cfa946c6d6135", "Quantity": 1, "InheritStartDate": false }, { "Type": "Normal", "StartDate": "2023-06-16T19:26:15.2890000Z", "PlanVariantId": "64478300c37cfa946c6d6140", "PlanId": "644782f0c37cfa946c6d6135", "Quantity": 1, "InheritStartDate": false } ] } } }
Example 48. ContractChanged Webhook
{ "ContractId": "6463d85f0507e90bf5acfd94", "CustomerId": "6463d85f0507e90bf5acfd90", "ExternalCustomerId": "925871", "ContractChangeId": "648c9b371952c427f73294e3", "ContractChangeType": "Timebased", "Event": "ContractChanged", "EntityId": "63b2d4405b49105c19fa7714" }
Example 49. Contract Change Details Webhook
Response from the endpoint GET /api/contractchanges/ContractChangeId
.
{ "Id": "648c9b371952c427f73294e3", "Type": "Timebased", "Timestamp": "2023-06-16T19:26:15.2890000Z", "ContractId": "6463d85f0507e90bf5acfd94", "Contract": { "Id": "6463d85f0507e90bf5acfd94", "Before": { "CurrentPhase": { "Type": "Trial", "StartDate": "2023-05-16T19:26:15.2890000Z", "PlanVariantId": "64478300c37cfa946c6d6140", "PlanId": "644782f0c37cfa946c6d6135", "Quantity": 1, "InheritStartDate": false }, "Phases": [ { "Type": "Trial", "StartDate": "2023-05-16T19:26:15.2890000Z", "PlanVariantId": "64478300c37cfa946c6d6140", "PlanId": "644782f0c37cfa946c6d6135", "Quantity": 1, "InheritStartDate": false }, { "Type": "Normal", "StartDate": "2023-06-16T19:26:15.2890000Z", "PlanVariantId": "64478300c37cfa946c6d6140", "PlanId": "644782f0c37cfa946c6d6135", "Quantity": 1, "InheritStartDate": false } ] }, "After": { "CurrentPhase": { "Type": "Normal", "StartDate": "2023-06-16T19:26:15.2890000Z", "PlanVariantId": "64478300c37cfa946c6d6140", "PlanId": "644782f0c37cfa946c6d6135", "Quantity": 1, "InheritStartDate": false }, "Phases": [ { "Type": "Trial", "StartDate": "2023-05-16T19:26:15.2890000Z", "PlanVariantId": "64478300c37cfa946c6d6140", "PlanId": "644782f0c37cfa946c6d6135", "Quantity": 1, "InheritStartDate": false }, { "Type": "Normal", "StartDate": "2023-06-16T19:26:15.2890000Z", "PlanVariantId": "64478300c37cfa946c6d6140", "PlanId": "644782f0c37cfa946c6d6135", "Quantity": 1, "InheritStartDate": false } ] } } }
In this section: