Skip to content

FulfillmentOrderEvent

FulfillmentOrderEvent schema

Properties

  • AggregateId (string, format: {FulfillmentSystemId}-{FulfillmentSystemCustomerId}-{ShippingOrderId})Unique ID for shipping order within Integration Broker.
  • CorrelationId (string)Unique ID for SOB-external event trigger.
  • AggregateType (string)Type of event schema.
  • EventActionUser (['string', 'null'])Username of user who triggered event.
  • EventDateTimeUtc (string)UTC based datetime of when event was triggered.
  • EventName (string)Name of triggered event.
  • EventNameValuePairs (['array', 'null'])

    • Items (object)
  • EventPublisherApp (string)Name of source application that published event.

  • EventSchemaVersion (string)Version of event schema being used.
  • EventSource (string)Name of system where event was triggered.
  • EventSchemaVersion (string)Version of event schema being used. Must be one of: ["0.1"].
  • FulfillmentOrder (object)Details for Fulfillment Order JSON schema.

    • CustomerId (['string', 'null'])Customer ID tied to the fulfillment order.
    • FulfillmentOrderId (['string', 'null'], required)Unique ID for fulfillment order.
    • FulfillmentSystemCustomerId (['string', 'null'])ID of customer within the fulfillment system.
    • FulfillmentSystemId (['string', 'null'])System used to fulfill the order.
    • FulfillmentSystemLocationId (['string', 'null'])ID of location within the fulfillment system.
    • FulfillmentSystemOrderId (['string', 'null'])Fulfillment order ID within the fulfillment system.
    • ReferenceId (['string', 'null'])Reference ID for the fulfillment order.
    • BillTo (['object', 'null'])Fulfillment order level bill to contact and address details.

      • Address1 (['string', 'null'])Address line 1 for address.
      • Address2 (['string', 'null'])Address line 2 for address.
      • Address3 (['string', 'null'])Address line 3 for address.
      • AddressCode (['string', 'null'])Address code for address.
      • City (['string', 'null'])City name for address.
      • Company (['string', 'null'])Company name for address.
      • Country (['string', 'null'])Country name for address.
      • EmailAddress (['string', 'null'])Contact email address for address.
      • FaxNumber (['string', 'null'])Fax number for address.
      • Name (['string', 'null'])Contact name for this address.
      • PhoneNumber (['string', 'null'])Phone number for address.
      • PostalCode (['string', 'null'])Postal code for address.
      • StateProvince (['string', 'null'])State or province name for address.
    • CreateDateTime (['string', 'null'])Created date time of the fulfillment order.

    • DefaultShipToKey (['string', 'null'])Default key for ShipTo.
    • DueDate (['string', 'null'])Due date of the fulfillment order.
    • OrderIds (['array', 'null'])Order IDs tied to the fulfillment order.

      • Items (string)
    • OrderVariables (['string', 'null'])Order variables tied to the fulfillment order in JSON format.

    • PONumber (['string', 'null'])PO number tied to the fulfillment order.
    • PaymentMethods (['array', 'null'])PaymentMethod details.

      • Items (object)

        • Amount (['number', 'null'])Amount for the payment method.
        • MethodName (['string', 'null'])Name of the payment method.
    • Products (['array', 'null'])Fulfillment order level product details.

      • Items (object)

        • FulfillmentSystemId (['string', 'null'])Fulfillment system ID.
        • FulfillmentSystemProductId (['string', 'null'])Fulfillment system product ID.
        • ProductId (['string', 'null'])Product ID.
        • ProductLineId (['string', 'null'])Product line ID.
        • AssociatedFileName (['string', 'null'])Associated file name.
        • Comment (['string', 'null'])Comment for the product.
        • IsDeleted (['boolean', 'null'])Whether the product is deleted.
        • PageCount (['integer', 'null'])Page count for the product.
        • Price (['number', 'null'])Price of the product.
        • QuantityOrdered (['integer', 'null'])Quantity ordered.
        • ShipToKey (['string', 'null'])Ship to key for the product.
        • Status (['string', 'null'])Status of the product.
    • RushOrder (['boolean', 'null'])Indicator if the order is a rush order.

    • ShipTos (['array', 'null'])Fulfillment order level ship to details.

      • Items (object)

        • FulfillmentSystemShippingMethodId (['string', 'null'])Fulfillment system shipping method ID.
        • ReferenceId (['string', 'null'])Reference ID.
        • Comment (['string', 'null'])Comment.
        • DueDate (['string', 'null'])Due date.
        • IsDeleted (['boolean', 'null'])Whether the ship to is deleted.
        • Key (string, required)Key for the ship to.
        • PONumber (['string', 'null'])PO number.
        • PaymentMethods (['array', 'null'])Payment methods for this ship to.

          • Items (object)

            • Amount (['number', 'null'])Amount for the payment method.
            • MethodName (['string', 'null'])Name of the payment method.
        • RushFee (['number', 'null'])Rush fee.

        • RushOrder (['boolean', 'null'])Whether this is a rush order.
        • ShipToAddress (['object', 'null'])Ship to address.

          • Address1 (['string', 'null'])Address line 1 for address.
          • Address2 (['string', 'null'])Address line 2 for address.
          • Address3 (['string', 'null'])Address line 3 for address.
          • AddressCode (['string', 'null'])Address code for address.
          • City (['string', 'null'])City name for address.
          • Company (['string', 'null'])Company name for address.
          • Country (['string', 'null'])Country name for address.
          • EmailAddress (['string', 'null'])Contact email address for address.
          • FaxNumber (['string', 'null'])Fax number for address.
          • Name (['string', 'null'])Contact name for this address.
          • PhoneNumber (['string', 'null'])Phone number for address.
          • PostalCode (['string', 'null'])Postal code for address.
          • StateProvince (['string', 'null'])State or province name for address.
        • ShippingCarrier (['string', 'null'])Shipping carrier.

        • ShippingCost (['number', 'null'])Shipping cost.
        • ShippingService (['string', 'null'])Shipping service.
        • Status (['string', 'null'])Status.
    • Shipments (['array', 'null'])Shipments tied to the fulfillment order.

      • Items (object)

        • FulfillmentSystemId (['string', 'null'])Fulfillment system ID.
        • FulfillmentSystemLocationId (['string', 'null'])Fulfillment system location ID.
        • ShipmentId (['string', 'null'])Shipment ID.
        • Carrier (['string', 'null'])Carrier.
        • Freight (['number', 'null'])Freight cost.
        • IsDeleted (['boolean', 'null'])Whether the shipment is deleted.
        • MasterTrackingNumber (['string', 'null'])Master tracking number.
        • Packages (['array', 'null'])Packages in the shipment.

          • Items (object)

            • IsDeleted (['boolean', 'null'])Whether the package is deleted.
            • PackageNumber (['string', 'null'])Package number.
            • Products (['array', 'null'])Products in the package.

              • Items (object)

                • ProductLineId (['string', 'null'])Product line ID.
                • ShipQuantity (['number', 'null'])Ship quantity.
            • TrackingNumber (['string', 'null'])Tracking number.

        • PackingSlipNumber (['string', 'null'])Packing slip number.

        • Service (['string', 'null'])Service.
        • ShipDateUtc (['string', 'null'])Ship date in UTC.
        • ShipToAddress (['object', 'null'])Ship to address.

          • Address1 (['string', 'null'])Address line 1 for address.
          • Address2 (['string', 'null'])Address line 2 for address.
          • Address3 (['string', 'null'])Address line 3 for address.
          • AddressCode (['string', 'null'])Address code for address.
          • City (['string', 'null'])City name for address.
          • Company (['string', 'null'])Company name for address.
          • Country (['string', 'null'])Country name for address.
          • EmailAddress (['string', 'null'])Contact email address for address.
          • FaxNumber (['string', 'null'])Fax number for address.
          • Name (['string', 'null'])Contact name for this address.
          • PhoneNumber (['string', 'null'])Phone number for address.
          • PostalCode (['string', 'null'])Postal code for address.
          • StateProvince (['string', 'null'])State or province name for address.
    • Statuses (['array', 'null'])Statuses tied to the fulfillment order.

      • Items (string)
  • EventName (string)Name of triggered event. Must be one of: ["Fulfillment Order Created", "Fulfillment Order Submitted to Fulfillment System", "Fulfillment Order Submission Failed", "Fulfillment Order Updated", "Fulfillment Order Update Validation Failed"].

