{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://unvtd.unece.org/promissory-note-schema.json",
  "title": "Promissory Note",
  "description": "An unconditional written promise by one party (the maker) to pay a definite sum of money to another party (the payee) at a fixed or determinable future time or on demand.",
  "type": "object",
  "required": [
    "@context",
    "type",
    "issuer",
    "credentialSubject",
    "credentialSchema"
  ],
  "properties": {
    "@context": {
      "type": "array",
      "description": "JSON-LD contexts: the W3C Verifiable Credentials v2 context, followed by this document's context.",
      "const": [
        "https://www.w3.org/ns/credentials/v2",
        "https://unvtd.unece.org/promissory-note-context.jsonld"
      ]
    },
    "type": {
      "type": "array",
      "description": "Credential types.",
      "const": [
        "VerifiableCredential",
        "PromissoryNoteCredential"
      ]
    },
    "name": {
      "type": "string",
      "description": "Human-readable name of the credential, for display.",
      "example": "Promissory Note"
    },
    "credentialSchema": {
      "type": "object",
      "description": "Reference to the credential schema for validation",
      "properties": {
        "id": {
          "type": "string",
          "format": "uri",
          "const": "https://unvtd.unece.org/promissory-note-schema.json",
          "description": "Public location of the schema"
        },
        "type": {
          "type": "string",
          "const": "JsonSchema",
          "description": "Schema type identifier"
        }
      },
      "required": [
        "id",
        "type"
      ]
    },
    "id": {
      "type": "string",
      "format": "uri",
      "description": "Unique identifier for the credential",
      "example": "urn:uuid:pn-2025-001"
    },
    "validFrom": {
      "example": "2025-03-06T10:00:00.000Z",
      "type": "string",
      "format": "date-time",
      "description": "Credential validity start date"
    },
    "validUntil": {
      "example": "2026-03-06T10:00:00.000Z",
      "type": "string",
      "format": "date-time",
      "description": "Date until which this credential is valid."
    },
    "issuer": {
      "description": "Identifier of the party making the promise (the maker/issuer, e.g., DID)",
      "type": "string",
      "format": "uri",
      "example": "did:web:waveridersupplies.example.com"
    },
    "credentialSubject": {
      "name": "PromissoryNote",
      "description": "Promissory note details",
      "type": "object",
      "required": [
        "type",
        "documentIdentifier",
        "issueDate",
        "paymentDueDate",
        "placeOfIssue",
        "issuerDrawer",
        "payee",
        "monetaryAmount",
        "paymentTerms",
        "authentication",
        "documentEndorsement"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of the business document.",
          "const": "PromissoryNote"
        },
        "documentIdentifier": {
          "example": "PN-2025-031-001",
          "type": "string",
          "description": "Reference number identifying a specific document."
        },
        "issueDate": {
          "example": "2025-03-10T00:00:00Z",
          "type": "string",
          "format": "date-time",
          "description": "Date that a document was issued and when appropriate, signed or otherwise authenticated."
        },
        "paymentDueDate": {
          "example": "2025-06-10T00:00:00Z",
          "type": "string",
          "format": "date-time",
          "description": "Date when an amount due should be made available to the creditor under the terms of payment."
        },
        "placeOfIssue": {
          "description": "Location where a document was issued.",
          "type": "object",
          "properties": {
            "addressLocality": {
              "example": "Williamsburg",
              "type": "string",
              "description": "City"
            },
            "addressRegion": {
              "example": "VA",
              "type": "string",
              "description": "State"
            },
            "addressCountry": {
              "example": "US",
              "type": "string",
              "description": "Country"
            }
          }
        },
        "issuerDrawer": {
          "description": "The entity or person who issues and promises to pay the note (the maker).",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:waveridersupplies.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "Wave Rider Supplies, Inc",
              "type": "string",
              "description": "Trade party name."
            },
            "postalAddress": {
              "description": "The postal address of the party.",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "default": "Address",
                  "enum": [
                    "Address"
                  ]
                },
                "streetAddress": {
                  "example": "210 Ocean Road",
                  "type": "string",
                  "description": "The street component of the address."
                },
                "addressLocality": {
                  "example": "Williamsburg",
                  "type": "string",
                  "description": "The city component of the address."
                },
                "addressRegion": {
                  "example": "VA",
                  "type": "string",
                  "description": "The state component of the address."
                },
                "postalCode": {
                  "example": "23185",
                  "type": "string",
                  "description": "Postal code."
                },
                "addressCountry": {
                  "example": "US",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "drawee": {
          "description": "The entity or person who is obligated to pay (optional for promissory notes).",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:globaltradebank.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "Global Trade Finance Bank",
              "type": "string",
              "description": "Trade party name."
            },
            "postalAddress": {
              "description": "The postal address of the party.",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "default": "Address",
                  "enum": [
                    "Address"
                  ]
                },
                "streetAddress": {
                  "example": "1 Banking Plaza",
                  "type": "string",
                  "description": "The street component of the address."
                },
                "addressLocality": {
                  "example": "New York",
                  "type": "string",
                  "description": "The city component of the address."
                },
                "addressRegion": {
                  "example": "NY",
                  "type": "string",
                  "description": "The state component of the address."
                },
                "postalCode": {
                  "example": "10004",
                  "type": "string",
                  "description": "Postal code."
                },
                "addressCountry": {
                  "example": "US",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "payee": {
          "description": "Party to which payment is to be made.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:surfproexports.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "SurfPro Exports Pty Ltd",
              "type": "string",
              "description": "Trade party name."
            },
            "postalAddress": {
              "description": "The postal address of the party.",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "default": "Address",
                  "enum": [
                    "Address"
                  ]
                },
                "streetAddress": {
                  "example": "12 Harbour Drive",
                  "type": "string",
                  "description": "The street component of the address."
                },
                "addressLocality": {
                  "example": "Sydney",
                  "type": "string",
                  "description": "The city component of the address."
                },
                "addressRegion": {
                  "example": "NSW",
                  "type": "string",
                  "description": "The state component of the address."
                },
                "postalCode": {
                  "example": "2000",
                  "type": "string",
                  "description": "Postal code."
                },
                "addressCountry": {
                  "example": "AU",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "guarantor": {
          "description": "Financial institution guaranteeing payment of the note (optional aval).",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:globaltradebank.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "Global Trade Finance Bank",
              "type": "string",
              "description": "Trade party name."
            },
            "postalAddress": {
              "description": "The postal address of the party.",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "default": "Address",
                  "enum": [
                    "Address"
                  ]
                },
                "addressCountry": {
                  "example": "US",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "seller": {
          "description": "Party selling merchandise or services.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:surfproexports.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "SurfPro Exports Pty Ltd",
              "type": "string",
              "description": "Trade party name."
            },
            "postalAddress": {
              "description": "The postal address of the party.",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "default": "Address",
                  "enum": [
                    "Address"
                  ]
                },
                "addressCountry": {
                  "example": "AU",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "buyer": {
          "description": "Party to which merchandise or services are sold.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:waveridersupplies.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "Wave Rider Supplies, Inc",
              "type": "string",
              "description": "Trade party name."
            },
            "postalAddress": {
              "description": "The postal address of the party.",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "default": "Address",
                  "enum": [
                    "Address"
                  ]
                },
                "addressCountry": {
                  "example": "US",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "sellersBank": {
          "description": "Bank designated by the seller to receive payment.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:pacifictradebank.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "Pacific Trade Bank Ltd",
              "type": "string",
              "description": "Trade party name."
            },
            "postalAddress": {
              "description": "The postal address of the party.",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "default": "Address",
                  "enum": [
                    "Address"
                  ]
                },
                "addressCountry": {
                  "example": "AU",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "buyersBank": {
          "description": "Bank employed by the buyer to make a payment.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:globaltradebank.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "Global Trade Finance Bank",
              "type": "string",
              "description": "Trade party name."
            },
            "postalAddress": {
              "description": "The postal address of the party.",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "default": "Address",
                  "enum": [
                    "Address"
                  ]
                },
                "addressCountry": {
                  "example": "US",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "documentaryCreditBeneficiary": {
          "description": "Name and address of the beneficiary of a documentary credit.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:surfproexports.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "SurfPro Exports Pty Ltd",
              "type": "string",
              "description": "Trade party name."
            },
            "postalAddress": {
              "description": "The postal address of the party.",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "default": "Address",
                  "enum": [
                    "Address"
                  ]
                },
                "addressCountry": {
                  "example": "AU",
                  "type": "string",
                  "description": "Country."
                }
              }
            }
          }
        },
        "monetaryAmount": {
          "description": "The monetary amount promised in the note.",
          "type": "object",
          "properties": {
            "amount": {
              "example": 45000,
              "type": "number",
              "format": "float",
              "description": "The face value amount."
            },
            "currency": {
              "example": "USD",
              "type": "string",
              "minLength": 3,
              "maxLength": 3,
              "description": "ISO 4217 three-letter currency code."
            }
          }
        },
        "paymentTerms": {
          "example": "At 90 days from date of shipment",
          "type": "string",
          "description": "Identification of the terms of payment between the parties to a transaction."
        },
        "paymentMethod": {
          "example": "Bank transfer",
          "type": "string",
          "description": "Code specifying a method of payment."
        },
        "paymentLocation": {
          "example": "Sydney",
          "type": "string",
          "description": "Name of the place where the payment has to be made."
        },
        "authentication": {
          "example": "Signed and authenticated by Wave Rider Supplies, Inc, authorised signatory Jane Doe",
          "type": "string",
          "description": "Proof that a document has been authenticated."
        },
        "documentEndorsement": {
          "example": "Pay to the order of SurfPro Exports Pty Ltd",
          "type": "string",
          "description": "Proof that a document has been signed or endorsed."
        },
        "purchaseOrderNumber": {
          "example": "PO-WRS-2025-001",
          "type": "string",
          "description": "Identifier assigned by the buyer to an order."
        },
        "invoiceNumber": {
          "example": "INV-2025-031-001",
          "type": "string",
          "description": "Reference number to identify an invoice."
        },
        "contractNumber": {
          "example": "CTR-2025-001",
          "type": "string",
          "description": "Identifier of a contract concluded between parties."
        },
        "documentaryCreditIdentifier": {
          "example": "LC-2025-AU-456789",
          "type": "string",
          "description": "Reference number to identify a documentary credit (letter of credit)."
        },
        "documentaryCreditIssueDate": {
          "example": "2025-02-15T00:00:00Z",
          "type": "string",
          "format": "date-time",
          "description": "Issue date of a documentary credit."
        },
        "documentaryCreditEffectiveEndDate": {
          "example": "2025-07-31T00:00:00Z",
          "type": "string",
          "format": "date-time",
          "description": "Date on which the validity of a documentary credit expires."
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
