Tradeshift e-Invoicing / P2P Connector Guide

The Tradeshift connector lets Tealfabric workflows automate invoice and purchase-to-pay operations using Tradeshift APIs with OAuth2 client-credentials authentication. This guide explains setup, common send/receive patterns, and reliability practices for invoice and supplier workflows.

Document information
FieldValue
Canonical URL/docs/04_connecting-systems/connectors/t/tradeshift
Version (published date)2026-05-08
Tagsconnectors, reference, tradeshift
Connector IDtradeshift-1.0.0

Tradeshift connector flow showing OAuth2 client credentials setup, invoice and purchase order exchange, and controlled supplier data synchronization.

When to use this connector

Use this connector when your workflow must create or retrieve invoices, purchase orders, or supplier records in Tradeshift. It is especially useful for finance automation where document state in Tradeshift should stay synchronized with ERP or procurement processes.

Configuration reference

Integration settings are stored once and reused during execution.

  • base_url (required): Tradeshift API base URL for your tenant or environment (for example https://api.tradeshift.com).
  • client_id (required): OAuth2 client ID from your Tradeshift app registration.
  • client_secret (required): OAuth2 client secret for token exchange.
  • timeout_seconds (optional): Request timeout for connector operations (default 30).

The connector obtains access tokens from {base_url}/oauth/token and calls {base_url}/api/{endpoint} with a Bearer token.

Send invoices and purchase documents

Use send for create or update operations. Provide endpoint (path after /api/), optional method (default POST), and data for the JSON request body.

const baseUrl = "https://api.example.com/api/v1";
const tenantId = "<TENANT_ID>";
const apiKey = "<API_KEY>";

async function createInvoice(integrationId: string) {
  const response = await fetch(`${baseUrl}/integrations/${encodeURIComponent(integrationId)}/execute`, {
    method: "POST",
    headers: {
      "X-API-Key": apiKey,
      "X-Tenant-ID": tenantId,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      operation: "send",
      endpoint: "invoices",
      method: "POST",
      data: {
        invoiceNumber: "INV-2026-0508",
        supplierId: "SUP-1001",
        invoiceDate: "2026-05-08",
        dueDate: "2026-06-07",
        amount: 1250.0,
        currency: "USD",
      },
    }),
  });
  if (!response.ok) throw new Error(`Request failed: ${response.status}`);
  return response.json();
}
curl -X POST "https://api.example.com/api/v1/integrations/<ENTITY_ID>/execute" \
  -H "X-API-Key: <API_KEY>" \
  -H "X-Tenant-ID: <TENANT_ID>" \
  -H "Content-Type: application/json" \
  -d '{
    "operation": "send",
    "endpoint": "invoices",
    "method": "POST",
    "data": {
      "invoiceNumber": "INV-2026-0508",
      "supplierId": "SUP-1001",
      "invoiceDate": "2026-05-08",
      "dueDate": "2026-06-07",
      "amount": 1250.0,
      "currency": "USD"
    }
  }'
{
  "success": true,
  "data": {
    "message": "Tradeshift operation completed successfully",
    "result": {
      "id": "INV-2026-0508",
      "status": "created"
    }
  }
}

Retrieve Tradeshift entities

Use receive to query invoices, purchase orders, or suppliers. Provide endpoint and optional query parameters for filtering and pagination. List responses normalize to data.items from invoices[], purchase_orders[], or a single result object.

const baseUrl = "https://api.example.com/api/v1";
const tenantId = "<TENANT_ID>";
const apiKey = "<API_KEY>";

async function listPendingInvoices(integrationId: string) {
  const response = await fetch(`${baseUrl}/integrations/${encodeURIComponent(integrationId)}/execute`, {
    method: "POST",
    headers: {
      "X-API-Key": apiKey,
      "X-Tenant-ID": tenantId,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      operation: "receive",
      endpoint: "invoices",
      query: {
        status: "Pending",
        limit: 20,
        offset: 0,
      },
    }),
  });
  if (!response.ok) throw new Error(`Request failed: ${response.status}`);
  return response.json();
}
curl -X POST "https://api.example.com/api/v1/integrations/<ENTITY_ID>/execute" \
  -H "X-API-Key: <API_KEY>" \
  -H "X-Tenant-ID: <TENANT_ID>" \
  -H "Content-Type: application/json" \
  -d '{
    "operation": "receive",
    "endpoint": "invoices",
    "query": {
      "status": "Pending",
      "limit": 20,
      "offset": 0
    }
  }'
{
  "success": true,
  "data": {
    "message": "Tradeshift data retrieved successfully",
    "invoice_count": 1,
    "items": [
      {
        "invoiceNumber": "INV-2026-0508",
        "supplierId": "SUP-1001",
        "status": "Pending"
      }
    ]
  }
}

Execute arbitrary API methods

Use execute when you need a configurable HTTP method and body against any Tradeshift /api/{endpoint} path. Provide endpoint, optional method (default GET), and body or data for write operations.

curl -X POST "https://api.example.com/api/v1/integrations/<ENTITY_ID>/execute" \
  -H "X-API-Key: <API_KEY>" \
  -H "X-Tenant-ID: <TENANT_ID>" \
  -H "Content-Type: application/json" \
  -d '{
    "operation": "execute",
    "endpoint": "purchase_orders",
    "method": "GET"
  }'

Validate connectivity

Run test before go-live and after OAuth credential changes. The connector obtains a token and calls GET /api/invoices to verify credentials and API reachability.

curl -X POST "https://api.example.com/api/v1/integrations/<ENTITY_ID>/execute" \
  -H "X-API-Key: <API_KEY>" \
  -H "X-Tenant-ID: <TENANT_ID>" \
  -H "Content-Type: application/json" \
  -d '{
    "operation": "test"
  }'
{
  "success": true,
  "data": {
    "message": "Tradeshift connection test successful",
    "details": {
      "base_url": "https://api.tradeshift.com",
      "invoices_found": 3
    }
  }
}

Operate safely in production

Most failures come from scope mismatches, token acquisition errors, schema mismatches, or rate limiting. Add retry with backoff in workflows that can receive HTTP 429 responses and keep execution IDs in logs for traceability.

Additional references

For endpoint-specific payload details and compliance guidance, review the Tradeshift developer portal and Peppol standard resources.