Quicktype Command

quicktype \
    --framework SystemTextJson  \
    --lang cs  \
    --number-type double  \
    --src-lang schema  \
    --no-check-required  \
    --density dense  \
    --features complete  \
    --namespace OtpSchema.Event.FulfillmentOrder.FulfillmentOrderEvent  \
    --src .working/build/internal/json-schema-for-cs/FulfillmentOrderEvent.json -o .working/build/internal/csharp/OtpSchema/Event/FulfillmentOrder/FulfillmentOrderEvent.cs
FulfillmentOrderEvent
// <auto-generated />
//
// To parse this JSON data, add NuGet 'System.Text.Json' then do:
//
//    using OtpSchema.Event.FulfillmentOrder.FulfillmentOrderEvent;
//
//    var fulfillmentOrderEvent = FulfillmentOrderEvent.FromJson(jsonString);
#nullable enable
#pragma warning disable CS8618
#pragma warning disable CS8601
#pragma warning disable CS8603

namespace OtpSchema.Event.FulfillmentOrder.FulfillmentOrderEvent
{
    using System;
    using System.Collections.Generic;

    using System.Text.Json;
    using System.Text.Json.Serialization;
    using System.Globalization;
    using J = System.Text.Json.Serialization.JsonPropertyNameAttribute;
    using N = System.Text.Json.Serialization.JsonIgnoreCondition;

    /// <summary>FulfillmentOrderEvent schema; ; Details for Shipping Order JSON schema</summary>
    public partial class FulfillmentOrderEvent
    {
        [J("AggregateId")]         public string AggregateId { get; set; }                               // Unique ID for shipping order within Integration Broker
        [J("AggregateType")]       public string AggregateType { get; set; }                             // Type of event schema
        [J("CorrelationId")]       public string CorrelationId { get; set; }                             // Unique ID for SOB-external event trigger
        [J("EventActionUser")]     public string EventActionUser { get; set; }                           // Username of user who triggered event
        [J("EventDateTimeUtc")]    public string EventDateTimeUtc { get; set; }                          // UTC based datetime of when event was triggered
        [J("EventName")]           public EventNameEnum EventName { get; set; }                          // Name of triggered event
        [J("EventNameValuePairs")] public Dictionary<string, object>[] EventNameValuePairs { get; set; }
        [J("EventPublisherApp")]   public string EventPublisherApp { get; set; }                         // Name of source application that published event
        [J("EventSchemaVersion")]  public EventSchemaVersionEnum EventSchemaVersion { get; set; }        // Version of event schema being used
        [J("EventSource")]         public string EventSource { get; set; }                               // Name of system where event was triggered
        [J("FulfillmentOrder")]    public FulfillmentOrder FulfillmentOrder { get; set; }                // Details for Fulfillment Order JSON schema
    }

