# Tradeshift

> Find and tag invoices, orders and other documents, manage trading partners and connection requests, and assign documents to colleagues in Tradeshift.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/tradeshift

## Actions

### Accept connection request

Accept a company's request to join your network, so you can exchange documents.

**Inputs**

- Connection request (`partner_id`, text, required): The request to accept, from List connection requests.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "ConnectionId": "example",
    "accepted": true
  }
}
```

### Add document tag

Tag a document, for example to mark it as handled so a workflow skips it next time. Tags show in Tradeshift too.

**Inputs**

- Document (`document_id`, text, required): The document (an invoice, credit note, order or other business document).
- Tag (`tag`, text, required): The tag, such as `Posted` or `Exported to ERP`.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "done": true
  }
}
```

### Close assignment

Mark an open assignment as closed.

**Inputs**

- Assignment (`assignment_id`, text, required): The assignment: a task asking a colleague to act on a document.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "done": true
  }
}
```

### Create assignment

Ask one or more people in your company to act on a document, such as approving an invoice.

**Inputs**

- Document (`document_id`, text, required): The document the assignment is about.
- Assignees (`assignee_ids`, list, required): The people to assign it to.
- Comment (`comment`, text): A note for the assignees.
- Tags (`tags`, list): Labels to put on the assignment.
- Your reference (`external_id`, text): Your own reference for the assignment, to find it again later.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "app": "example",
    "assigneeIds": [
      "example"
    ],
    "comment": "example",
    "companyId": "example",
    "createdAt": "example",
    "createdBy": "example",
    "externalId": "example",
    "id": "example",
    "modifiedAt": "example",
    "modifiedBy": "example",
    "outcome": "example",
    "status": "example",
    "subjectId": "example",
    "tags": [
      "example"
    ],
    "type": "example"
  }
}
```

### Delete connection property

Remove a property from a trading partner.

**Inputs**

- Connection (`partner_id`, text, required): The connection: a trading partner in your network.
- Property name (`key`, text, required): The property's name, such as `VendorNumber`.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "done": true
  }
}
```

### Delete document property

Remove a property from a document.

**Inputs**

- Document (`document_id`, text, required): The document (an invoice, credit note, order or other business document).
- Property name (`key`, text, required): The property's name, such as `ERPCode`.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "done": true
  }
}
```

### Find user by email

Find a person in your company account by their email address.

**Inputs**

- Email (`email`, text, required): The person's email address. Upper and lower case don't matter.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "CompanyAccountId": "example",
    "Id": "example",
    "Kind": "example",
    "Language": "example",
    "Person": {
      "Created": "example",
      "Email": "example",
      "FirstName": "example",
      "LastName": "example"
    },
    "State": "example",
    "TimeZone": "example",
    "UserName": "example"
  }
}
```

### Get assignment

Get an assignment's status, assignees, comment and outcome.

**Inputs**

- Assignment (`assignment_id`, text, required): The assignment: a task asking a colleague to act on a document.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "app": "example",
    "assigneeIds": [
      "example"
    ],
    "comment": "example",
    "companyId": "example",
    "createdAt": "example",
    "createdBy": "example",
    "externalId": "example",
    "id": "example",
    "modifiedAt": "example",
    "modifiedBy": "example",
    "outcome": "example",
    "status": "example",
    "subjectId": "example",
    "tags": [
      "example"
    ],
    "type": "example"
  }
}
```

### Get company account

Get your company account's details: its name, country, identifiers and ID.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "AccountType": "example",
    "CompanyAccountId": "example",
    "CompanyName": "example",
    "Country": "example",
    "Created": "example",
    "Description": "example",
    "Modified": "example",
    "NumConnections": "example",
    "Phone": "example",
    "State": "example",
    "Url": "example"
  }
}
```

### Get document

Get a document's full content, such as an invoice's lines, parties and totals, in UBL form.

**Inputs**

- Document (`document_id`, text, required): The document (an invoice, credit note, order or other business document).

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {}
}
```

### Get document property

Read one property stored on a document.

**Inputs**

- Document (`document_id`, text, required): The document (an invoice, credit note, order or other business document).
- Property name (`key`, text, required): The property's name, such as `ERPCode`.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "found": true,
    "key": "example",
    "value": "example"
  }
}
```

### Get latest dispatch

Get how a sent document was last delivered: its channel and whether delivery completed.

**Inputs**

- Document (`document_id`, text, required): The document (an invoice, credit note, order or other business document).

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "Created": "example",
    "DispatchChannel": "example",
    "DispatchId": "example",
    "DispatchState": "example",
    "LastStateChange": "example",
    "ObjectId": "example",
    "ReceiverConnectionId": "example",
    "SenderUserId": "example"
  }
}
```

