About the TradeByte category

Add topics about this connector package here.
Always check the ‘How to use the Alumio connector packages’ topic.

Extra information

System documentation: TB.One REST API Reference

Connector package documentation

​​Table of Contents

  • 1. Setting up HTTP Client Tradebyte
    • 1.1 Steps
  • 2. Subscribing to entities from Tradebyte
    • 2.1 Steps
    • 2.2 General concept
  • 3. Publishing entity to Tradebyte
    • 3.1 Steps
    • 3.2 General concept

1. Setting up the Tradebyte HTTP Client

1.1 Steps

  1. Follow the instructions on Generate REST API credentials in TB.One – TB.IO by Tradebyte.com page to get the REST API credentials.
  2. In Alumio Dashboard, go to Clients → HTTP Clients. Create a new HTTP Client and select Tradebyte HTTP Client as the prototype of the HTTP Client.
  3. Fill in the Base URI, Merchant ID, Username, and Password of the credential you set on Tradebyte.
  4. You can optionally enable logging of requests to get the log of the authentication.
  5. Save the HTTP Client.

2. Subscribing to Entities from Tradebyte

2.1 Steps

  1. Go to Connections → Incoming, create a new incoming configuration, and select Tradebyte Subscriber as the subscriber.
  2. Select the entity you want to subscribe to from Tradebyte.
  3. Add any request parameters needed to subscribe to the entity (optional, but path and query properties should exist, you can leave them as empty objects).
  4. You can additionally add a transformer to manipulate the request parameters into something you need.
  5. Select the Tradebyte HTTP Client to use.

2.2 General Concept

We follow the Tradebyte documentation on building this connector, so you can easily use the connector based on the Tradebyte API Reference.

Entity

The entity you want to subscribe to from Tradebyte. Please refer to the entities on the Tradebyte API Reference page.

Request Parameters

The parameters you can provide to get the needed entities are based on the Tradebyte API Reference. Please look at the example below on how to fill the Request Parameters field when subscribing Single order entity.

image

This means that we want to subscribe to an order with ID 1234567 and use the tborder transfer format. We can see in the documentation that a single order entity requires orderId as a path parameter to define which order we want to fetch.

  • Path is the path parameter of the url. For example, the {id}.
  • Query is a defined set of parameters attached to the end of a url.
    Example: www.url.com?type=true&start=0

That is why we need to define the orderId property inside the path property in the Request Parameters field. The properties inside query parameters (like mode in this example) will be parsed as query parameters.
The final URL that will be called is /orders/1234567?mode=tborder

Input Transformer

Any transformers set here will be executed after the Request Parameters are loaded. So, you basically can add any transformer to provide and manipulate the request parameters into anything you need, either as path parameters and/or as query parameters of an entity.

HTTP Client

It’s the HTTP Client configuration you will use to access Tradebyte.

3. Publishing Entity to Tradebyte

3.1 Steps

  1. Go to Connections → Outgoing, create a new outgoing configuration, and select Tradebyte Publisher as the publisher.
  2. Select the action that you want the publisher to do with the data.
  3. Select the HTTP Client to use.

3.2 General Concept

Like the subscriber, the publisher has similar methods on how to use it. The difference is the payload that will be submitted by the publisher originating from the data (from routes, from transformers in outgoing configuration).

Action

Currently, we support the following actions:

  • Send TB.Cat product-catalogue
  • Send an order
  • Mark order as processed
  • Send messages about order-status changes
  • Mark message as exported
  • Mark message as processed
  • Send information on article stock

Please refer to the Tradebyte API Reference page. Based on the documentation, some actions may need one or more path parameters.

For actions that don’t require a payload on the request body, please look at the following example: we want to mark a message as processed. Please select “Mark message as processed” as the action of the publisher.

The documentation says that we need messageId as path parameters. In that case, you need to provide the messageId property inside the path property in the data, either as an output from Routes or output from Transformers in Outgoing Configuration. Here is an example of the required data.

image

Alumio will send an API request to Tradebyte with URL /messages/5678/processed?channel=1234, and the body will be empty.

For actions that require us to put payload into the request (TB.One REST API Reference), you can just put the data into the payload property like the example below.

image

  • Path is the path parameter of the url. For example, the {id}.
  • Query is a defined set of parameters attached to the end of a url.
    Example: www.url.com?type=true&start=0
  • Payload is the data contained within a request.

Alumio will send an API request to Tradebyte on URL /articles/stock with the request body below.

image

HTTP Client

This is the HTTP Client configuration you will use to access Tradebyte.