How Do You Connect Every Company in the World?

how-do-you-connect-every-company-in-the-world-Nordic-apis

The ancient Sumerians were the first known civilization to record their culture on cuneiform tablets. Much of the written artifacts that exist today from that time are not eloquent prose, tales of old quests, or elegant poetry — but administrative cataloging. Some of the world’s first invoices evolved from tablets engraved in cuneiform. Basically, ancient B2B.

Jumping from the first ancient proof of a standardized invoice method system on into the 1990s, we saw the advent of XML as a way to standardize online business interoperability. Now history compared to the rapid growth and change in the web space, XML has nonetheless been a major step in standardizing the first Business-to-business (B2B) online communication processes.

Compared to social network communication, businesses still tend to be more isolationist in terms of connectivity and open partner communication. Though they are slower to evolve, some believe the efficiency of API-enabled B2B communication will revolutionize distribution channels away from EDI, with the same force that social networks have exploded in usage on the consumer level.

In this piece, we’ll we revisit our heritage, explore XML as well as the Universal Business Language (UBL), used for increasing connectivity for B2B. With an emphasis on invoice automation, we’ll examine the Tradeshift API, and also highlight APIs that enterprise developers can introduce into their company’s platforms to help improve their ERP processes.


Watch Gert Sylvest of Tradeshift give a talk on this subject at a Nordic APIs event

How to Totally Fail B2B

Gert Sylvest, CTO and co-founder at Tradeshift, cites a story that encapsulates a common problem in the international B2B distribution pipeline. In 2011, an owner of a small sports shop in Copenhagen opened up a box of what he expected to be 100 GPS watches for his sport shop, but instead discovered the package to be full of cans of macadamia nuts.

The order was processed through Alibaba, a massive marketplace that connects Chinese suppliers to purchasers in the western world. What Alibaba provides is essentially a company directory — visitors can view available products, pricing, and company contact information. After looking this up, they can make an agreement with the supplier to order items.

With this system in place, however, Alibaba has had numerous accounts of fraud — scams occur in the form of payment fraud, shipment of incorrect or damaged items, and middle men acting as proxy companies. In February 2011, Alibaba acknowledged over 2200 cases cases of systematically organized fraud. Most commonly, the people who claimed to be suppliers simply did not follow through with shipment after receiving money from the client. This exposes the inherent weakness in the eBay inspired “telephone directory model”, as Sylvest calls it. Company vetting and secure payment must be standardized to bring about confident online B2B communication.

The Bigger Picture

Why does Alibaba exist in the first place? A huge benefit is that the platform removes some barriers between buyers and suppliers, placing both in the digital supply chain, where things are more efficient. For the supplier, they get access to an international clientele, cutting away bulk in the intermediary and leading to increased sales. For the purchaser, they get access to a breadth of competitive, international goods.

Out of the estimated 125 million registered companies in the world, most are small to medium sized businesses. Many more exist throughout the world that aren’t legally registered. The goal is to connect all businesses to the same level of supply chain automation that exists within larger enterprises.

B2B Social Tech Revolution

Social media is driving the bulk of internet traffic — and Forbes estimates that social media is behind 31% of all internet referrals. An entire economy hinges on consumer participation in social and collaborative networks. Statista estimates the size of some major current social networks as follows:

Facebook 1.4 Billion
QQ 832 Million
WhatsApp 800 Million
Twitter 316 Million
Instagram 300 Million
Tumblr 230 Million

B2B Connectivity is an Uncharted Land

Why haven’t we seen a similar emergence of collaboration and ubiquitous connectivity in the B2B realm? As a benchmark, according to Gert Sylvest only 4–8% of companies send invoices electronically. Phone, fax, and email are still standard methods of communication in corporate partnership exchanges. EDI (Electronic Data Exchange) has existed for some time, XML has had a stable adoption in the corporate environment, but some see the future lies in further emergence of RESTful API design for sharing corporate information .

The Origins of XML & UBL

Extensible Markup Language, or XML, has historically played an important role in many IT systems. Essentially information wrapped in tags, XML carries data and details what the data is. XML doesn’t rely on predefined tags, which are dependent on the author to define.

XML stores data in plain text format. This provides a software – and hardware – independent way of storing, transporting, and sharing data.

It’s interesting to revisit Jon Bosak, “the father” of XML, expressing his vision behind it:

“Most of the world’s business is, in fact, done by small companies. I want to enable a five-person manufacturer of fabrics in Pakistan to bid on supplying a hundred unites our of a purchase request for a million seat covers from General Motors. Seeing both parties to this transaction benefit equally is for me what this is all about”

The vision behind XML was that it was an independent data platform for interaction. The semantics was separated from the visual representation, aiming at a responsive, interactive web to connect companies globally, regardless of size.

Maintained by an OASIS technical committee, UBL, the Universal Business Language, is a logical extension of this vision. A lofty ambition, the “global standard for electronic business,” aims to enable companies all over the world to connect as easily as consumers can using the World Wide Web. UBL is a library of standard XML documents made for businesses to exchange accounting information.

The strength of UBL, as with any standard, is:

  1. Standardized: UBL is an open global standard from a recognized standards consortium.
  2. Technology: UBL exists, and behaves as expected.
  3. Governance: UBL is stable and well-maintained.
  4. Adoption: UBL has been used an proven in much market adoption

Example Invoice

Let’s assume we want to create a service that automates the delivery of invoices. So we draft an API. First we need to collect some very basic data from the client:

  • Sender
  • Receiver
  • Total $
  • Due date