    /// <summary>Details for Fulfillment Order JSON schema</summary>
    public partial class FulfillmentOrder
    {
        [J("BillTo")]                      public BillTo BillTo { get; set; }                                  // Fulfillment order level bill to contact and address details
        [J("CreateDateTime")]              public string CreateDateTime { get; set; }                          // Created date time of the fulfillment order
        [J("CustomerId")]                  public string CustomerId { get; set; }                              // Customer ID tied to the fulfillment order
        [J("DefaultShipToKey")]            public string DefaultShipToKey { get; set; }                        // Default key for ShipTo
        [J("DueDate")]                     public string DueDate { get; set; }                                 // Due date of the fulfillment order
        [J("FulfillmentOrderId")]          public string FulfillmentOrderId { get; set; }                      // Unique ID for fulfillment order
        [J("FulfillmentSystemCustomerId")] public string FulfillmentSystemCustomerId { get; set; }             // ID of customer within the fulfillment system
        [J("FulfillmentSystemId")]         public string FulfillmentSystemId { get; set; }                     // System used to fulfill the order
        [J("FulfillmentSystemLocationId")] public string FulfillmentSystemLocationId { get; set; }             // ID of location within the fulfillment system
        [J("FulfillmentSystemOrderId")]    public string FulfillmentSystemOrderId { get; set; }                // Fulfillment order ID within the fulfillment system
        [J("OrderIds")]                    public string[] OrderIds { get; set; }                              // Order IDs tied to the fulfillment order
        [J("OrderVariables")]              public string OrderVariables { get; set; }                          // Order variables tied to the fulfillment order in JSON format
        [J("PaymentMethods")]              public FulfillmentOrderPaymentMethod[] PaymentMethods { get; set; } // PaymentMethod details
        [J("PONumber")]                    public string PoNumber { get; set; }                                // PO number tied to the fulfillment order
        [J("Products")]                    public FulfillmentOrderProduct[] Products { get; set; }             // Fulfillment order level product details
        [J("ReferenceId")]                 public string ReferenceId { get; set; }                             // Reference ID for the fulfillment order
        [J("RushOrder")]                   public bool? RushOrder { get; set; }                                // Indicator if the order is a rush order
        [J("Shipments")]                   public Shipment[] Shipments { get; set; }                           // Shipments tied to the fulfillment order
        [J("ShipTos")]                     public ShipTo[] ShipTos { get; set; }                               // Fulfillment order level ship to details
        [J("Statuses")]                    public string[] Statuses { get; set; }                              // Statuses tied to the fulfillment order
    }

    public partial class BillTo
    {
        [J("Address1")]      public string Address1 { get; set; }      // Address line 1 for address
        [J("Address2")]      public string Address2 { get; set; }      // Address line 2 for address
        [J("Address3")]      public string Address3 { get; set; }      // Address line 3 for address
        [J("AddressCode")]   public string AddressCode { get; set; }   // Address code for address
        [J("City")]          public string City { get; set; }          // City name for address
        [J("Company")]       public string Company { get; set; }       // Company name for address
        [J("Country")]       public string Country { get; set; }       // Country name for address
        [J("EmailAddress")]  public string EmailAddress { get; set; }  // Contact email address for address
        [J("FaxNumber")]     public string FaxNumber { get; set; }     // Fax number for address
        [J("Name")]          public string Name { get; set; }          // Contact name for this address
        [J("PhoneNumber")]   public string PhoneNumber { get; set; }   // Phone number for address
        [J("PostalCode")]    public string PostalCode { get; set; }    // Postal code for address
        [J("StateProvince")] public string StateProvince { get; set; } // State or province name for address
    }

    public partial class FulfillmentOrderPaymentMethod
    {
        [J("Amount")]     public double? Amount { get; set; }    // Amount for the payment method
        [J("MethodName")] public string MethodName { get; set; } // Name of the payment method
    }

    public partial class FulfillmentOrderProduct
    {
        [J("AssociatedFileName")]         public string AssociatedFileName { get; set; }         // Associated file name
        [J("Comment")]                    public string Comment { get; set; }                    // Comment for the product
        [J("FulfillmentSystemId")]        public string FulfillmentSystemId { get; set; }        // Fulfillment system ID
        [J("FulfillmentSystemProductId")] public string FulfillmentSystemProductId { get; set; } // Fulfillment system product ID
        [J("IsDeleted")]                  public bool? IsDeleted { get; set; }                   // Whether the product is deleted
        [J("PageCount")]                  public long? PageCount { get; set; }                   // Page count for the product
        [J("Price")]                      public double? Price { get; set; }                     // Price of the product
        [J("ProductId")]                  public string ProductId { get; set; }                  // Product ID
        [J("ProductLineId")]              public string ProductLineId { get; set; }              // Product line ID
        [J("QuantityOrdered")]            public long? QuantityOrdered { get; set; }             // Quantity ordered
        [J("ShipToKey")]                  public string ShipToKey { get; set; }                  // Ship to key for the product
        [J("Status")]                     public string Status { get; set; }                     // Status of the product
    }

