4.2.4.21. Tradeshift Gateway In
This gateway allows to retrieve files directly from an account on Tradeshift. The document retrieved will be marked as 'processed-by-babelway' in Tradeshift. The message will contain 2 metadata, 'document.metadata' containing the document metadatas and 'connection.properties' containing the connection properties, both as a single line JSON string.
URL Prefix to call Tradeshift API. Default is https://api.tradeshift.com/tradeshift/rest/ |
|
Choose 'Document' for regular fetching of document. Choose 'Workflow' to poll workflow document. |
|
The Tradeshift tenantId to use. Use Babelway application in Tradeshift to retrieve this value. |
|
The Tradeshift token to use. Use Babelway application in Tradeshift to retrieve this value. |
|
The Tradeshift token secret to use. Use Babelway application in Tradeshift to retrieve this value. |
|
The Tradeshift consumer key to use to authenticate the Babelway application. This should be left empty in most of the case. |
|
The Tradeshift consumer secret to use to authenticate the Babelway application. This should be left empty in most of the case. |
|
Specify where the document should be retrieved from. Values are 'inbox', 'outbox', 'sales', 'purchases', 'inbox,outbox', 'inbox,outboxsales,purchases', 'draft', 'sent'. Default is 'inbox'. |
|
type of document to retrieve. Values are 'invoice', 'creditnote', 'order', 'despatchadvice', 'invoice,creditnote', 'invoice,creditnote,order,despatchadvice'. Default is 'invoice'. |
|
Parameter list added to the initial 'list documents' api call. |
|
Process the documents in reverse order of retrieval. This option is useful if you query documents with the property 'ascending' set to false, which results in document being polled in the reverse order timewise, to process them in the correct order |
|
Parameters used to build the document query. It is highly recommended to at least set the properties 'withouttag', 'limit', 'type' and 'stag'. |
|
Should document metadata be fetched? |
|
Should network connection properties be fetched? |
|
Poll processed documents by appending '/processed' to the GET document call |
|
Set these tags to the document. It is important to at least set the 'withouttag' to avoid multiple processing of same message |
|
Set these tags to the document. It is important to at least set the 'withouttag' to avoid multiple processing of same message |
|
Set these properties to the document |
|
List of tags you want to remove from the document |
|
List of properties you want to remove from the document |
|
Update document in Tradeshift |
No tags will be added if this box is checked. For example : When the state of the message in babelway is "Delivered", babelway adds tag "processed-by-babelway" and the property "babelway-gatewayOutMeassageKey"(if any). When the state of the message in babelway is "Success", babelway adds the tag "sent-by-babelway" and the properties "sent-by-babelway","babelway-sentTimestamp". When the state of the message in babelway is "Error" or "Error_Closed" babelway add the properties "babelway-errorDescription" and "babelway-getwayOutMessageKey". |
Fetch collaboration messages for every document. Collaboration datas will be saved in message metadatas |
|
Which type of collaborations to fetch |
|
Include attachment into fetched data? |
|
Number of seconds between 2 checks. The default value is 3600 seconds (1 hour) and it can be lowered; the minimum accepted value is 90 seconds. This is the simplest way to define a time event. For more complex need, use the Cron Expression property instead. |
|
By default, the gateway will regularly poll the messages from your Tradeshift account, so that they come into Babelway less than one hour after they have been placed in your Tradeshift account. You can write here a cron expression to customise the polling schedule and the time zone for the polling. For easy creation of your cron expression, you can use the online cron maker tool available at : http://www.cronmaker.com/. |
This Gateway In allow you connect to Tradeshift server to receive specific document base on the configuration of this Gateway In.
By using the Tradeshift API in the configuration in the Gateway In we can control to receive:
-A specific document type (The corresponding parameter is "type").
-Receive document in ascending or descending order (The corresponding parameters is "ascending").
-Receive document issued between a specific period of time (The corresponding parameters are "minissuedate" and "maxissuedate").
-Control the limit of the received document in one call (The corresponding parameter is "limit").
The below link from Tradeshift describes all of the Tradeshift API calls to be used in this Gateway In.
https://developers.tradeshift.com/docs/api
- A check box is set "Do not add tags" so no tags are added at all if checked.
Note:
-
When the Tradeshift "Gateway In" is used in the channel and the message is in status "in delivery" (DELIVERED) in the Babelway system then for this tradeshift document the "processed-by-babelway" tag will be added and the "babelway-gatewayOutMessageKey" property will be added with the value of "This text will be replaced by the value of the message key if exists in the Tradeshift server" which is from the "Gateway out message key" which can be found from the Babelway "Message details" page and when the used "Gateway Out" of this channel don't generate a gateway out message key then the "babelway-gatewayOutMessageKey" property will be empty.
-
When the Tradeshift "Gateway In" is used in the channel and the message is in status "Success" (SUCCESS) in the Babelway system then for this tradeshift document the "sent-by-babelway" tag will be added and the "babelway-sentDate" property will be added with the end date of the message in yyyyMMdd format and the "babelway-sentTimestamp" property will be added with the end date of the message as timestamp.
-
When the Tradeshift "Gateway In" is used in the channel and the message is in status "Error" (ERROR) or "Error (closed)" (ERROR_CLOSED) in the Babelway system then for this tradeshift document the "babelway-errorDescription" property will be added with the value of "This text will be replaced by the value of the error message from Babelway" and the "babelway-gatewayOutMessageKey" property will be added with the value of "This text will be replaced by the value of the message key if exists in the Tradeshift server" which is from the "Gateway out message key" which can be found from the Babelway "Message details" page and when the used "Gateway Out" of this channel don't generate a gateway out message key then the "babelway-gatewayOutMessageKey" property will be empty.
ScanIO Connection Type for Tradeshft Gateway
The ScanIO connection type for the Tradeshft gateway facilitates integration between babelway and ScanIO. Here are the parameters available for your use:
-
Additional Query Parameters
These parameters can be included in the POST call to customize the message sent to ScanIO. Please refer to the ScanIO documentation for specific additions. By default, the ScanIO document ID will match the message ID in babelway. -
Is VAN
Enable this if you want to establish a VAN connection and POST the message toexternal/scanio/documents/van/
. -
ScanIO-VANID
This denotes the Van ID used in conjunction with IS VAN. -
Wait for Dispatch Stage
If set as "true," the message will only reach a SUCCESS state in babelway when the document in ScanIO has been successfully dispatched. Otherwise, even if there hasn't been a FAILURE but processing od the documents in ScanIO is pending, it will still be marked as SUCCESS at the end of the retry strategy. -
Properties
This segment allows you to include key-value pair properties that should be added to the TS document. -
Tags
Use this section to add tags to your TS documents.
For each message retrieved from Tradeshift two metadata are created and stored in the Context in file related to each document separately, This is stored in the "contextIn.xml" file in the "UserMetadatas" tag.
The "document.metadata" metadata contains all of the information related to this document for example (DocumentId, DocumentType, documentProfileId, … etc) stored in a JSON string.
The "connection.properties" metadata contains all of the information related to this connection properties for example (OpenDated, SupplierCategory, CompanyUrl, … etc) stored in a JSON string.
Example 1
We want to only poll documents with specific connection property which is "argtag"="TestInbound".
To accomplish this we will use the two query parameters "propertykey" and "propertyvalue".
In this case the "propertykey" will be "argtag" and the "propertyvalue" will be "TestInbound".
1-Create the Tradeshift Gateway In and configure the connection parameters.
2-From the Gateway In click on "Properties".
3-In the "Tradeshift" section for the "Additional query parameters" we will create the two query parameters with the corresponding values.
Example 2
The default limit for polling is 25 documents, so in this case for example we want to change it to be 70 documents.
To accomplish this we will use the query parameters "limit" which will be set to 70.
In the "Tradeshift" section for the "Additional query parameters" we will create the query parameter "limit" and set its value to "70".
Example 3
The query parameter "tag" is set by default to be interpreted as "OR" in this case we want to change it to be interpreted as "AND" this is done by setting the query parameter "useAndOperatorForTags" to "true".
In the "Tradeshift" section for the "Additional query parameters" we will create the query parameter "useAndOperatorForTags" and set its value to "true".
Example 4
We can use query parameter at the same time, In this we want to only poll documents with specific connection property which is "argtag"="TestInbound" and with limit of 70 documents.
We will use the three query parameters "propertykey" and "propertyvalue" and "limit".
In this case the "propertykey" will be "argtag" and the "propertyvalue" will be "TestInbound" and the "limit" will be "70".
Note:
- In the "General" page for this Gateway In you can see the "Poll now" button. When clicking on this button this will poll all of the messages immediately (and will not wait for the next defined moment).
- If there is a file name provided in the "Message In" or "Message Out" which contain ~ tilde character, All browser based on Chromium will replace the ~ tilde character by the _ underscore character when you try to download the file from the Babelway interface, For more details you can check this link https://bugs.chromium.org/p/chromium/issues/detail?id=479419
- You can check bunch of info like last success date, last message date …etc. by pressing on Run Info button.
- The maximum file size accepted by this gateway is 100 MB.