$schema: https://json-schema.org/draft/2020-12/schema
title: Quotation
description: A quotation is a commercial document issued by a seller to a (potential) buyer, offering products or services
  at stated prices and conditions, valid until a stated expiry date. It may answer a request for quote.
type: object
required:
  - '@context'
  - type
  - credentialSchema
  - validTo
  - issuer
  - credentialSubject
properties:
  '@context':
    type: string
    format: uri
    description: Linked Data context for semantic interoperability
    const: https://unvtd.unece.org/quotation-context.json
  type:
    type: array
    description: Document types
    items:
      type: string
      enum:
        - VerifiableCredential
        - Quotation
    minItems: 2
    maxItems: 2
    example:
      - VerifiableCredential
      - Quotation
  credentialSchema:
    type: object
    description: Reference to the credential schema for validation
    properties:
      id:
        type: string
        format: uri
        const: https://unvtd.unece.org/quotation-schema.yaml
        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 quotation credential
    example: urn:uuid:e9bf65a3-9ff3-4988-8c44-2535b949279f
  validFrom:
    example: 2025-03-06 10:00:00+00:00
    type: string
    format: date-time
    description: Date from which this credential is valid
  validTo:
    example: 2026-03-06 10:00:00+00:00
    type: string
    format: date-time
    description: Date until which this credential is valid
  issuer:
    name: Issuer
    description: Identifier of the party that issued this quotation credential (e.g., DID). Must match the seller.
    type: string
    format: uri
    example: did:web:surfpro.example.com
  credentialSubject:
    name: Quotation
    description: Quotation document details
    type: object
    required:
      - quotationNumber
      - issueDate
      - expiryDate
      - seller
      - buyer
      - quotedItems
    properties:
      quotationNumber:
        example: QUO-2025-SURF-0112
        type: string
        description: Identifier assigned by the seller to a quotation.
      requestForQuoteNumber:
        example: RFQ-2025-WRS-007
        type: string
        description: Identifier of the request for quote this quotation answers, if any.
      issueDate:
        example: '2025-01-28T00:00:00Z'
        type: string
        format: date-time
        description: Date of issue of the quotation.
      expiryDate:
        example: '2025-02-27T23:59:59Z'
        type: string
        format: date-time
        description: Date until which the quotation can be accepted. Distinct from the validTo of the credential itself.
      deliveryDate:
        example: '2025-03-14T00:00:00Z'
        type: string
        format: date-time
        description: Offered date of delivery of the goods.
      seller:
        description: Party offering the merchandise or services.
        type: object
        required:
          - type
          - id
          - name
        properties:
          type:
            type: string
            default: Party
            enum:
              - Party
          id:
            example: did:web:surfpro.example.com
            type: string
            format: uri
            description: A unique party identifier.
          name:
            example: SurfPro Manufacturing 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: 150 Industrial Drive
                type: string
                description: The street component of the address
              addressLocality:
                example: Gold Coast
                type: string
                description: The city component of the address
              addressRegion:
                example: QLD
                type: string
                description: The state component of the address
              postalCode:
                example: '4217'
                type: string
                description: Postal code.
              addressCountry:
                example: AU
                type: string
                description: Country code.
      buyer:
        description: Party to which the quotation is addressed.
        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, 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: NSW
                type: string
                description: The state component of the address
              postalCode:
                example: '75002'
                type: string
                description: Postal code.
              addressCountry:
                example: AU
                type: string
                description: Country code.
      deliveryLocation:
        type: object
        properties:
          type:
            type: string
            default: Location
            enum:
              - Location
          name:
            example: Wave Rider Supplies Warehouse
            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: 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: NSW
                type: string
                description: The state component of the address
              postalCode:
                example: '75002'
                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: FCA
        type: string
        description: The trade terms (Incoterms) code.
      tradeTermsConditionsDescription:
        example: FCA SurfPro Manufacturing Facility, Gold Coast QLD
        type: string
        description: Trade terms description, including the named place.
      paymentTerms:
        example: Net 30 days
        type: string
        description: Identification of the terms of payment between the parties to a transaction.
      paymentMethod:
        example: Wire Transfer
        type: string
        description: Code specifying a method of payment.
      allowanceCharge:
        description: Code specifying a type of an adjustment to a monetary amount such as an allowance or charge.
        type: object
        properties:
          type:
            type: string
            enum:
              - allowance
              - charge
            description: Whether this is an allowance or charge
          description:
            type: string
            description: Description of the allowance or charge
          amount:
            type: object
            properties:
              amount:
                type: number
                format: float
                description: The monetary amount
              currency:
                type: string
                description: Currency code
      totalQuotedAmount:
        description: Total amount of the quotation.
        type: object
        properties:
          amount:
            example: 73250
            type: number
            format: float
            description: Total quoted amount
          currency:
            example: USD
            type: string
            description: Currency code
      quotedItems:
        name: Quoted Items
        description: Items being quoted
        type: array
        minItems: 1
        items:
          type: object
          required:
            - productIdentifier
            - quantityQuoted
            - unitPrice
          properties:
            productIdentifier:
              example: SURF-LB-001
              type: string
              description: Reference number identifying a product.
            product:
              type: object
              properties:
                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: AU
              type: string
              description: Country of origin of the product.
            quantityQuoted:
              example: 40
              type: number
              description: The quantity for which the price is quoted.
            unitPrice:
              description: Price per unit of quantity on which an article item amount is calculated.
              type: object
              properties:
                amount:
                  example: 750
                  type: number
                  format: float
                  description: Unit price amount
                currency:
                  example: USD
                  type: string
                  description: Currency code
            lineTotal:
              description: Total amount for this line item.
              type: object
              properties:
                amount:
                  example: 18750
                  type: number
                  format: float
                  description: Line total amount
                currency:
                  example: USD
                  type: string
                  description: Currency code
          description: A line item in the quotation specifying products or services offered.