Then comes additional information which may be legally required:

  • Invoice number
  • Currency type
  • Attn # for receiving company
  • Currency
  • Order ref

We may also need to create more complex sub-groupings for itemized billing. For global exchanges, variances in international address formats, postal codes, tax rates and schemas all need to considered country to country. Sending invoices internationally can be a complex affair.

How UBL Helps

Enter UBL. An ISO standard, UBL supports 65 business document types, allowing 2000+ business information types. It has a wide process coverage, including tendering, cataloguing, ordering, billing, inventory management, and more. XML based, UBL has a fairly old soul. Here’s an example of what it looks like:

<?xml version="1.0" encoding="UTF-8"?>
        <cbc:UBLVersionID>2.0</cbc:UBLVersionID>        <cbc:CustomizationID>urn:oasis:names:specification:ubl:xpath:Invoice-2.0:sbs-1.0-draft</cbc:CustomizationID>
        <cbc:ProfileID>bpid:urn:oasis:names:draft:bpss:ubl-2-sbs-invoice-notification-draft</cbc:ProfileID>
        <cbc:ID>A00095678</cbc:ID>
        <cbc:CopyIndicator>false</cbc:CopyIndicator>
        <cbc:UUID>849FBBCE-E081-40B4-906C-94C5FF9D1AC3</cbc:UUID>
        <cbc:IssueDate>2005-06-21</cbc:IssueDate>
        <cbc:InvoiceTypeCode>SalesInvoice</cbc:InvoiceTypeCode>
        <cbc:Note>sample</cbc:Note>
        <cbc:TaxPointDate>2005-06-21</cbc:TaxPointDate>
        <cac:OrderReference>
                <cbc:ID>AEG012345</cbc:ID>
                <cbc:SalesOrderID>CON0095678</cbc:SalesOrderID>
                <cbc:UUID>6E09886B-DC6E-439F-82D1-7CCAC7F4E3B1</cbc:UUID>
                <cbc:IssueDate>2005-06-20</cbc:IssueDate>
        </cac:OrderReference>
        <cac:AccountingSupplierParty>
                <cbc:CustomerAssignedAccountID>CO001</cbc:CustomerAssignedAccountID>
                <cac:Party>
                        <cac:PartyName>
                                <cbc:Name>Consortial</cbc:Name>
                        </cac:PartyName>
                        <cac:PostalAddress>
                                <cbc:StreetName>Busy Street</cbc:StreetName>
                                <cbc:BuildingName>Thereabouts</cbc:BuildingName>
                                <cbc:BuildingNumber>56A</cbc:BuildingNumber>
                                <cbc:CityName>Farthing</cbc:CityName>
                                <cbc:PostalZone>AA99 1BB</cbc:PostalZone>
                                <cbc:CountrySubentity>Heremouthshire</cbc:CountrySubentity>
                                <cac:AddressLine>
                                        <cbc:Line>The Roundabout</cbc:Line>
                                </cac:AddressLine>
                                <cac:Country>
                                        <cbc:IdentificationCode>GB</cbc:IdentificationCode>
                                </cac:Country>

 

We see a structure that includes issue date, information about the provider, invoice date, etc. It’s pretty straightforward, but becomes more complex depending on certain user cases.

Tradeshift: Example of API-First UBL Application

Tradeshift, a SaaS company with a network of over 500,000 companies, aims to consolidate suppliers and related financial services. Using the Tradeshift REST API and app framework modeled around UBL, companies can integrate with their ERP system. A supplier fills in the invoice, and it is converted to UBL behind the covers, and they are then transported to the buyer account. You can choose between different ways to consume invoices and various upload formats. Sylvest acknowledges that Tradeshift is completely an API-first company:

”From day one we decided we are a platform. The API is completely core to what we are doing, because we have all these different target groups that just want to consume and produce business documents and interactions and so on in so many ways that we can’t start providing UIs or connectors for everything ourselves.”

For Tradeshift, the front end consumes the same API that is exposed to third parties, enabling app development and internal processes to all eat the same dog food. The UBL flavored API supports OAuth, serves both JSON and XML, and treats documents, transactions, events, and relationships as resources (/documents, /dispatches, /network/connections, /account, etc.)

Example call to the Tradeshift API:

PUT/documents/6c50d0dd-7775-487e-9a7d-5a3825dng4ld/dispatches/1
Authorizatoin: OAuth XXXXXX
Content-Type: application/json

{“ConnectionID”: “f3485598-48227-4d2j-da234-n25j532b3du4”}

To call an invoice with the API, you simply identify the document’s unique identifier. The API can be looped into workflows like invoicing, paying, accepting, and more. They offer a web interface for creating invoices and interacting with customers, and offer an internal activity stream for collaboration.

Some Other API-First Services Trying to Rid the World of Paper Invoices

Here we link to the documentation for some other folks in the invoice automation business — there are many services with similar offerings. Often ERP systems offer an extension of their platform, or the API may be a core product:

Conclusion: APIs, B2B, and Social Tech

Why use UBL and surrounding services? The library covers many use cases and can handle high levels of complexity — good for global interoperability. Though, according to Sylvest, if can be difficult getting started with the semantics, various nuances, starter kits, and clients. That’s where services like Tradeshift and other APIs come into play.

In general, B2B interoperability is uncharted territory. Micro apps may be key in establishing extensibility in specific domains, but need a framework within which to process information – APIs and standardized language libraries and semantics will be crucial to further development and connectivity in the B2B space.

Resources