### List assignments

List assignments: tasks asking someone in your company to act on a document.

**Inputs**

- Status (`status`, text): Only assignments with this status. One of: `OPEN`, `CLOSED`, `WAITING_FOR_ASSIGNEES` (Waiting for assignees).
- Assignee (`assignee_id`, text): Only assignments given to this person.
- Document (`document_id`, text): Only assignments about this document.
- Created from (`created_from`, date and time): Only assignments created after this time.
- Changed from (`modified_from`, date and time): Only assignments changed after this time.
- Page (`page`, number): The page of results to return, starting at 0. Leave empty for the first. At least 0.
- Results per page (`limit`, number): How many results to return per page, up to 100. Leave empty for 20. From 1 to 100.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "items": [
      {
        "app": "example",
        "assigneeIds": [
          "example"
        ],
        "comment": "example",
        "companyId": "example",
        "createdAt": "example",
        "createdBy": "example",
        "externalId": "example",
        "id": "example",
        "modifiedAt": "example",
        "modifiedBy": "example",
        "outcome": "example",
        "status": "example",
        "subjectId": "example",
        "tags": [
          "example"
        ],
        "type": "example"
      }
    ],
    "total": 1
  }
}
```

### List connection requests

List requests from other companies to join your network that are waiting for an answer.

**Inputs**

- Page (`page`, number): The page of results to return, starting at 0. Leave empty for the first. At least 0.
- Results per page (`limit`, number): How many results to return per page, up to 100. Leave empty for 25. From 1 to 100.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "Items": [
      {
        "Connection": {
          "CompanyAccountId": "example",
          "CompanyName": "example",
          "ConnectionType": "example",
          "Country": "example"
        },
        "Id": "example",
        "Received": "example",
        "SenderCompanyAccountId": "example"
      }
    ],
    "itemCount": 1,
    "itemsPerPage": 1,
    "numPages": 1,
    "pageId": 1
  }
}
```

### List connections

List the trading partners in your network.

**Inputs**

- Search text (`search`, text): Only connections matching these words, such as a company name.
- Connection type (`type`, text): Only partners already on Tradeshift, or only ones you added who aren't yet. One of: `TradeshiftConnection` (On Tradeshift), `ExternalConnection` (Not on Tradeshift yet (external)).
- Page (`page`, number): The page of results to return, starting at 0. Leave empty for the first. At least 0.
- Results per page (`limit`, number): How many results to return per page, up to 100. Leave empty for 25. From 1 to 100.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "Connection": [
      {
        "ConnectionId": "example",
        "ConnectionType": "example",
        "FromCompanyAccountId": "example",
        "State": "example",
        "ToCompanyAccountId": "example"
      }
    ],
    "itemCount": 1,
    "itemsPerPage": 1,
    "numPages": 1,
    "pageId": 1
  }
}
```

### List document attachments

List the files attached to a document.

**Inputs**

- Document (`document_id`, text, required): The document (an invoice, credit note, order or other business document).

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "DocumentAttachment": [
      {
        "ContentType": "example",
        "Name": "example",
        "Type": "example"
      }
    ]
  }
}
```

### List document properties

List the properties (your own named values, such as an ERP posting number) stored on a document.

**Inputs**

- Document (`document_id`, text, required): The document (an invoice, credit note, order or other business document).

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {}
}
```

### List document tags

List the tags on a document.

**Inputs**

- Document (`document_id`, text, required): The document (an invoice, credit note, order or other business document).

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "Tag": [
      "example"
    ]
  }
}
```

### List documents

Find invoices, credit notes, orders and other documents, most recently changed first.

**Inputs**

