Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Onetrail TPN™ REST Communication

Onetrail TPN™ is providing services in order to trade electronically by using REST. This page describes the specifications for these REST services.

Scope

The Onetrail TPN™ REST for Sellers supports receiving orders, sending order status, despatch advice and invoice messages as well as handling of real-time price and availability requests. The provisioning of product-, price-, and stock data (batch) is not supported via REST, but via SOAP, FTP or email only.

The Onetrail TPN™ REST for Buyers supports the real time price and availability.

Design

The Onetrail TPN™ REST ODE Service for Sellers is payload agnostic, meaning the service is generic for all order related message types and thus not aware of the content of the message. Message validation (schema validation in case of XML) needs to be performed outside of the service. At this moment Onetrail TPN™ is not supporting JSON formatted messages, but only XML and EDIFACT.

The Onetrail TPN™ REST Service for Buyers supports JSON and XML.

Message definitions

Onetrail TPN™ supports JSON (P&A only), XML and EDIFACT for the REST services. The documentation and definitions can be found here: Message Types

Communication

From Seller to Onetrail TPN™

https://$base_url/exchange/rest/tradingpartner/{toGLN}/msgtype/{msgType}/msg/{msgID}

Example: https://acc-rest.onetrail.net/exchange/rest/tradingpartner/8714253023366/msgtype/OrderResponse/msg/OrdRspTest001

  • base_url:
    • Acceptance: acc-rest.onetrail.net
    • Production: rest.onetrail.net
  • Variables:
    • {toGLN} = provide the GLN for the buyer, or use fixed value unknown otherwise
    • {msgType} = OrderResponse, DespatchAdvice or Invoice
    • {msgID} = the unique messageID
  • Method: POST
  • Body: XML or EDIFACT content

From Onetrail TPN™ to Seller

https://$base_url/tradingpartner/{fromGLN}/msgtype/{msgType}/msg/{msgID}

Example: https://test.seller.com/tradingpartner/8714253023366/msgtype/Order/msg/OrdReqTest001

  • base_url:
    • Acceptance: to be provided by the Seller
    • Production: to be provided by the Seller
  • Variables:
    • {fromGLN} = GLN for the buyer sending the message
    • {msgType} = Order
    • {msgID} = the unique messageID
  • Method: POST
  • Body: XML or EDIFACT content

From Buyer to Onetrail TPN™ (P&A)

https://$base_url/pde/rest/v5/products?{SellerGLN}&{PDINumber}&{SellerVPN}&{GTIN}&{Quantity}&{BidID}

Example: https://services.onetrail.net/pde/rest/v5/products?SellerGLN=8714253023236&PDINumber=C7978A

  • base_url:
    • Acceptance: acc-services.onetrail.net
    • Production: services.onetrail.net
  • Variables:
    • SellerGLN (multiple ; separated)= provide the GLN from the Seller
    • PDINumber = Onetrail TPN™ PDI number
    • SellerVPN = Seller Vendor part number
    • GTIN = Seller Global Trade Item Number (EAN)
    • Quantity = Quantity for which you want the price and availability
    • BidID = Contract ID for the price of a contract product
  • Remarks:
    • At least one of the product numbers is mandatory;
    • Multiple product number types can be specified and will be used in the query independent of the other, so they will be performed individually. If the results relates to the same product, only that product will be returned.
    • Buyer GLN is identified by basic authentication
  • Response:

If no Seller GLN is specified, the response will contain all products from Sellers that matches the Request of which the buyer has prices

  • Remarks:
    • The JSON response is based on the PRD version 3.1 output
    • The result can contain multiple Onetrail PDI items. In that case the response will contain n-times an ns2:product element
    • The result can contain multiple Seller items per Onetrail PDI item. In that case the response will contain n-time an ns2:sellerInfo element
  • Method: GET
  • Body: JSON content

From Buyer to Onetrail TPN™ (Order)

https://$base_url/exchange/rest/tradingpartner/{toGLN}/msgtype/{msgType}/msg/{msgID}

Example: https://acc-rest.onetrail.net/exchange/rest/tradingpartner/8714253023236/msgtype/Order/msg/OrdReqTest001

  • base_url:
    • Acceptance: acc-rest.onetrail.net
    • Production: rest.onetrail.net
  • Variables:
    • {toGLN} = provide the GLN for the Seller, or use fixed value unknown otherwise
    • {msgType} = Order
    • {msgID} = the unique messageID (Can be used for duplicate checking)
  • Method: POST
  • Body: XML or EDIFACT content

Security

The REST service uses basic authentication and TLS 1.2 security settings. Credentials will be provided by Onetrail.