{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://unvtd.unece.org/request-for-quote-schema.json",
  "title": "Request for Quote",
  "description": "A request for quote is a commercial document issued by a (potential) buyer to one or more (potential) sellers, requesting a price quotation for specified products or services.",
  "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/request-for-quote-context.jsonld"
      ]
    },
    "type": {
      "type": "array",
      "description": "Credential types.",
      "const": [
        "VerifiableCredential",
        "RequestForQuoteCredential"
      ]
    },
    "name": {
      "type": "string",
      "description": "Human-readable name of the credential, for display.",
      "example": "Request for Quote"
    },
    "credentialSchema": {
      "type": "object",
      "description": "Reference to the credential schema for validation",
      "properties": {
        "id": {
          "type": "string",
          "format": "uri",
          "const": "https://unvtd.unece.org/request-for-quote-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 this request for quote credential",
      "example": "urn:uuid:rfq-2025-wrs-007"
    },
    "validFrom": {
      "example": "2025-01-20T09:00:00Z",
      "type": "string",
      "format": "date-time",
      "description": "Date from which this credential is valid"
    },
    "validUntil": {
      "example": "2026-01-20T09:00:00Z",
      "type": "string",
      "format": "date-time",
      "description": "Date until which this credential is valid."
    },
    "issuer": {
      "name": "Issuer",
      "description": "Identifier of the party that issued this request for quote credential (e.g., DID). Must match the buyer.",
      "type": "string",
      "format": "uri",
      "example": "did:web:waveridersupplies.example.com"
    },
    "credentialSubject": {
      "name": "Request for Quote",
      "description": "Request for quote document details",
      "type": "object",
      "required": [
        "type",
        "requestForQuoteNumber",
        "issueDate",
        "buyer",
        "requestedItems"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of the business document.",
          "const": "RequestForQuote"
        },
        "requestForQuoteNumber": {
          "example": "RFQ-2025-WRS-007",
          "type": "string",
          "description": "Identifier assigned by the buyer to a request for quote."
        },
        "issueDate": {
          "example": "2025-01-20T00:00:00Z",
          "type": "string",
          "format": "date-time",
          "description": "Date of issue of the request for quote."
        },
        "replyByDate": {
          "example": "2025-02-03T17:00:00Z",
          "type": "string",
          "format": "date-time",
          "description": "Latest date by which quotations are to be received."
        },
        "requestedDeliveryDate": {
          "example": "2025-03-31T00:00:00Z",
          "type": "string",
          "format": "date-time",
          "description": "Requested date of delivery of the goods."
        },
        "buyer": {
          "description": "Party requesting the quotation, to which merchandise or services would be sold.",
          "type": "object",
          "required": [
            "type",
            "id",
            "name"
          ],
          "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 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": "18 Harbord Road",
                  "type": "string",
                  "description": "The street component of the address"
                },
                "addressLocality": {
                  "example": "Brookvale",
                  "type": "string",
                  "description": "The city component of the address"
                },
                "addressRegion": {
                  "example": "NSW",
                  "type": "string",
                  "description": "The state component of the address"
                },
                "postalCode": {
                  "example": "2100",
                  "type": "string",
                  "description": "Postal code."
                },
                "addressCountry": {
                  "example": "AU",
                  "type": "string",
                  "description": "Country code."
                }
              }
            }
          }
        },
        "seller": {
          "description": "Party to which the request is addressed. Omitted for an open request.",
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Party",
              "enum": [
                "Party"
              ]
            },
            "id": {
              "example": "did:web:nordicswell.example.com",
              "type": "string",
              "format": "uri",
              "description": "A unique party identifier."
            },
            "name": {
              "example": "Nordic Swell ApS",
              "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": "Ørhagevej 12",
                  "type": "string",
                  "description": "The street component of the address"
                },
                "addressLocality": {
                  "example": "Klitmøller",
                  "type": "string",
                  "description": "The city component of the address"
                },
                "addressRegion": {
                  "example": "Nordjylland",
                  "type": "string",
                  "description": "The state component of the address"
                },
                "postalCode": {
                  "example": "7700",
                  "type": "string",
                  "description": "Postal code."
                },
                "addressCountry": {
                  "example": "DK",
                  "type": "string",
                  "description": "Country code."
                }
              }
            }
          }
        },
        "deliveryLocation": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "default": "Location",
              "enum": [
                "Location"
              ]
            },
            "name": {
              "example": "Sydney Secure Warehousing - Facility A",
              "type": "string",
              "description": "Location name."
            },
            "unLocode": {
              "type": "string",
              "description": "UN/LOCODE location identifier (5 characters)."
            },
            "postalAddress": {
              "description": "The postal address of the location.",
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "default": "Address",
                  "enum": [
                    "Address"
                  ]
                },
                "streetAddress": {
                  "example": "45 Logistics Way",
                  "type": "string",
                  "description": "The street component of the address"
                },
                "addressLocality": {
                  "example": "Banksmeadow",
                  "type": "string",
                  "description": "The city component of the address"
                },
                "addressRegion": {
                  "example": "NSW",
                  "type": "string",
                  "description": "The state component of the address"
                },
                "postalCode": {
                  "example": "2019",
                  "type": "string",
                  "description": "Postal code."
                },
                "addressCountry": {
                  "example": "AU",
                  "type": "string",
                  "description": "Country code."
                }
              }
            }
          },
          "description": "Location to which the goods are to be delivered."
        },
        "tradeTermsConditionsCode": {
          "example": "CIF",
          "type": "string",
          "description": "The trade terms (Incoterms) code."
        },
        "tradeTermsConditionsDescription": {
          "example": "CIF Port Botany, Sydney (Incoterms® 2020)",
          "type": "string",
          "description": "Trade terms description, including the named place."
        },
        "paymentTerms": {
          "example": "Documentary credit, payable 30 days after bill of lading date",
          "type": "string",
          "description": "Identification of the terms of payment between the parties to a transaction."
        },
        "paymentMethod": {
          "example": "Documentary credit",
          "type": "string",
          "description": "Code specifying a method of payment."
        },
        "requestedItems": {
          "name": "Requested Items",
          "description": "Items for which a quotation is requested",
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": [
              "productIdentifier",
              "quantityRequested"
            ],
            "properties": {
              "type": {
                "type": "string",
                "default": "TradeLineItem",
                "enum": [
                  "TradeLineItem"
                ]
              },
              "productIdentifier": {
                "example": "SURF-LB-001",
                "type": "string",
                "description": "Reference number identifying a product."
              },
              "product": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "default": "Product",
                    "enum": [
                      "Product"
                    ]
                  },
                  "id": {
                    "example": "urn:uuid:surf-001-longboard",
                    "type": "string",
                    "format": "uri",
                    "description": "A unique identifier for the product."
                  },
                  "name": {
                    "example": "Professional Longboard - Ocean Series",
                    "type": "string",
                    "description": "Product name"
                  },
                  "description": {
                    "example": "High-performance longboard with premium bamboo core and fiberglass construction, 9'6\" length",
                    "type": "string",
                    "description": "Product description"
                  }
                },
                "description": "Product details"
              },
              "hsCode": {
                "example": "950629",
                "type": "string",
                "description": "Harmonized System (HS) commodity code of the product."
              },
              "originCountry": {
                "example": "VN",
                "type": "string",
                "description": "Country of origin of the product."
              },
              "quantityRequested": {
                "example": 25,
                "type": "number",
                "description": "The quantity for which a quotation is requested."
              },
              "targetUnitPrice": {
                "description": "Target price per unit, if the buyer states one.",
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "default": "MonetaryAmount",
                    "enum": [
                      "MonetaryAmount"
                    ]
                  },
                  "amount": {
                    "example": 700,
                    "type": "number",
                    "format": "float",
                    "description": "Unit price amount"
                  },
                  "currency": {
                    "example": "USD",
                    "type": "string",
                    "description": "Currency code"
                  }
                }
              }
            },
            "description": "A line item in the request for quote."
          }
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