    public partial class ShipTo
    {
        [J("Comment")]                           public string Comment { get; set; }                           // Comment
        [J("DueDate")]                           public string DueDate { get; set; }                           // Due date
        [J("FulfillmentSystemShippingMethodId")] public string FulfillmentSystemShippingMethodId { get; set; } // Fulfillment system shipping method ID
        [J("IsDeleted")]                         public bool? IsDeleted { get; set; }                          // Whether the ship to is deleted
        [J("Key")]                               public string Key { get; set; }                               // Key for the ship to
        [J("PaymentMethods")]                    public ShipToPaymentMethod[] PaymentMethods { get; set; }     // Payment methods for this ship to
        [J("PONumber")]                          public string PoNumber { get; set; }                          // PO number
        [J("ReferenceId")]                       public string ReferenceId { get; set; }                       // Reference ID
        [J("RushFee")]                           public double? RushFee { get; set; }                          // Rush fee
        [J("RushOrder")]                         public bool? RushOrder { get; set; }                          // Whether this is a rush order
        [J("ShippingCarrier")]                   public string ShippingCarrier { get; set; }                   // Shipping carrier
        [J("ShippingCost")]                      public double? ShippingCost { get; set; }                     // Shipping cost
        [J("ShippingService")]                   public string ShippingService { get; set; }                   // Shipping service
        [J("ShipToAddress")]                     public ShipToShipToAddress ShipToAddress { get; set; }        // Ship to address
        [J("Status")]                            public string Status { get; set; }                            // Status
    }

    public partial class ShipToPaymentMethod
    {
        [J("Amount")]     public double? Amount { get; set; }    // Amount for the payment method
        [J("MethodName")] public string MethodName { get; set; } // Name of the payment method
    }

    public partial class ShipToShipToAddress
    {
        [J("Address1")]      public string Address1 { get; set; }      // Address line 1 for address
        [J("Address2")]      public string Address2 { get; set; }      // Address line 2 for address
        [J("Address3")]      public string Address3 { get; set; }      // Address line 3 for address
        [J("AddressCode")]   public string AddressCode { get; set; }   // Address code for address
        [J("City")]          public string City { get; set; }          // City name for address
        [J("Company")]       public string Company { get; set; }       // Company name for address
        [J("Country")]       public string Country { get; set; }       // Country name for address
        [J("EmailAddress")]  public string EmailAddress { get; set; }  // Contact email address for address
        [J("FaxNumber")]     public string FaxNumber { get; set; }     // Fax number for address
        [J("Name")]          public string Name { get; set; }          // Contact name for this address
        [J("PhoneNumber")]   public string PhoneNumber { get; set; }   // Phone number for address
        [J("PostalCode")]    public string PostalCode { get; set; }    // Postal code for address
        [J("StateProvince")] public string StateProvince { get; set; } // State or province name for address
    }

    public partial class Shipment
    {
        [J("Carrier")]                     public string Carrier { get; set; }                      // Carrier
        [J("Freight")]                     public double? Freight { get; set; }                     // Freight cost
        [J("FulfillmentSystemId")]         public string FulfillmentSystemId { get; set; }          // Fulfillment system ID
        [J("FulfillmentSystemLocationId")] public string FulfillmentSystemLocationId { get; set; }  // Fulfillment system location ID
        [J("IsDeleted")]                   public bool? IsDeleted { get; set; }                     // Whether the shipment is deleted
        [J("MasterTrackingNumber")]        public string MasterTrackingNumber { get; set; }         // Master tracking number
        [J("Packages")]                    public Package[] Packages { get; set; }                  // Packages in the shipment
        [J("PackingSlipNumber")]           public string PackingSlipNumber { get; set; }            // Packing slip number
        [J("Service")]                     public string Service { get; set; }                      // Service
        [J("ShipDateUtc")]                 public string ShipDateUtc { get; set; }                  // Ship date in UTC
        [J("ShipmentId")]                  public string ShipmentId { get; set; }                   // Shipment ID
        [J("ShipToAddress")]               public ShipmentShipToAddress ShipToAddress { get; set; } // Ship to address
    }

    public partial class Package
    {
        [J("IsDeleted")]      public bool? IsDeleted { get; set; }           // Whether the package is deleted
        [J("PackageNumber")]  public string PackageNumber { get; set; }      // Package number
        [J("Products")]       public PackageProduct[] Products { get; set; } // Products in the package
        [J("TrackingNumber")] public string TrackingNumber { get; set; }     // Tracking number
    }

    public partial class PackageProduct
    {
        [J("ProductLineId")] public string ProductLineId { get; set; } // Product line ID
        [J("ShipQuantity")]  public double? ShipQuantity { get; set; } // Ship quantity
    }

    public partial class ShipmentShipToAddress
    {
        [J("Address1")]      public string Address1 { get; set; }      // Address line 1 for address
        [J("Address2")]      public string Address2 { get; set; }      // Address line 2 for address
        [J("Address3")]      public string Address3 { get; set; }      // Address line 3 for address
        [J("AddressCode")]   public string AddressCode { get; set; }   // Address code for address
        [J("City")]          public string City { get; set; }          // City name for address
        [J("Company")]       public string Company { get; set; }       // Company name for address
        [J("Country")]       public string Country { get; set; }       // Country name for address
        [J("EmailAddress")]  public string EmailAddress { get; set; }  // Contact email address for address
        [J("FaxNumber")]     public string FaxNumber { get; set; }     // Fax number for address
        [J("Name")]          public string Name { get; set; }          // Contact name for this address
        [J("PhoneNumber")]   public string PhoneNumber { get; set; }   // Phone number for address
        [J("PostalCode")]    public string PostalCode { get; set; }    // Postal code for address
        [J("StateProvince")] public string StateProvince { get; set; } // State or province name for address
    }

