---
layout: integration
title: OAuth with Tradeshift
description: Authenticate users with an existing Tradeshift account
date: 2026-11-06
featured: false
isPartner: true
isNew: true
cover: /images/integrations/oauth-tradeshift/cover.avif
category: auth
product:
    vendor: Tradeshift
    description: "Tradeshift is a business commerce network where buyers and suppliers exchange e-invoices, purchase orders, and payments."
platform:
    - 'Self-hosted'
    - 'Cloud'
---

Tradeshift is a business commerce network where buyers and suppliers exchange e-invoices, purchase orders, and payments. Developers build apps for companies on the Tradeshift network, and Tradeshift accounts can sign users in to those apps over OAuth 2.0.

# How does the integration work?

You can use the Tradeshift OAuth adapter in Appwrite Auth for user authentication and management. This can be convenient for users because they can start using your app without creating a new account, and it suits procurement and invoicing tools for companies that already trade on Tradeshift.

Appwrite requests the `openid` and `offline` scopes and reads the user's ID, name, and email address from Tradeshift's API. Tradeshift doesn't report whether the email address is verified, so Appwrite stores it as unverified. If another user in your project already has the same address, Appwrite redirects to your failure URL instead of signing in to that account. To connect Tradeshift to an existing account, have the user sign in first and then start `createOAuth2Session` from the browser, which links Tradeshift as a new [identity](/docs/products/auth/identities).

Appwrite has two Tradeshift providers. **Tradeshift** signs users in through Tradeshift's production API at `api.tradeshift.com`, and **Tradeshift Sandbox** uses the sandbox API at `api-sandbox.tradeshift.com`, so you can test with sandbox accounts first.

# How to implement

To implement the Tradeshift OAuth adapter in Appwrite Auth, there are several steps you must complete:

## Step 1: Create a Tradeshift app with OAuth2 credentials

First, sign in to Tradeshift, or to the Tradeshift sandbox while you test, and create an app with Tradeshift's developer tools. Follow the [Tradeshift Developer Center](https://developers.tradeshift.com/docs/api) for the current steps. Configure the app's OAuth2 settings and save its **OAuth2 Client ID** and **OAuth2 Client Secret**. You will set the app's redirect URI in the next step.

## Step 2: Add the Tradeshift OAuth adapter to your Appwrite project

For this step, you must [create an account on Appwrite Cloud](/sign-up) or [self-host Appwrite](/docs/advanced/self-hosting) if you haven't already. In your Appwrite project, head over to the **Auth** page, open the **Settings** tab, and click **Tradeshift** under the **OAuth2 Providers** section. For a sandbox app, click **Tradeshift Sandbox** instead.

Enter the **OAuth2 Client ID** and **OAuth2 Client Secret** you saved from Tradeshift, turn the provider on, and click **Update**.

Copy the **Redirect URI** shown in the provider settings. It follows this format:

```text
https://<REGION>.cloud.appwrite.io/v1/account/sessions/oauth2/callback/tradeshift/<PROJECT_ID>
```

The URI starts with the API endpoint your app uses, so on self-hosted Appwrite it starts with your own domain. The **Tradeshift Sandbox** provider has its own URI, ending in `/tradeshiftBox/<PROJECT_ID>`. Always copy the exact value from the Console. Back in Tradeshift, set this URI as your app's OAuth2 redirect URI.

When Appwrite runs on `localhost`, it sends Tradeshift `127.0.0.1` in the redirect URI instead, so register the URI with `127.0.0.1` in that case.

## Step 3: Test the provider

Follow the [OAuth 2 login](/docs/products/auth/oauth2#init) flow to test your provider. Pass `OAuthProvider.Tradeshift` as the provider, or `OAuthProvider.TradeshiftBox` for a sandbox app, when you call `createOAuth2Session` from a client app or `createOAuth2Token` from a server. Add your app's domain as a platform in your Appwrite project so Appwrite accepts your `success` and `failure` URLs.

# Read more about Tradeshift and Appwrite Auth

If you would like to learn more about Tradeshift and Appwrite Auth, we have some resources that you should visit:

- [Tradeshift Developer Center](https://developers.tradeshift.com/docs/api)
- [Implement OAuth login in your apps using Appwrite Auth](/docs/products/auth/oauth2)
- [Manage linked accounts with Identities](/docs/products/auth/identities)
- [Appwrite Auth API reference](/docs/references/cloud/client-web/account)
