Payment Upon Delivery

Author: Accord Project

payment-upon-delivery@1.0.1 Contract ^2.0.0 415b65a46a9411fdc76a8ce28a4d559a9648d4fc507d9353e87a088c5d5e825d

This is a one time payment contract upon acceptance of delivery.

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

Payment upon delivery

This is a one time payment contract upon acceptance of delivery.

Template Text

Upon delivery and acceptance, "Michael" shall pay to "Diana" the cost of goods (9.99 USD) and the delivery fee (1.99 USD).

Upon delivery and acceptance, "Michael" shall pay to "Diana" the cost of goods (9.99 USD) and the delivery fee (1.99 USD).
Upon delivery and acceptance, {{buyer}} shall pay to {{seller}} the cost of goods ({{costOfGoods}}) and the delivery fee ({{deliveryFee}}).
{
  "$class": "org.accordproject.paymentupondelivery@0.2.0.TemplateModel",
  "buyer": "Michael",
  "seller": "Diana",
  "costOfGoods": {
    "$class": "org.accordproject.money@0.3.0.MonetaryAmount",
    "doubleValue": 9.99,
    "currencyCode": "USD"
  },
  "deliveryFee": {
    "$class": "org.accordproject.money@0.3.0.MonetaryAmount",
    "doubleValue": 1.99,
    "currencyCode": "USD"
  },
  "$identifier": "14a1a72f-99da-4d76-947d-d62b26e98c68",
  "contractId": "14a1a72f-99da-4d76-947d-d62b26e98c68"
}

Template Model

namespace org.accordproject.paymentupondelivery@0.2.0

import org.accordproject.contract@0.2.0.Contract from https://models.accordproject.org/accordproject/contract@0.2.0.cto
import org.accordproject.runtime@0.2.0.{Request,Response,Obligation} from https://models.accordproject.org/accordproject/runtime@0.2.0.cto
import org.accordproject.money@0.3.0.MonetaryAmount from https://models.accordproject.org/money@0.3.0.cto

/**
 * The template model
 */
@template
asset TemplateModel extends Contract {
  o String buyer
  o String seller
  o MonetaryAmount costOfGoods
  o MonetaryAmount deliveryFee
}

transaction DeliveryAcceptedRequest extends Request {}

transaction DeliveryAcceptedResponse extends Response {
  o MonetaryAmount totalAmount
}

// Event emitted when a payment obligation is triggered
event PaymentObligationEvent extends Obligation {
  o MonetaryAmount amount
  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": "4f495ec0-97d6-11f1-9df3-81e11c024ca9"
}

Request Types

Type Sample JSON
org.accordproject.paymentupondelivery@0.2.0.DeliveryAcceptedRequest
{
    "$class": "org.accordproject.paymentupondelivery@0.2.0.DeliveryAcceptedRequest",
    "$timestamp": "2026-08-14T11:50:13.420Z"
}
org.accordproject.runtime@0.2.0.Request
{
    "$class": "org.accordproject.runtime@0.2.0.Request",
    "$timestamp": "2026-08-14T11:50:13.420Z"
}

Response Types

Type Sample JSON
org.accordproject.paymentupondelivery@0.2.0.DeliveryAcceptedResponse
{
    "$class": "org.accordproject.paymentupondelivery@0.2.0.DeliveryAcceptedResponse",
    "totalAmount": {
        "$class": "org.accordproject.money@0.3.0.MonetaryAmount",
        "doubleValue": 254.824,
        "currencyCode": "JMD"
    },
    "$timestamp": "2026-08-14T11:50:13.420Z"
}
org.accordproject.runtime@0.2.0.Response
{
    "$class": "org.accordproject.runtime@0.2.0.Response",
    "$timestamp": "2026-08-14T11:50:13.420Z"
}

Events Types

Type Sample JSON
org.accordproject.paymentupondelivery@0.2.0.PaymentObligationEvent
// sample generation failed: No concrete extending type for "concerto@1.0.0.Participant".

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.