    /// <summary>Name of triggered event</summary>
    public enum EventNameEnum { FulfillmentOrderCreated, FulfillmentOrderSubmissionFailed, FulfillmentOrderSubmittedToFulfillmentSystem, FulfillmentOrderUpdateValidationFailed, FulfillmentOrderUpdated };

    /// <summary>Version of event schema being used</summary>
    public enum EventSchemaVersionEnum { The01 };

    public partial class FulfillmentOrderEvent
    {
        public static FulfillmentOrderEvent FromJson(string json) => JsonSerializer.Deserialize<FulfillmentOrderEvent>(json, OtpSchema.Event.FulfillmentOrder.FulfillmentOrderEvent.Converter.Settings);
    }

    public static class Serialize
    {
        public static string ToJson(this FulfillmentOrderEvent self) => JsonSerializer.Serialize(self, OtpSchema.Event.FulfillmentOrder.FulfillmentOrderEvent.Converter.Settings);
    }

    internal static class Converter
    {
        public static readonly JsonSerializerOptions Settings = new(JsonSerializerDefaults.General)
        {
            Converters =
            {
                EventNameEnumConverter.Singleton,
                EventSchemaVersionEnumConverter.Singleton,
                new DateOnlyConverter(),
                new TimeOnlyConverter(),
                IsoDateTimeOffsetConverter.Singleton
            },
        };
    }

    internal class EventNameEnumConverter : JsonConverter<EventNameEnum>
    {
        public override bool CanConvert(Type t) => t == typeof(EventNameEnum);

        public override EventNameEnum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
        {
            var value = reader.GetString();
            switch (value)
            {
                case "Fulfillment Order Created":
                    return EventNameEnum.FulfillmentOrderCreated;
                case "Fulfillment Order Submission Failed":
                    return EventNameEnum.FulfillmentOrderSubmissionFailed;
                case "Fulfillment Order Submitted to Fulfillment System":
                    return EventNameEnum.FulfillmentOrderSubmittedToFulfillmentSystem;
                case "Fulfillment Order Update Validation Failed":
                    return EventNameEnum.FulfillmentOrderUpdateValidationFailed;
                case "Fulfillment Order Updated":
                    return EventNameEnum.FulfillmentOrderUpdated;
            }
            throw new Exception("Cannot unmarshal type EventNameEnum");
        }

        public override void Write(Utf8JsonWriter writer, EventNameEnum value, JsonSerializerOptions options)
        {
            switch (value)
            {
                case EventNameEnum.FulfillmentOrderCreated:
                    JsonSerializer.Serialize(writer, "Fulfillment Order Created", options);
                    return;
                case EventNameEnum.FulfillmentOrderSubmissionFailed:
                    JsonSerializer.Serialize(writer, "Fulfillment Order Submission Failed", options);
                    return;
                case EventNameEnum.FulfillmentOrderSubmittedToFulfillmentSystem:
                    JsonSerializer.Serialize(writer, "Fulfillment Order Submitted to Fulfillment System", options);
                    return;
                case EventNameEnum.FulfillmentOrderUpdateValidationFailed:
                    JsonSerializer.Serialize(writer, "Fulfillment Order Update Validation Failed", options);
                    return;
                case EventNameEnum.FulfillmentOrderUpdated:
                    JsonSerializer.Serialize(writer, "Fulfillment Order Updated", options);
                    return;
            }
            throw new Exception("Cannot marshal type EventNameEnum");
        }

        public static readonly EventNameEnumConverter Singleton = new EventNameEnumConverter();
    }

    internal class EventSchemaVersionEnumConverter : JsonConverter<EventSchemaVersionEnum>
    {
        public override bool CanConvert(Type t) => t == typeof(EventSchemaVersionEnum);

        public override EventSchemaVersionEnum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
        {
            var value = reader.GetString();
            if (value == "0.1")
            {
                return EventSchemaVersionEnum.The01;
            }
            throw new Exception("Cannot unmarshal type EventSchemaVersionEnum");
        }

        public override void Write(Utf8JsonWriter writer, EventSchemaVersionEnum value, JsonSerializerOptions options)
        {
            if (value == EventSchemaVersionEnum.The01)
            {
                JsonSerializer.Serialize(writer, "0.1", options);
                return;
            }
            throw new Exception("Cannot marshal type EventSchemaVersionEnum");
        }

        public static readonly EventSchemaVersionEnumConverter Singleton = new EventSchemaVersionEnumConverter();
    }

    public class DateOnlyConverter : JsonConverter<DateOnly>
    {
        private readonly string serializationFormat;
        public DateOnlyConverter() : this(null) { }

        public DateOnlyConverter(string? serializationFormat)
        {
                this.serializationFormat = serializationFormat ?? "yyyy-MM-dd";
        }

        public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
        {
                var value = reader.GetString();
                return DateOnly.Parse(value!);
        }

        public override void Write(Utf8JsonWriter writer, DateOnly value, JsonSerializerOptions options)
                => writer.WriteStringValue(value.ToString(serializationFormat));
    }

    public class TimeOnlyConverter : JsonConverter<TimeOnly>
    {
        private readonly string serializationFormat;

        public TimeOnlyConverter() : this(null) { }

        public TimeOnlyConverter(string? serializationFormat)
        {
                this.serializationFormat = serializationFormat ?? "HH:mm:ss.fff";
        }

        public override TimeOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
        {
                var value = reader.GetString();
                return TimeOnly.Parse(value!);
        }

        public override void Write(Utf8JsonWriter writer, TimeOnly value, JsonSerializerOptions options)
                => writer.WriteStringValue(value.ToString(serializationFormat));
    }

