Purchase Order Failure

Author: Accord Project

purchase-order-failure@1.0.1 Contract ^2.0.0 ee6d90ff6e78cdd8d2913b617bcba99f9b3ab79f1eba77585306013031e585e2

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": "ACME Corp",
  "lateOne": {
    "$class": "org.accordproject.time@0.3.0.Duration",
    "amount": 2,
    "unit": "days"
  },
  "lateTwo": {
    "$class": "org.accordproject.time@0.3.0.Duration",
    "amount": 5,
    "unit": "days"
  },
  "lateThree": {
    "$class": "org.accordproject.time@0.3.0.Duration",
    "amount": 10,
    "unit": "days"
  },
  "lateOnePercent": 2.0,
  "lateTwoPercent": 5.0,
  "lateThreePercent": 10.0,
  "article": "Article 5.2",
  "thisSection": "Section 7.1",
  "maxFailures": 3,
  "failureRange": {
    "$class": "org.accordproject.time@0.3.0.Duration",
    "amount": 30,
    "unit": "days"
  },
  "repeatedFailureCompensationAmount": {
    "$class": "org.accordproject.money@0.3.0.MonetaryAmount",
    "doubleValue": 5000.0,
    "currencyCode": "USD"
  },
  "repeatedFailureCompensationCurrency": "USD",
  "contractId": "d3e3a1c4-7f2b-4e6a-9c8d-1a2b3c4d5e6f",
  "$identifier": "d3e3a1c4-7f2b-4e6a-9c8d-1a2b3c4d5e6f"
}

Template Model

namespace org.accordproject.docusignpofailure@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,State,Obligation} 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 extends Obligation {
  o MonetaryAmount penaltyAmount
  o String description
}

asset PurchaseOrderFailureState extends State {
  o DateTime[] pastFailures
  o Integer nbPastFailures default=0
}

@template
asset TemplateModel extends Contract {
  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.docusignpofailure@0.2.0.PurchaseOrderFailureState
{
    "$class": "org.accordproject.docusignpofailure@0.2.0.PurchaseOrderFailureState",
    "pastFailures": [
        "2026-08-14T11:50:06.512Z"
    ],
    "nbPastFailures": 0,
    "$identifier": "4b2b23f1-97d6-11f1-9df3-81e11c024ca9"
}
org.accordproject.runtime@0.2.0.State
{
    "$class": "org.accordproject.runtime@0.2.0.State",
    "$identifier": "4b2b23f0-97d6-11f1-9df3-81e11c024ca9"
}

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": "Declined",
        "envelopeId": "Sunt voluptate qui ipsum.",
        "created": "2026-08-14T11:50:06.510Z",
        "sent": "2026-08-14T11:50:06.510Z",
        "delivered": "2026-08-14T11:50:06.510Z",
        "signed": "2026-08-14T11:50:06.510Z",
        "completed": "2026-08-14T11:50:06.510Z",
        "declined": "2026-08-14T11:50:06.510Z",
        "email": "Commodo."
    },
    "recipients": [
        {
            "$class": "com.docusign.connect@0.4.0.Recipient",
            "status": "FaxPending",
            "email": "Nulla labore aliqua et.",
            "userName": "Qui.",
            "sent": "2026-08-14T11:50:06.510Z",
            "delivered": "2026-08-14T11:50:06.510Z",
            "signed": "2026-08-14T11:50:06.510Z",
            "declined": "2026-08-14T11:50:06.510Z",
            "declineReason": "Do non eiusmod mollit ipsum.",
            "tabStatuses": [
                {
                    "$class": "com.docusign.connect@0.4.0.NumberTabStatus",
                    "tabName": "Nulla culpa quis reprehenderit in.",
                    "tabValue": 246.247,
                    "tabType": "InitialHereOptional",
                    "status": "Incididunt.",
                    "tabLabel": "Excepteur.",
                    "originalValue": "Consequat amet.",
                    "signed": "2026-08-14T11:50:06.510Z",
                    "customTabType": "Text"
                }
            ]
        }
    ],
    "customFields": [
        {
            "$class": "com.docusign.connect@0.4.0.CustomField",
            "name": "Excepteur amet aliquip.",
            "value": "Laboris officia do."
        }
    ],
    "attachments": [
        {
            "$class": "com.docusign.connect@0.4.0.Attachment",
            "docType": "CertificateOfCompletion",
            "identifier": "2020",
            "name": "Anim labore duis.",
            "mimeType": "Aliquip enim.",
            "encoding": "base64",
            "$identifier": "2020"
        }
    ],
    "$timestamp": "2026-08-14T11:50:06.510Z"
}
org.accordproject.runtime@0.2.0.Request
{
    "$class": "org.accordproject.runtime@0.2.0.Request",
    "$timestamp": "2026-08-14T11:50:06.510Z"
}

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": 187.803,
        "currencyCode": "SLL"
    },
    "$timestamp": "2026-08-14T11:50:06.511Z"
}
org.accordproject.runtime@0.2.0.Response
{
    "$class": "org.accordproject.runtime@0.2.0.Response",
    "$timestamp": "2026-08-14T11:50:06.511Z"
}

Events Types

Type Sample JSON
org.accordproject.docusignpofailure@0.2.0.PurchaseOrderPaymentEvent
// 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.