Late Invoice with Payment

Author: Accord Project

lateinvoicewithpayment@0.8.0 Contract ^0.26.0 03252b60823383628ed1bf41bd50fc61798f0c88ca90f3243e9b07d8ce045c7a

A sample Late invoice clause which emits a payment obligation.

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

Late Invoice Clause With Payment

A sample Late invoice clause which emits a payment obligation.

Template Text

2.4 "Betty Buyer" is not required to pay any invoice that is issued more than 180 days after it is due to be issued by "Steve Seller".

2.4 "Betty Buyer" is not required to pay any invoice that is issued more than 180 days after it is due to be issued by "Steve Seller".
2.4 {{purchaser}} is not required to pay any invoice that is issued more than {{maximumDelay}} after it is due to be issued by {{supplier}}.
{
  "$class": "org.accordproject.lateinvoicewithpayment@0.1.0.TemplateModel",
  "maximumDelay": {
    "$class": "org.accordproject.time@0.3.0.Duration",
    "amount": 180,
    "unit": "days"
  },
  "purchaser": "resource:org.accordproject.party.Party#Betty%20Buyer",
  "supplier": "resource:org.accordproject.party.Party#Steve%20Seller",
  "$identifier": "a6d1af73-448e-4892-a357-b11322a22532",
  "clauseId": "a6d1af73-448e-4892-a357-b11322a22532"
}

Template Model

namespace org.accordproject.lateinvoicewithpayment@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
import org.accordproject.time@0.3.0.{Duration,TemporalUnit} from https://models.accordproject.org/time@0.3.0.cto

/**
 * Defines the data model for the LateInvoice template.
 * This defines the structure of the abstract syntax tree that the parser for the template
 * must generate from input source text.
 */
@template
asset TemplateModel extends Clause {
  /**
   * If the invoice deliver date  >= termination date then the buyer does not have to pay
   */
  o Duration maximumDelay
  o String purchaser
  o String supplier
}

/**
 * Defines the input data required by the template
 */
transaction LateInvoiceRequest extends Request {
  /**
   * What was the agreed delivery date for the invoice?
   */
  o DateTime invoiceDue
  o Double amountDue
  o String currencyCode
}

/**
 * Defines the output data for the template
 */
transaction LateInvoiceResponse extends Response {
  o Boolean paymentRequired
  o String cause optional
}

// Event emitted when payment is required
event PaymentObligationEvent {
  o Double amount
  o String currencyCode
  o String description
}

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": "7b6b1530-50a4-11f1-a498-6b6dff021a96"
}

Request Types

Type Sample JSON
org.accordproject.lateinvoicewithpayment@0.1.0.LateInvoiceRequest
{
    "$class": "org.accordproject.lateinvoicewithpayment@0.1.0.LateInvoiceRequest",
    "invoiceDue": "2026-05-15T21:24:40.066Z",
    "amountDue": 31.346,
    "currencyCode": "Sint aute fugiat duis dolore.",
    "$timestamp": "2026-05-15T21:24:40.066Z"
}
org.accordproject.runtime@0.2.0.Request
{
    "$class": "org.accordproject.runtime@0.2.0.Request",
    "$timestamp": "2026-05-15T21:24:40.066Z"
}

Response Types

Type Sample JSON
org.accordproject.lateinvoicewithpayment@0.1.0.LateInvoiceResponse
{
    "$class": "org.accordproject.lateinvoicewithpayment@0.1.0.LateInvoiceResponse",
    "paymentRequired": true,
    "cause": "Commodo velit.",
    "$timestamp": "2026-05-15T21:24:40.067Z"
}
org.accordproject.runtime@0.2.0.Response
{
    "$class": "org.accordproject.runtime@0.2.0.Response",
    "$timestamp": "2026-05-15T21:24:40.067Z"
}

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.