    internal class IsoDateTimeOffsetConverter : JsonConverter<DateTimeOffset>
    {
        public override bool CanConvert(Type t) => t == typeof(DateTimeOffset);

        private const string DefaultDateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK";

        private DateTimeStyles _dateTimeStyles = DateTimeStyles.RoundtripKind;
        private string? _dateTimeFormat;
        private CultureInfo? _culture;

        public DateTimeStyles DateTimeStyles
        {
                get => _dateTimeStyles;
                set => _dateTimeStyles = value;
        }

        public string? DateTimeFormat
        {
                get => _dateTimeFormat ?? string.Empty;
                set => _dateTimeFormat = (string.IsNullOrEmpty(value)) ? null : value;
        }

        public CultureInfo Culture
        {
                get => _culture ?? CultureInfo.CurrentCulture;
                set => _culture = value;
        }

        public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options)
        {
                string text;


                if ((_dateTimeStyles & DateTimeStyles.AdjustToUniversal) == DateTimeStyles.AdjustToUniversal
                        || (_dateTimeStyles & DateTimeStyles.AssumeUniversal) == DateTimeStyles.AssumeUniversal)
                {
                        value = value.ToUniversalTime();
                }

                text = value.ToString(_dateTimeFormat ?? DefaultDateTimeFormat, Culture);

                writer.WriteStringValue(text);
        }

        public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
        {
                string? dateText = reader.GetString();

                if (string.IsNullOrEmpty(dateText) == false)
                {
                        if (!string.IsNullOrEmpty(_dateTimeFormat))
                        {
                                return DateTimeOffset.ParseExact(dateText, _dateTimeFormat, Culture, _dateTimeStyles);
                        }
                        else
                        {
                                return DateTimeOffset.Parse(dateText, Culture, _dateTimeStyles);
                        }
                }
                else
                {
                        return default(DateTimeOffset);
                }
        }


        public static readonly IsoDateTimeOffsetConverter Singleton = new IsoDateTimeOffsetConverter();
    }
}
#pragma warning restore CS8618
#pragma warning restore CS8601
#pragma warning restore CS8603