- Document type (`type`, text): Only this kind of document. One of: `invoice`, `creditnote` (Credit note), `order` (Purchase order), `quote`.
- Folder (`folder`, text): Only documents in this folder. Leave empty for all but drafts and deleted ones. One of: `inbox` (Inbox (received)), `outbox` (Sent), `draft` (Drafts), `sales`, `purchases`, `deleted`.
- Status (`state`, text): Only documents with this status. One of: `SENT`, `DELIVERED`, `ACCEPTED`, `OVERDUE`, `PAID_UNCONFIRMED` (Paid (not confirmed)), `PAID_CONFIRMED` (Paid (confirmed)), `REJECTED_BY_SENDER` (Rejected by sender), `REJECTED_BY_RECEIVER` (Rejected by receiver), `DISPUTED_BY_RECEIVER` (Disputed by receiver), `FAILED_DELIVERY` (Delivery failed), and 3 more.
- Document number (`number`, text): Only documents with this number, such as an invoice or order number.
- Search text (`search`, text): Only documents containing this text.
- With tag (`tag`, text): Only documents with this tag.
- Without tag (`without_tag`, text): Only documents without this tag, such as one your workflow adds once it has handled a document.
- Changed since (`changed_since`, date and time): Only documents changed after this time.
- Issued from (`issued_from`, date): Only documents issued on or after this date.
- Issued to (`issued_to`, date): Only documents issued on or before this date.
- Page (`page`, number): The page of results to return, starting at 0. Leave empty for the first. At least 0.
- Results per page (`limit`, number): How many results to return per page, up to 100. Leave empty for 25. From 1 to 100.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "Document": [
      {
        "ConversationId": "example",
        "Deleted": true,
        "DocumentId": "example",
        "DocumentType": {
          "documentProfileId": "example",
          "mimeType": "example",
          "type": "example"
        },
        "ID": "example",
        "ItemInfos": [
          {
            "type": "example",
            "value": "example"
          }
        ],
        "LastEdit": "example",
        "LatestDispatch": {
          "Created": "example",
          "DispatchChannel": "example",
          "DispatchId": "example",
          "DispatchState": "example",
          "LastStateChange": "example",
          "ObjectId": "example",
          "ReceiverConnectionId": "example",
          "SenderUserId": "example"
        },
        "ProcessState": "example",
        "ReceiverCompanyName": "example",
        "SentReceivedTimestamp": "example",
        "State": "example",
        "Tags": {
          "Tag": [
            "example"
          ]
        },
        "URI": "example",
        "UnifiedState": "example"
      }
    ],
    "itemCount": 1,
    "itemsPerPage": 1,
    "numPages": 1,
    "pageId": 1
  }
}
```

### List users

List the people in your company account.

**Inputs**

- Page (`page`, number): The page of results to return, starting at 0. Leave empty for the first. At least 0.
- Results per page (`limit`, number): How many results to return per page, up to 100. Leave empty for 25. From 1 to 100.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "PrimaryUser": "example",
    "UserAccounts": [
      {
        "CompanyAccountId": "example",
        "CompanyName": "example",
        "Created": "example",
        "FirstName": "example",
        "Id": "example",
        "Language": "example",
        "LastName": "example",
        "State": "example",
        "TimeZone": "example",
        "Type": "example",
        "Username": "example",
        "Visible": true
      }
    ],
    "itemCount": 1,
    "itemsPerPage": 1,
    "numPages": 1,
    "pageId": 1
  }
}
```

### Reassign assignment

Give an open assignment to someone else.

**Inputs**

- Assignment (`assignment_id`, text, required): The assignment: a task asking a colleague to act on a document.
- New assignee (`assignee_id`, text, required): The person to give it to.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "app": "example",
    "assigneeIds": [
      "example"
    ],
    "comment": "example",
    "companyId": "example",
    "createdAt": "example",
    "createdBy": "example",
    "externalId": "example",
    "id": "example",
    "modifiedAt": "example",
    "modifiedBy": "example",
    "outcome": "example",
    "status": "example",
    "subjectId": "example",
    "tags": [
      "example"
    ],
    "type": "example"
  }
}
```

### Remove document tag

Remove a tag from a document.

**Inputs**

- Document (`document_id`, text, required): The document (an invoice, credit note, order or other business document).
- Tag (`tag`, text, required): The tag, such as `Posted` or `Exported to ERP`.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "done": true
  }
}
```

### Set connection property

Store a named value on a trading partner, such as your own vendor or customer number for them, replacing any value already there.

**Inputs**

- Connection (`partner_id`, text, required): The connection: a trading partner in your network.
- Property name (`key`, text, required): The property's name, such as `VendorNumber`.
- Value (`value`, text, required): The value to store.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "key": "example",
    "value": "example"
  }
}
```

### Set document property

Store a named value on a document, such as the posting number your ERP gave it, replacing any value already there.

**Inputs**

- Document (`document_id`, text, required): The document (an invoice, credit note, order or other business document).
- Property name (`key`, text, required): The property's name, such as `ERPCode`.
- Value (`value`, text, required): The value to store.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "key": "example",
    "value": "example"
  }
}
```

### Update assignment comment

Replace an assignment's comment.

**Inputs**

- Assignment (`assignment_id`, text, required): The assignment: a task asking a colleague to act on a document.
- Comment (`comment`, text, required): The new comment.

**Outputs**

- `data` (object): The response from Tradeshift.

**Example output**

```json
{
  "data": {
    "comment": "example",
    "done": true
  }
}
```
