Purchase Order Failure

Author: Accord Project

purchase-order-failure@0.13.0 Contract ^0.26.0 aedee97d8ea22b62e3401a2163927e7e831b8c5233f1274f1b188ccaccf9431c

Issues credits for late purchase orders. Purchase orders sent via DocuSign must have the text recipient tabs with the following tab labels and validations: deliveryDate with Date validation, actualPrice with Numbers validation and currencyCode with no validation.

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

Purchase Order Failure

This clause emits a payment obligation for purchase orders that are received late. Purchase orders sent via DocuSign must have the "text" recipient tabs with the following tab labels and validations: deliveryDate with "Date" validation, actualPrice with "Numbers" validation and currencyCode with no validation.

Template Text

In the event that a Purchase Order Failure causes any Product to be delivered more than 1 days after the delivery date for such Product specified in the applicable Purchase Order therefore, "Buyer Corp" shall be entitled to receive a 5.0% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to "Article 5". In the event that a Purchase Order Failure causes any Product to be delivered more than 2 days after the delivery date for such Product specified in the applicable Purchase Order therefore, "Buyer Corp" shall be entitled to receive a 10% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to "Article 5". In the event that a Purchase Order Failure causes any Product to be delivered more than 10 days, after the delivery date for such Product specified in the applicable Purchase Order therefore, "Buyer Corp" shall be entitled to receive a 50% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to "Article 5". Any discount amount owing to "Buyer Corp" pursuant to this "Section 3.5(c)" shall be paid by paying "Buyer Corp" such amount via electronic money transfer. In case of 5 or more Purchase Order Failures in the past 60 days, then "Buyer Corp" shall be entitled to an additional 599.99 USD compensation.

In the event that a Purchase Order Failure causes any Product to be delivered more than 1 days after the delivery date for such Product specified in the applicable Purchase Order therefore, "Buyer Corp" shall be entitled to receive a 5.0% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to "Article 5". In the event that a Purchase Order Failure causes any Product to be delivered more than 2 days after the delivery date for such Product specified in the applicable Purchase Order therefore, "Buyer Corp" shall be entitled to receive a 10% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to "Article 5". In the event that a Purchase Order Failure causes any Product to be delivered more than 10 days, after the delivery date for such Product specified in the applicable Purchase Order therefore, "Buyer Corp" shall be entitled to receive a 50% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to "Article 5". Any discount amount owing to "Buyer Corp" pursuant to this "Section 3.5(c)" shall be paid by paying "Buyer Corp" such amount via electronic money transfer. In case of 5 or more Purchase Order Failures in the past 60 days, then "Buyer Corp" shall be entitled to an additional 599.99 USD compensation.
In the event that a Purchase Order Failure causes any Product to be delivered more than {{lateOne}} after the delivery date for such Product specified in the applicable Purchase Order therefore, {{buyerName}} shall be entitled to receive a {{lateOnePercent}}% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to {{article}}. In the event that a Purchase Order Failure causes any Product to be delivered more than {{lateTwo}} after the delivery date for such Product specified in the applicable Purchase Order therefore, {{buyerName}} shall be entitled to receive a {{lateTwoPercent}}% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to {{article}}. In the event that a Purchase Order Failure causes any Product to be delivered more than {{lateThree}}, after the delivery date for such Product specified in the applicable Purchase Order therefore, {{buyerName}} shall be entitled to receive a {{lateThreePercent}}% discount on the Actual Price for such late delivered Product which would otherwise have been payable pursuant to {{article}}. Any discount amount owing to {{buyerName}} pursuant to this {{thisSection}} shall be paid by paying {{buyerName}} such amount via electronic money transfer. In case of {{maxFailures}} or more Purchase Order Failures in the past {{failureRange}}, then {{buyerName}} shall be entitled to an additional {{repeatedFailureCompensationAmount}} {{repeatedFailureCompensationCurrency}} compensation.
{
    "$class": "org.accordproject.docusignpofailure@0.2.0.TemplateModel",
    "buyerName": "Ut incididunt reprehenderit.",
    "lateOne": {
        "$class": "org.accordproject.time@0.3.0.Duration",
        "amount": 2767949212,
        "unit": "minutes"
    },
    "lateTwo": {
        "$class": "org.accordproject.time@0.3.0.Duration",
        "amount": 1793979708,
        "unit": "weeks"
    },
    "lateThree": {
        "$class": "org.accordproject.time@0.3.0.Duration",
        "amount": 4238084325,
        "unit": "days"
    },
    "lateOnePercent": 140.116,
    "lateTwoPercent": 116.885,
    "lateThreePercent": 35.944,
    "article": "Exercitation.",
    "thisSection": "Quis nulla velit.",
    "maxFailures": 47200,
    "failureRange": {
        "$class": "org.accordproject.time@0.3.0.Duration",
        "amount": 2791552913,
        "unit": "hours"
    },
    "repeatedFailureCompensationAmount": {
        "$class": "org.accordproject.money@0.3.0.MonetaryAmount",
        "doubleValue": 230.887,
        "currencyCode": "TND"
    },
    "repeatedFailureCompensationCurrency": "Amet.",
    "clauseId": "b2c36760-5150-11f1-abe1-4375007ed584",
    "$identifier": "b2c36760-5150-11f1-abe1-4375007ed584"
}