FulfillmentOrderEvent
{
  "$schema": "http://json-schema.org/draft-07/schema#", 
  "$id": "FulfillmentOrderEvent.json", 
  "description": "FulfillmentOrderEvent schema", 
  "type": "object", 
  "allOf": [
    {
      "$schema": "http://json-schema.org/draft-07/schema#", 
      "$id": "EventBase.json", 
      "description": "Details for Shipping Order JSON schema", 
      "type": "object", 
      "properties": {
        "AggregateId": {
          "description": "Unique ID for shipping order within Integration Broker", 
          "type": "string", 
          "format": "{FulfillmentSystemId}-{FulfillmentSystemCustomerId}-{ShippingOrderId}"
        }, 
        "CorrelationId": {"description": "Unique ID for SOB-external event trigger", "type": "string"}, 
        "AggregateType": {"description": "Type of event schema", "type": "string"}, 
        "EventActionUser": {
          "description": "Username of user who triggered event", 
          "type": ["string", "null"], 
          "veraCoreSource": "SHPACK_UserName in warehouse DB.  SHPACK in the OMS contains a SeqId for the warehouse table."
        }, 
        "EventDateTimeUtc": {
          "description": "UTC based datetime of when event was triggered", 
          "type": "string"
        }, 
        "EventName": {"description": "Name of triggered event", "type": "string"}, 
        "EventNameValuePairs": { "type": ["array", "null"], "items": {"type": "object"} }, 
        "EventPublisherApp": {
          "description": "Name of source application that published event", 
          "type": "string"
        }, 
        "EventSchemaVersion": {"description": "Version of event schema being used", "type": "string"}, 
        "EventSource": {"description": "Name of system where event was triggered", "type": "string"}
      }, 
      "required": [
        "AggregateId", "AggregateType", "CorrelationId", "EventDateTimeUtc", "EventName", 
        "EventPublisherApp", "EventSchemaVersion", "EventSource"
      ]
    }, 
    {
      "type": "object", 
      "properties": {
        "EventSchemaVersion": {
          "description": "Version of event schema being used", 
          "type": "string", 
          "enum": ["0.1"]
        }, 
        "FulfillmentOrder": {
          "$schema": "http://json-schema.org/draft-07/schema#", 
          "$id": "FulfillmentOrder.json", 
          "description": "Details for Fulfillment Order JSON schema", 
          "type": "object", 
          "title": "FulfillmentOrder", 
          "properties": {
            "CustomerId": {
              "description": "Customer ID tied to the fulfillment order", 
              "type": ["string", "null"]
            }, 
            "FulfillmentOrderId": { "description": "Unique ID for fulfillment order", "type": ["string", "null"] }, 
            "FulfillmentSystemCustomerId": {
              "description": "ID of customer within the fulfillment system", 
              "type": ["string", "null"]
            }, 
            "FulfillmentSystemId": {
              "description": "System used to fulfill the order", 
              "type": ["string", "null"]
            }, 
            "FulfillmentSystemLocationId": {
              "description": "ID of location within the fulfillment system", 
              "type": ["string", "null"]
            }, 
            "FulfillmentSystemOrderId": {
              "description": "Fulfillment order ID within the fulfillment system", 
              "type": ["string", "null"]
            }, 
            "ReferenceId": {
              "description": "Reference ID for the fulfillment order", 
              "type": ["string", "null"]
            }, 
            "BillTo": {
              "description": "Fulfillment order level bill to contact and address details", 
              "type": ["object", "null"], 
              "properties": {
                "Address1": { "description": "Address line 1 for address", "type": ["string", "null"] }, 
                "Address2": { "description": "Address line 2 for address", "type": ["string", "null"] }, 
                "Address3": { "description": "Address line 3 for address", "type": ["string", "null"] }, 
                "AddressCode": { "description": "Address code for address", "type": ["string", "null"] }, 
                "City": { "description": "City name for address", "type": ["string", "null"] }, 
                "Company": { "description": "Company name for address", "type": ["string", "null"] }, 
                "Country": { "description": "Country name for address", "type": ["string", "null"] }, 
                "EmailAddress": {
                  "description": "Contact email address for address", 
                  "type": ["string", "null"]
                }, 
                "FaxNumber": { "description": "Fax number for address", "type": ["string", "null"] }, 
                "Name": { "description": "Contact name for this address", "type": ["string", "null"] }, 
                "PhoneNumber": { "description": "Phone number for address", "type": ["string", "null"] }, 
                "PostalCode": { "description": "Postal code for address", "type": ["string", "null"] }, 
                "StateProvince": {
                  "description": "State or province name for address", 
                  "type": ["string", "null"]
                }
              }
            }, 
            "CreateDateTime": {
              "description": "Created date time of the fulfillment order", 
              "type": ["string", "null"]
            }, 
            "DefaultShipToKey": { "description": "Default key for ShipTo", "type": ["string", "null"] }, 
            "DueDate": {
              "description": "Due date of the fulfillment order", 
              "type": ["string", "null"]
            }, 
            "OrderIds": {
              "description": "Order IDs tied to the fulfillment order", 
              "type": ["array", "null"], 
              "items": {"type": "string"}
            }, 
            "OrderVariables": {
              "description": "Order variables tied to the fulfillment order in JSON format", 
              "type": ["string", "null"]
            }, 
            "PONumber": {
              "description": "PO number tied to the fulfillment order", 
              "type": ["string", "null"]
            }, 
            "PaymentMethods": {
              "description": "PaymentMethod details", 
              "type": ["array", "null"], 
              "items": {
                "type": "object", 
                "properties": {
                  "Amount"    : { "description": "Amount for the payment method", "type": ["number", "null"] }, 
                  "MethodName": { "description": "Name of the payment method"   , "type": ["string", "null"] }
                }
              }
            }, 
            "Products": {
              "description": "Fulfillment order level product details", 
              "type": ["array", "null"], 
              "items": {
                "type": "object", 
                "properties": {
                  "FulfillmentSystemId"       : { "description": "Fulfillment system ID"         , "type": ["string", "null"]  }, 
                  "FulfillmentSystemProductId": { "description": "Fulfillment system product ID" , "type": ["string", "null"]  }, 
                  "ProductId"                 : { "description": "Product ID"                    , "type": ["string", "null"]  }, 
                  "ProductLineId"             : { "description": "Product line ID"               , "type": ["string", "null"]  }, 
                  "AssociatedFileName"        : { "description": "Associated file name"          , "type": ["string", "null"]  }, 
                  "Comment"                   : { "description": "Comment for the product"       , "type": ["string", "null"]  }, 
                  "IsDeleted"                 : { "description": "Whether the product is deleted", "type": ["boolean", "null"] }, 
                  "PageCount"                 : { "description": "Page count for the product"    , "type": ["integer", "null"] }, 
                  "Price"                     : { "description": "Price of the product"          , "type": ["number", "null"]  }, 
                  "QuantityOrdered"           : { "description": "Quantity ordered"              , "type": ["integer", "null"] }, 
                  "ShipToKey"                 : { "description": "Ship to key for the product"   , "type": ["string", "null"]  }, 
                  "Status"                    : { "description": "Status of the product"         , "type": ["string", "null"]  }
                }
              }
            }, 
            "RushOrder": {
              "description": "Indicator if the order is a rush order", 
              "type": ["boolean", "null"]
            }, 
            "ShipTos": {
              "description": "Fulfillment order level ship to details", 
              "type": ["array", "null"], 
              "items": {
                "type": "object", 
                "properties": {
                  "FulfillmentSystemShippingMethodId": {
                    "description": "Fulfillment system shipping method ID", 
                    "type": ["string", "null"]
                  }, 
                  "ReferenceId": { "description": "Reference ID", "type": ["string", "null"] }, 
                  "Comment": { "description": "Comment", "type": ["string", "null"] }, 
                  "DueDate": { "description": "Due date", "type": ["string", "null"] }, 
                  "IsDeleted": { "description": "Whether the ship to is deleted", "type": ["boolean", "null"] }, 
                  "Key": {"description": "Key for the ship to", "type": "string"}, 
                  "PONumber": { "description": "PO number", "type": ["string", "null"] }, 
                  "PaymentMethods": {
                    "description": "Payment methods for this ship to", 
                    "type": ["array", "null"], 
                    "items": {
                      "type": "object", 
                      "properties": {
                        "Amount"    : { "description": "Amount for the payment method", "type": ["number", "null"] }, 
                        "MethodName": { "description": "Name of the payment method"   , "type": ["string", "null"] }
                      }
                    }
                  }, 
                  "RushFee": { "description": "Rush fee", "type": ["number", "null"] }, 
                  "RushOrder": { "description": "Whether this is a rush order", "type": ["boolean", "null"] }, 
                  "ShipToAddress": {
                    "description": "Ship to address", 
                    "type": ["object", "null"], 
                    "properties": {
                      "Address1": { "description": "Address line 1 for address", "type": ["string", "null"] }, 
                      "Address2": { "description": "Address line 2 for address", "type": ["string", "null"] }, 
                      "Address3": { "description": "Address line 3 for address", "type": ["string", "null"] }, 
                      "AddressCode": { "description": "Address code for address", "type": ["string", "null"] }, 
                      "City": { "description": "City name for address", "type": ["string", "null"] }, 
                      "Company": { "description": "Company name for address", "type": ["string", "null"] }, 
                      "Country": { "description": "Country name for address", "type": ["string", "null"] }, 
                      "EmailAddress": {
                        "description": "Contact email address for address", 
                        "type": ["string", "null"]
                      }, 
                      "FaxNumber": { "description": "Fax number for address", "type": ["string", "null"] }, 
                      "Name": { "description": "Contact name for this address", "type": ["string", "null"] }, 
                      "PhoneNumber": { "description": "Phone number for address", "type": ["string", "null"] }, 
                      "PostalCode": { "description": "Postal code for address", "type": ["string", "null"] }, 
                      "StateProvince": {
                        "description": "State or province name for address", 
                        "type": ["string", "null"]
                      }
                    }
                  }, 
                  "ShippingCarrier": { "description": "Shipping carrier", "type": ["string", "null"] }, 
                  "ShippingCost": { "description": "Shipping cost", "type": ["number", "null"] }, 
                  "ShippingService": { "description": "Shipping service", "type": ["string", "null"] }, 
                  "Status": { "description": "Status", "type": ["string", "null"] }
                }, 
                "required": ["Key"]
              }
            }, 
            "Shipments": {
              "description": "Shipments tied to the fulfillment order", 
              "type": ["array", "null"], 
              "items": {
                "type": "object", 
                "properties": {
                  "FulfillmentSystemId": { "description": "Fulfillment system ID", "type": ["string", "null"] }, 
                  "FulfillmentSystemLocationId": { "description": "Fulfillment system location ID", "type": ["string", "null"] }, 
                  "ShipmentId": { "description": "Shipment ID", "type": ["string", "null"] }, 
                  "Carrier": { "description": "Carrier", "type": ["string", "null"] }, 
                  "Freight": { "description": "Freight cost", "type": ["number", "null"] }, 
                  "IsDeleted": {
                    "description": "Whether the shipment is deleted", 
                    "type": ["boolean", "null"]
                  }, 
                  "MasterTrackingNumber": { "description": "Master tracking number", "type": ["string", "null"] }, 
                  "Packages": {
                    "description": "Packages in the shipment", 
                    "type": ["array", "null"], 
                    "items": {
                      "type": "object", 
                      "properties": {
                        "IsDeleted": { "description": "Whether the package is deleted", "type": ["boolean", "null"] }, 
                        "PackageNumber": { "description": "Package number", "type": ["string", "null"] }, 
                        "Products": {
                          "description": "Products in the package", 
                          "type": ["array", "null"], 
                          "items": {
                            "type": "object", 
                            "properties": {
                              "ProductLineId": { "description": "Product line ID", "type": ["string", "null"] }, 
                              "ShipQuantity" : { "description": "Ship quantity"  , "type": ["number", "null"] }
                            }
                          }
                        }, 
                        "TrackingNumber": { "description": "Tracking number", "type": ["string", "null"] }
                      }
                    }
                  }, 
                  "PackingSlipNumber": { "description": "Packing slip number", "type": ["string", "null"] }, 
                  "Service": { "description": "Service", "type": ["string", "null"] }, 
                  "ShipDateUtc": { "description": "Ship date in UTC", "type": ["string", "null"] }, 
                  "ShipToAddress": {
                    "description": "Ship to address", 
                    "type": ["object", "null"], 
                    "properties": {
                      "Address1": { "description": "Address line 1 for address", "type": ["string", "null"] }, 
                      "Address2": { "description": "Address line 2 for address", "type": ["string", "null"] }, 
                      "Address3": { "description": "Address line 3 for address", "type": ["string", "null"] }, 
                      "AddressCode": { "description": "Address code for address", "type": ["string", "null"] }, 
                      "City": { "description": "City name for address", "type": ["string", "null"] }, 
                      "Company": { "description": "Company name for address", "type": ["string", "null"] }, 
                      "Country": { "description": "Country name for address", "type": ["string", "null"] }, 
                      "EmailAddress": {
                        "description": "Contact email address for address", 
                        "type": ["string", "null"]
                      }, 
                      "FaxNumber": { "description": "Fax number for address", "type": ["string", "null"] }, 
                      "Name": { "description": "Contact name for this address", "type": ["string", "null"] }, 
                      "PhoneNumber": { "description": "Phone number for address", "type": ["string", "null"] }, 
                      "PostalCode": { "description": "Postal code for address", "type": ["string", "null"] }, 
                      "StateProvince": {
                        "description": "State or province name for address", 
                        "type": ["string", "null"]
                      }
                    }
                  }
                }
              }
            }, 
            "Statuses": {
              "description": "Statuses tied to the fulfillment order", 
              "type": ["array", "null"], 
              "items": {"type": "string"}
            }
          }, 
          "required": ["FulfillmentOrderId"]
        }
      }, 
      "required": ["FulfillmentOrder"]
    }, 
    {
      "type": "object", 
      "properties": {
        "EventName": {
          "description": "Name of triggered event", 
          "type": "string", 
          "enum": [
            "Fulfillment Order Created", "Fulfillment Order Submitted to Fulfillment System", 
            "Fulfillment Order Submission Failed", "Fulfillment Order Updated", 
            "Fulfillment Order Update Validation Failed"
          ]
        }
      }
    }
  ]
}