Generate X12 GS Last updated: 2023-04-24

X12 GS Specification

X12 GS specification is available at:

ediFabric .NET C# Examples

The example below is part of the ediFabric .NET C# Code Examples.

Download EDI C# Examples

The Generate X12 GS code is also available on GitHub

How to generate X12 GS with ediFabric .NET

///
/// Build GS.
///
public static GS BuildGs(string controlNumber,
	string senderId = "SENDER1",
	string receiverId = "RECEIVER1",
	string version = "004010")
{
	return new GS
	{
		//  Functional ID Code
		CodeIdentifyingInformationType_1 = "IN",
		//  Application Senders Code
		SenderIDCode_2 = senderId,
		//  Application Receivers Code
		ReceiverIDCode_3 = receiverId,
		//  Date
		Date_4 = DateTime.Now.Date.ToString("yyMMdd"),
		//  Time
		Time_5 = DateTime.Now.TimeOfDay.ToString("hhmm"),
		//  Group Control Number
		//  Must be unique to both partners for this interchange
		GroupControlNumber_6 = controlNumber.PadLeft(9, '0'),
		//  Responsible Agency Code
		TransactionTypeCode_7 = "X",
		//  Version/Release/Industry id code
		VersionAndRelease_8 = version
	};
}