GithubHelp home page GithubHelp logo

x12's Introduction

x12

Go Reference

x12 is a Go library for handling EDI x12 documents.

Features

  • Decoding
  • Validation
  • Encoding (Marshaling)

Contributing

We welcome contributions to x12! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.

License

x12 is released under the MIT License.

$ go run ./examples/basics/basics.go
{
    "Interchange": {
        "Header": {
            "AuthorizationInfoQualifier": "00",
            "AuthorizationInformation": "          ",
            "SecurityInfoQualifier": "00",
            "SecurityInfo": "          ",
            "InterchangeSenderIDQualifier": "08",
            "InterchangeSenderID": "9254110060     ",
            "InterchangeReceiverIDQualifier": "ZZ",
            "InterchangeReceiverID": "123456789      ",
            "InterchangeDate": "041216",
            "InterchangeTime": "0805",
            "InterchangeControlStandardsID": "U",
            "InterchangeControlVersion": "00501",
            "InterchangeControlNumber": "000095071",
            "AcknowledgmentRequested": "0",
            "UsageIndicator": "P",
            "ComponentElementSeparator": "\u003e"
        },
        "FunctionGroups": [
            {
                "Header": {
                    "FunctionalIDCode": "AG",
                    "ApplicationSenderCode": "5137624388",
                    "ApplicationReceiverCode": "123456789",
                    "Date": "20041216",
                    "Time": "0805",
                    "GroupControlNumber": "95071",
                    "ResponsibleAgencyCode": "X",
                    "VersionReleaseIndustryID": "005010"
                },
                "Transactions": [
                    {
                        "Header": {
                            "TransactionSetIDCode": "824",
                            "TransactionSetControlNumber": "021390001"
                        },
                        "Segments": [
                            {
                                "ID": "BGN",
                                "Elements": [
                                    {
                                        "ID": "01",
                                        "Value": "11"
                                    },
                                    {
                                        "ID": "02",
                                        "Value": "FFA.ABCDEF.123456"
                                    },
                                    {
                                        "ID": "03",
                                        "Value": "20020709"
                                    },
                                    {
                                        "ID": "04",
                                        "Value": "0932"
                                    },
                                    {
                                        "ID": "05",
                                        "Value": ""
                                    },
                                    {
                                        "ID": "06",
                                        "Value": "123456789"
                                    },
                                    {
                                        "ID": "07",
                                        "Value": ""
                                    },
                                    {
                                        "ID": "08",
                                        "Value": "WQ"
                                    }
                                ]
                            },
                            {
                                "ID": "N1",
                                "Elements": [
                                    {
                                        "ID": "01",
                                        "Value": "41"
                                    },
                                    {
                                        "ID": "02",
                                        "Value": "ABC INSURANCE"
                                    },
                                    {
                                        "ID": "03",
                                        "Value": "46"
                                    },
                                    {
                                        "ID": "04",
                                        "Value": "111111111"
                                    }
                                ]
                            },
                            {
                                "ID": "PER",
                                "Elements": [
                                    {
                                        "ID": "01",
                                        "Value": "IC"
                                    },
                                    {
                                        "ID": "02",
                                        "Value": "JOHN JOHNSON"
                                    },
                                    {
                                        "ID": "03",
                                        "Value": "TE"
                                    },
                                    {
                                        "ID": "04",
                                        "Value": "8005551212"
                                    },
                                    {
                                        "ID": "05",
                                        "Value": "EX"
                                    },
                                    {
                                        "ID": "06",
                                        "Value": "1439"
                                    }
                                ]
                            },
                            {
                                "ID": "N1",
                                "Elements": [
                                    {
                                        "ID": "01",
                                        "Value": "40"
                                    },
                                    {
                                        "ID": "02",
                                        "Value": "SMITHCO"
                                    },
                                    {
                                        "ID": "03",
                                        "Value": "46"
                                    },
                                    {
                                        "ID": "04",
                                        "Value": "A1234"
                                    }
                                ]
                            },
                            {
                                "ID": "OTI",
                                "Elements": [
                                    {
                                        "ID": "01",
                                        "Value": "TA"
                                    },
                                    {
                                        "ID": "02",
                                        "Value": "TN"
                                    },
                                    {
                                        "ID": "03",
                                        "Value": "NA"
                                    },
                                    {
                                        "ID": "04",
                                        "Value": ""
                                    },
                                    {
                                        "ID": "05",
                                        "Value": ""
                                    },
                                    {
                                        "ID": "06",
                                        "Value": "20020709"
                                    },
                                    {
                                        "ID": "07",
                                        "Value": "0902"
                                    },
                                    {
                                        "ID": "08",
                                        "Value": "2"
                                    },
                                    {
                                        "ID": "09",
                                        "Value": "0001"
                                    },
                                    {
                                        "ID": "10",
                                        "Value": "834"
                                    },
                                    {
                                        "ID": "11",
                                        "Value": "005010X220A1"
                                    }
                                ]
                            }
                        ],
                        "Trailer": {
                            "NumberOfIncludedSegments": "7",
                            "TransactionSetControlNumber": "021390001"
                        }
                    }
                ],
                "Trailer": {
                    "NumberOfIncludedTransactionSets": "1",
                    "GroupControlNumber": "95071"
                }
            }
        ],
        "Trailer": {
            "NumberOfIncludedFunctionalGroups": "1",
            "InterchangeControlNumber": "000095071"
        }
    }
}

x12's People

Contributors

tmc avatar apxamccallum avatar xemptuous avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.