Demand Forecast

Author: Accord Project

demandforecast@0.16.0 Clause ^0.26.0 5ee80448bbe03efba71bd10f1689d34f803f73238409a939f2e2d7e825a3ba59

A sample demandforecast clause.

Download Archive Download Compiled Archive Open in Template Playground Open in VSCode Web

Demand Forecast

A sample demand forecast clause.

Template Text

On or before the 04/02/2018, and thereafter on or before the last day of each calendar quarter, the Purchaser "PETER" shall send the Supplier "DAN" a Supply Forecast. The Supply Forecast will be a binding commitment on the Purchaser’s behalf to purchase during the first quarter included in each Supply Forecast at least 85% of the quantity of the listed Product.

On or before the 04/02/2018, and thereafter on or before the last day of each calendar quarter, the Purchaser "PETER" shall send the Supplier "DAN" a Supply Forecast. The Supply Forecast will be a binding commitment on the Purchaser’s behalf to purchase during the first quarter included in each Supply Forecast at least 85% of the quantity of the listed Product.
On or before the {{effectiveDate}}, and thereafter on or before the last day of each calendar quarter, the Purchaser {{purchaser}} shall send the Supplier {{supplier}} a Supply Forecast. The Supply Forecast will be a binding commitment on the Purchaser’s behalf to purchase during the first quarter included in each Supply Forecast at least {{minimumPercentage}}% of the quantity of the listed Product.
{
  "$class": "org.accordproject.demandforecast@0.1.0.TemplateModel",
  "purchaser": "PETER",
  "supplier": "DAN",
  "effectiveDate": "2018-04-02T00:00:00.000+01:00",
  "minimumPercentage": 85,
  "clauseId": "47beeea5-ae0e-4882-824b-7adcfaa2f5f1",
  "$identifier": "47beeea5-ae0e-4882-824b-7adcfaa2f5f1"
}

Template Model

namespace org.accordproject.demandforecast@0.1.0

import org.accordproject.contract@0.2.0.Clause from https://models.accordproject.org/accordproject/contract@0.2.0.cto
import org.accordproject.runtime@0.2.0.{Request,Response} from https://models.accordproject.org/accordproject/runtime@0.2.0.cto

@template
asset TemplateModel extends Clause {
  o String purchaser
  o String supplier
  o DateTime effectiveDate
  o Double minimumPercentage
}

/**
 * Defines the input data required by the template
 */
transaction ForecastRequest extends Request {
  /**
   * How much is the forecast?
   */
  o Double supplyForecast
}

transaction BindingResponse extends Response {
  /**
   * Amount must purchase.
   */
  o Double requiredPurchase
  /**
   * Which year?
   */
  o Integer year
  /**
   * Which quarter in this year?
   */
  o Integer quarter
}

Model Dependencies

Template Logic

Find the full logic for this template on on GitHub.

State Types

Type Sample JSON
org.accordproject.runtime@0.2.0.State
{
    "$class": "org.accordproject.runtime@0.2.0.State",
    "$identifier": "785856f0-50a4-11f1-a498-6b6dff021a96"
}

Request Types

Type Sample JSON
org.accordproject.demandforecast@0.1.0.ForecastRequest
{
    "$class": "org.accordproject.demandforecast@0.1.0.ForecastRequest",
    "supplyForecast": 172.629,
    "$timestamp": "2026-05-15T21:24:34.910Z"
}
org.accordproject.runtime@0.2.0.Request
{
    "$class": "org.accordproject.runtime@0.2.0.Request",
    "$timestamp": "2026-05-15T21:24:34.910Z"
}

Response Types

Type Sample JSON
org.accordproject.demandforecast@0.1.0.BindingResponse
{
    "$class": "org.accordproject.demandforecast@0.1.0.BindingResponse",
    "requiredPurchase": 6.525,
    "year": 3988,
    "quarter": 62946,
    "$timestamp": "2026-05-15T21:24:34.910Z"
}
org.accordproject.runtime@0.2.0.Response
{
    "$class": "org.accordproject.runtime@0.2.0.Response",
    "$timestamp": "2026-05-15T21:24:34.910Z"
}

Events Types

Type Sample JSON

Technical Integration

Please refer to the Accord Project documentation for how to use a template or integrate it within your application.

View the Latest code for this template on GitHub.