Template Model

namespace org.accordproject.docusignpofailure@0.2.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 from https://models.accordproject.org/time@0.3.0.cto
import com.docusign.connect@0.4.0.DocuSignEnvelopeInformation from https://models.accordproject.org/docusign/connect@0.4.0.cto
import org.accordproject.money@0.3.0.MonetaryAmount from https://models.accordproject.org/money@0.3.0.cto

transaction PurchaseOrderFailureResponse extends Response {
  o MonetaryAmount penaltyAmount
}

event PurchaseOrderPaymentEvent {
  o MonetaryAmount penaltyAmount
  o String description
}

concept PurchaseOrderFailureState identified {
  o DateTime[] pastFailures
  o Integer nbPastFailures default=0
}

@template
asset TemplateModel extends Clause {
  o String buyerName

  o Duration lateOne
  o Duration lateTwo
  o Duration lateThree

  o Double lateOnePercent
  o Double lateTwoPercent
  o Double lateThreePercent

  o String article
  o String thisSection

  o Integer maxFailures
  o Duration failureRange
  o MonetaryAmount repeatedFailureCompensationAmount
  o String repeatedFailureCompensationCurrency
}

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": "b2c42ab0-5150-11f1-abe1-4375007ed584"
}

Request Types

Type Sample JSON
com.docusign.connect@0.4.0.DocuSignEnvelopeInformation
{
    "$class": "com.docusign.connect@0.4.0.DocuSignEnvelopeInformation",
    "envelopeStatus": {
        "$class": "com.docusign.connect@0.4.0.EnvelopeStatus",
        "status": "Created",
        "envelopeId": "Est sunt sit excepteur veniam.",
        "created": "2026-05-16T18:57:26.359+01:00",
        "sent": "2026-05-16T18:57:26.359+01:00",
        "delivered": "2026-05-16T18:57:26.359+01:00",
        "signed": "2026-05-16T18:57:26.359+01:00",
        "completed": "2026-05-16T18:57:26.359+01:00",
        "declined": "2026-05-16T18:57:26.359+01:00",
        "email": "Amet proident fugiat."
    },
    "recipients": [
        {
            "$class": "com.docusign.connect@0.4.0.Recipient",
            "status": "Created",
            "email": "Et pariatur ex.",
            "userName": "Et Lorem consequat.",
            "sent": "2026-05-16T18:57:26.359+01:00",
            "delivered": "2026-05-16T18:57:26.359+01:00",
            "signed": "2026-05-16T18:57:26.359+01:00",
            "declined": "2026-05-16T18:57:26.359+01:00",
            "declineReason": "Veniam.",
            "tabStatuses": [
                {
                    "$class": "com.docusign.connect@0.4.0.NumberTabStatus",
                    "tabName": "Lorem amet aliquip aliqua.",
                    "tabValue": 166.398,
                    "tabType": "Custom",
                    "status": "Ad pariatur excepteur nisi do.",
                    "tabLabel": "Et ut.",
                    "originalValue": "Reprehenderit.",
                    "signed": "2026-05-16T18:57:26.359+01:00",
                    "customTabType": "Date"
                }
            ]
        }
    ],
    "customFields": [
        {
            "$class": "com.docusign.connect@0.4.0.CustomField",
            "name": "Nulla sit.",
            "value": "Officia."
        }
    ],
    "attachments": [
        {
            "$class": "com.docusign.connect@0.4.0.Attachment",
            "docType": "CertificateOfCompletion",
            "identifier": "8113",
            "name": "In ea irure labore laboris.",
            "mimeType": "Laboris id.",
            "encoding": "base64",
            "$identifier": "8113"
        }
    ],
    "$timestamp": "2026-05-16T18:57:26.359+01:00"
}
org.accordproject.runtime@0.2.0.Request
{
    "$class": "org.accordproject.runtime@0.2.0.Request",
    "$timestamp": "2026-05-16T18:57:26.359+01:00"
}

Response Types

Type Sample JSON
org.accordproject.docusignpofailure@0.2.0.PurchaseOrderFailureResponse
{
    "$class": "org.accordproject.docusignpofailure@0.2.0.PurchaseOrderFailureResponse",
    "penaltyAmount": {
        "$class": "org.accordproject.money@0.3.0.MonetaryAmount",
        "doubleValue": 162.656,
        "currencyCode": "IDR"
    },
    "$timestamp": "2026-05-16T18:57:26.362+01:00"
}
org.accordproject.runtime@0.2.0.Response
{
    "$class": "org.accordproject.runtime@0.2.0.Response",
    "$timestamp": "2026-05-16T18:57:26.362+01:00"
}

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.