Tradeshift External API

REST API over the Tradeshift business commerce platform. 172 operations across accounts and branches, legal entities, taxes and validations, network connections and connection properties, document profiles, business documents and document files, attachments, quotes, requisitions, receipt advices, users and memberships, assignments, buyer-sourced documents, and document validation and clearance. JSON and XML (OASIS UBL / TSUBL) representations; OAuth 1.0a two-legged or OAuth 2.0 three-legged auth plus a required X-Tradeshift-TenantId header.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

tradeshift-external-api-openapi.yml Raw ↑
info:
  title: Tradeshift External API
  version: 1.0.0
openapi: 3.0.0
paths:
  /rest/external/accesslist/operation/{operationId}/type/{typeId}/object/{objectId}:
    parameters:
    - name: operationId
      in: path
      required: true
      schema:
        type: integer
      description: Operation id to be checked
    - name: typeId
      in: path
      required: true
      schema:
        type: integer
      description: Object's type
    - name: objectId
      in: path
      required: true
      schema:
        type: string
      description: "Object id to be checked. \nCould be any type of objects Tradeshift supports (e.g. documentId, dispatchId,\
        \ conversationId etc.)\n"
    get:
      responses:
        '204':
          description: User has access to the provided details
        '401':
          description: User do not have access to the provided details
          content:
            application/json:
              example:
                ErrorCode: Unauthorized
                Message: The user was not authorized to perform the operation: 37617bf8-4e04-41f2-bd27-9ad9153419ee/Operation(id=15,
                  name=ADMIN_ID) on 35dea17e-fdd7-46d9-88c8-c5c632ebf92b
                ErrorDetail:
                - Key: userUuid
                  Value: 37617bf8-4e04-41f2-bd27-9ad9153419ee
                - Key: securityGroupUuid
                  Value: 35dea17e-fdd7-46d9-88c8-c5c632ebf92b
                - Key: operationId
                  Value: '15'
                - Key: operationName
                  Value: ADMIN_ID
                - Key: stacktrace
                  Value: ''
                ValidationError: []
                RequestId: 92463020-1aa1-48c6-b87f-ad8b97d0599e
              schema:
                title: Tradeshift Public API 1.0 - TradeshiftException
                required:
                - ErrorCode
                - Message
                - RequestId
                type: object
                additionalProperties: false
                properties:
                  ErrorCode:
                    type: string
                  Message:
                    type: string
                  ErrorDetail:
                    type: array
                    items:
                      type: object
                      additionalProperties: false
                      properties:
                        Key:
                          type: string
                        Value:
                          type: string
                      required:
                      - Key
                      - Value
                  ValidationError:
                    type: array
                    items:
                      type: object
                  RequestId:
                    pattern: ^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$
                    description: String representation of an Universally unique identifier (UUID), version 5. See RFC 4122
                    type: string
      description: 'Check if an user identified by the tenantId and actorId is able to access the objectId of the type typeId.

        The operation provided should exist through the list of allowed operations for the role assigned to the user.

        The result takes into consideration also the DocumentAccess settings, if the app is enabled.

        '
      operationId: get-rest-external-accesslist-operation-operationid-type-typeid-object-objectid
      parameters: []
      x-annotation-dx-category: accounts-company
      summary: Check authorization
      tags:
      - dx-category--accounts-company
  /rest/external/account:
    get:
      responses:
        '200':
          description: Details about the current company account
          content:
            application/json:
              example:
                CompanyName: ELTEC Inc. mkxezemhuirw
                Country: US
                CompanyAccountId: 16e61501-2e6a-42ae-9bb3-67d1c1468056
                State: ACTIVE
                Identifiers:
                - scheme: TS:VAT
                  value: eltec.mkxezemhuirw
                AddressLines: []
                RegistrationAddressLines: []
                AcceptingDocumentProfiles: []
                LookingFor: []
                Offering: []
                PublicProfile: false
                NonuserInvoicing: false
                AutoAcceptConnections: false
                Restricted: true
                Created: '2017-12-12T14:07:43.945Z'
                Modified: '2017-12-12T14:07:44.342Z'
                AccountType: FREE
              schema:
                type: object
                properties:
                  CompanyName:
                    title: The Companyname Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  Country:
                    title: The Country Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  CompanyAccountId:
                    title: The Companyaccountid Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  State:
                    title: The State Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  Identifiers:
                    type: array
                    items:
                      type: object
                      properties:
                        scheme:
                          title: The Scheme Schema.
                          default: ''
                          description: An explanation about the purpose of this instance.
                          type: string
                        value:
                          title: The Value Schema.
                          default: ''
                          description: An explanation about the purpose of this instance.
                          type: string
                      required:
                      - scheme
                      - value
                  AddressLines:
                    type: array
                    items:
                      title: Empty Object
                      description: This accepts anything, as long as it's valid JSON.
                      type: string
                  AcceptingDocumentProfiles:
                    type: array
                    items:
                      title: Empty Object
                      description: This accepts anything, as long as it's valid JSON.
                      type: string
                  LookingFor:
                    type: array
                    items:
                      title: Empty Object
                      description: This accepts anything, as long as it's valid JSON.
                      type: string
                  Offering:
                    type: array
                    items:
                      title: Empty Object
                      description: This accepts anything, as long as it's valid JSON.
                      type: string
                  PublicProfile:
                    title: The Publicprofile Schema.
                    default: false
                    description: An explanation about the purpose of this instance.
                    type: boolean
                  NonuserInvoicing:
                    title: The Nonuserinvoicing Schema.
                    default: false
                    description: An explanation about the purpose of this instance.
                    type: boolean
                  AutoAcceptConnections:
                    title: The Autoacceptconnections Schema.
                    default: false
                    description: An explanation about the purpose of this instance.
                    type: boolean
                  Restricted:
                    title: The Restricted Schema.
                    default: false
                    description: An explanation about the purpose of this instance.
                    type: boolean
                  Created:
                    title: The Created Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  Modified:
                    title: The Modified Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  AccountType:
                    title: The Accounttype Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  LastActive:
                    title: Last Active timestamp
                    default: ''
                    description: Timestamp of the last activity of the account
                    type: string
                required:
                - CompanyName
                - Country
                - CompanyAccountId
                - State
                - Identifiers
                - AddressLines
                - AcceptingDocumentProfiles
                - LookingFor
                - Offering
                - PublicProfile
                - NonuserInvoicing
                - AutoAcceptConnections
                - Restricted
                - Created
                - Modified
                - AccountType
                - LastActive
      description: Get information about the company account that is currently being accessed.
      operationId: get-rest-external-account
      x-annotation-dx-category: accounts-company
      summary: get account info
      tags:
      - dx-category--accounts-company
    put:
      responses:
        '204':
          description: Update company information for the current company account.
        '400':
          description: Invalid company name, company account id or identifier
      description: Update company information for the current company account. Properties will not be changed using this resource.
      operationId: put-rest-external-account
      requestBody:
        content:
          text/xml:
            example: "<CompanyAccountInfo xmlns=\"http://tradeshift.com/api/public/1.0\">\n    <CompanyName>${companyName}</CompanyName>\n\
              \    <Country>US</Country>\n    <CompanyAccountId>813a3b75-a926-4e82-bd2b-a283b3b4bc6a</CompanyAccountId>\n\
              \    <State>ACTIVE</State>\n    <Identifiers>\n        <Identifier scheme=\"TS:ID\">96d47166-0abd-41c7-aae3-661ab060cb6b</Identifier>\n\
              \    </Identifiers>\n    <AddressLines>\n        <AddressLine scheme=\"buildingnumber\">1</AddressLine>\n  \
              \      <AddressLine scheme=\"city\">San Francisco</AddressLine>\n        <AddressLine scheme=\"state\">CA</AddressLine>\n\
              \        <AddressLine scheme=\"street\">test8 street</AddressLine>\n        <AddressLine scheme=\"zip\">94116</AddressLine>\n\
              \    </AddressLines>\n    <RegistrationAddressLines>\n        <RegistrationAddressLine scheme=\"buildingnumber\"\
              >Registration Building</RegistrationAddressLine>\n        <RegistrationAddressLine scheme=\"city\">Registration\
              \ City</RegistrationAddressLine>\n        <RegistrationAddressLine scheme=\"state\">Registration State</RegistrationAddressLine>\n\
              \        <RegistrationAddressLine scheme=\"street\">Registration Street</RegistrationAddressLine>\n        <RegistrationAddressLine\
              \ scheme=\"zip\">Registration Zip</RegistrationAddressLine>\n    </RegistrationAddressLines>\n    <AcceptingDocumentProfiles/>\n\
              \    <LookingFor/>\n    <Offering/>\n    <PublicProfile>false</PublicProfile>\n    <NonuserInvoicing>false</NonuserInvoicing>\n\
              \    <AutoAcceptConnections>false</AutoAcceptConnections>\n    <Restricted>true</Restricted>\n    <Created>2017-02-27T16:15:31.059-08:00</Created>\n\
              \    <Modified>2017-03-05T18:36:48.811-08:00</Modified>\n    <AccountType>FREE</AccountType>\n</CompanyAccountInfo>"
            schema:
              type: object
        required: true
      x-annotation-dx-category: accounts-company
      summary: update account info
      tags:
      - dx-category--accounts-company
  /rest/external/account/branches:
    get:
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                example:
                  numPages: '0'
                  pageId: '0'
                  itemsPerPage: '0'
                  itemCount: '0'
                  CompanyAccount: []
      description: Get listing of branches for the current company account, if any.
      operationId: get-rest-external-account-branches
      x-annotation-dx-category: accounts-branches
      summary: get branches
      tags:
      - dx-category--accounts-branches
  /rest/external/account/branches/new:
    put:
      responses:
        '204':
          description: Created a new company account and optionally user.
        '400':
          description: 'The tenant identifier proposed does already exist on the platform and no tenant nor user was created.

            '
      description: 'Creates a company account as the child of the current account using the provided data in the body of the
        PUT call. The branch will automatically be activated and no activation email will be sent to any branch users attached
        to the create request. The identifier(s) must not already exist.

        '
      operationId: put-rest-external-account-branches-new
      requestBody:
        content:
          application/json:
            example:
              User:
                Id: 0daab548-3990-41ed-b0f4-eb197e693df1
                Person:
                  Email: steve.armstrong@example.org
                ReturnUrl: https://go.tradeshift.com
                Language: en-us
                TimeZone: GMT
                Visible: true
              CompanyAccount:
                Company:
                  CompanyName: Example Inc.
                  Country: US
                  Identifier:
                  - scheme: TS:ID
                    value: f54bca78-3ac9-4843-ae4a-f6808c0ea477
              ParentCompanyAccountId: e3e1e302-ea34-416c-8236-248295ef7a8c
            schema:
              title: Tradeshift public API 1.0 - CreateBranchAccountRequest
              required:
              - User
              - CompanyAccount
              - ParentCompanyAccountId
              type: object
              additionalProperties: false
              properties:
                User:
                  type: object
                  properties:
                    Id:
                      pattern: ^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$
                      description: String representation of an Universally unique identifier (UUID), version 5. See RFC 4122
                      type: string
                  required:
                  - Id
                CompanyAccount:
                  type: object
                  properties:
                    Company:
                      type: object
                  required:
                  - Company
                From:
                  type: string
                SendActivationEmail:
                  type: boolean
                ParentCompanyAccountId:
                  pattern: ^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$
                  description: String representation of an Universally unique identifier (UUID), version 5. See RFC 4122
                  type: string
                Properties:
                  type: object
                  properties:
                    termsandconditions:
                      type: string
                  required:
                  - termsandconditions
        required: true
      x-annotation-dx-category: accounts-branches
      summary: create branch
      tags:
      - dx-category--accounts-branches
  /rest/external/account/branches/{companyId}:
    parameters:
    - name: companyId
      in: path
      required: true
      schema:
        type: string
      description: UUID identifier of company account.
    get:
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                example:
                  Id: 58a5b768-08be-48ec-a06d-6874fde8cf46
                  State: CREATED
                  Company:
                    CompanyName: null
                    Country: null
                    Created: null
                    Modified: null
                    Identifier: null
                    AddressLine: null
                    Phone: null
                    Fax: null
                    LegalCompanyStructure: null
                    AddressAvailable: null
                    RegistrationAddress: null
                  Url: str
                  Description: str
                  ShortUrl: str
                  PublicProfile: 'false'
                  NonuserInvoicing: 'false'
                  AutoAcceptConnections: 'false'
                  Restricted: 'false'
                  Property: null
                  Offering: null
                  LookingFor: null
                  Industry: ACADEMIA
                  OtherIndustry: str
                  OwnershipType: SOLE
                  Size: ONE
                  NumConnections: '0'
                  PrimaryBankAccount:
                    channelCode: str
                    branchId: str
                    paymentNote: str
                    institutionId: str
                    institutionName: str
                    branchName: str
                    value: str
                    beneficiaryName: str
                    beneficiaryBankAddress: str
                    accountTypeCode: str
                  AccountType: FREE
                  RegisteredGLI: []
        '404':
          description: Specific branch isn't found or isn't a branch of the current parent.
      description: Get specific branch for the current parent
      operationId: get-rest-external-account-branches-companyid
      x-annotation-dx-category: accounts-branches
      summary: get branch
      tags:
      - dx-category--accounts-branches
  /rest/external/account/info:
    get:
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                example:
                  CompanyName: str
                  Country: str
                  CompanyAccountId: 58a5b768-08be-48ec-a06d-6874fde8cf46
                  State: CREATED
                  Url: str
                  Description: str
                  Identifiers: []
                  AddressLines: []
                  AcceptingDocumentProfiles: []
                  Properties: []
                  LookingFor: null
                  Offering: null
                  LogoURL: str
                  BackgroundURL: str
                  PublicProfile: 'false'
                  NonuserInvoicing: 'false'
                  AutoAcceptConnections: 'false'
                  Restricted: 'false'
                  NumConnections: '0'
                  Industry: ACADEMIA
                  OtherIndustry: str
                  OwnershipType: SOLE
                  Size: ONE
                  Created: '2013-07-23T07:35:16.000Z'
                  Modified: '2013-07-23T07:35:16.000Z'
                  Phone: str
                  Fax: str
                  ShortUrl: str
                  AccountType: FREE
                  LastActive: '2013-07-23T07:35:16.000Z'
      description: Returns information about the company account that is currently being accessed.
      operationId: get-rest-external-account-info
      x-annotation-dx-category: accounts-company
      summary: get account info
      tags:
      - dx-category--accounts-company
    put:
      responses:
        '204':
          description: ''
      description: Update company information for the current company account. Properties will not be changed using this resource.
      operationId: put-rest-external-account-info
      requestBody:
        content:
          application/json:
            example:
              CompanyName: str
              Country: str
              CompanyAccountId: 58a5b768-08be-48ec-a06d-6874fde8cf46
              State: CREATED
              Url: str
              Description: str
              Identifiers: []
              AddressLines: []
              AcceptingDocumentProfiles: []
              Properties: []
              LookingFor: null
              Offering: null
              LogoURL: str
              BackgroundURL: str
              PublicProfile: 'false'
              NonuserInvoicing: 'false'
              AutoAcceptConnections: 'false'
              Restricted: 'false'
              NumConnections: '0'
              Industry: ACADEMIA
              OtherIndustry: str
              OwnershipType: SOLE
              Size: ONE
              Created: '2013-07-23T07:35:16.000Z'
              Modified: '2013-07-23T07:35:16.000Z'
              Phone: str
              Fax: str
              ShortUrl: str
              AccountType: FREE
              LastActive: '2013-07-23T07:35:16.000Z'
            schema:
              type: string
        required: true
      x-annotation-dx-category: accounts-company
      summary: update account info
      tags:
      - dx-category--accounts-company
  /rest/external/account/info/user:
    get:
      responses:
        '200':
          description: ''
          content:
            application/json:
              example:
                Id: 413a8273-d83d-42e0-9942-c6959505079c
                CompanyName: ELTEC Inc. mfbqdqmyyyep
                Username: steve.armstrong@mfbqdqmyyyep.eltec.test.ts.sv
                Language: en-us
                TimeZone: America/Los_Angeles
                Memberships:
                - UserId: ff028804-9fc4-4894-ad03-3b27dcd5458c
                  GroupId: 7066241f-e414-493d-acae-a3f98f0432cc
                  Role: a6a3edcd-00d9-427c-bf03-4ef0112ba16d
                Created: '2017-12-12T14:26:02.339Z'
                State: ACTIVE
                Type: PERSON
                FirstName: Steve
                LastName: Armstrong
                Visible: true
              schema:
                title: Tradeshift Public API 1.0 - UserAccountList
                type: object
                properties:
                  Id:
                    title: The Id Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  CompanyName:
                    title: The Companyname Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  Username:
                    title: The Username Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  Language:
                    title: The Language Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  TimeZone:
                    title: The Timezone Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  Memberships:
                    type: array
                    items:
                      type: object
                      properties:
                        UserId:
                          title: The Userid Schema.
                          default: ''
                          description: An explanation about the purpose of this instance.
                          type: string
                        GroupId:
                          title: The Groupid Schema.
                          default: ''
                          description: An explanation about the purpose of this instance.
                          type: string
                        Role:
                          title: The Role Schema.
                          default: ''
                          description: An explanation about the purpose of this instance.
                          type: string
                      required:
                      - UserId
                      - GroupId
                      - Role
                  Created:
                    title: The Created Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  State:
                    title: The State Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  Type:
                    title: The Type Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  FirstName:
                    title: The Firstname Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  LastName:
                    title: The Lastname Schema.
                    default: ''
                    description: An explanation about the purpose of this instance.
                    type: string
                  Visible:
                    title: The Visible Schema.
                    default: false
                    description: An explanation about the purpose of this instance.
                    type: boolean
                required:
                - Id
                - CompanyName
                - Username
                - Language
                - TimeZone
                - Memberships
                - Created
                - State
                - Type
                - FirstName
                - LastName
                - Visible
      description: Returns information about the user account currently accessing the system. Be aware that under normal circumstances,
        this will be a special app user, not the user who has installed an app.
      operationId: get-rest-external-account-info-user
      x-annotation-dx-category: users-accounts
      summary: get user info
      tags:
      - dx-category--users-accounts
  /rest/external/account/members/{userId}:
    parameters:
    - name: userId
      in: path
      required: true
      schema:
        type: string
      description: UUID identifier of user account.
    delete:
      responses:
        '204':
          description: ''
      description: Remove a member from the current company account. Users who belong to the account (have the account's CompanyAccountId)
        cannot be removed.
      operationId: delete-rest-external-account-members-userid
      x-annotation-dx-category: users-memberships
      summary: remove user
      tags:
      - dx-category--users-memberships
  /rest/external/account/parent:
    get:
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                example:
                  CompanyName: str
                  Country: str
                  CompanyAccountId: 58a5b768-08be-48ec-a06d-6874fde8cf46
                  State: CREATED
                  Url: str
                  Description: str
                  Identifiers: []
                  AddressLines: []
                  AcceptingDocumentProfiles: []
                  Properties: []
                  LookingFor: null
                  Offering: null
                  LogoURL: str
                  BackgroundURL: str
                  PublicProfile: 'false'
                  NonuserInvoicing: 'false'
                  AutoAcceptConnections: 'false'
                  Restricted: 'false'
                  NumConnections: '0'
                  Industry: ACADEMIA
                  OtherIndustry: str
                  OwnershipType: SOLE
                  Size: ONE
                  Created: '2013-07-23T07:35:16.000Z'
                  Modified: '2013-07-23T07:35:16.000Z'
                  Phone: str
                  Fax: str
                  ShortUrl: str
                  AccountType: FREE
                  LastActive: '2013-07-23T07:35:16.000Z'
        '404':
          description: ''
      description: Returns information about the parent account of the current account (the parent is the account of which
        the current account is a branch).
      operationId: get-rest-external-account-parent
      x-annotation-dx-category: accounts-branches
      summary: get parent
      tags:
      - dx-category--accounts-branches
  /rest/external/account/public/users:
    get:
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                example:
                  itemsPerPage: 25
                  itemCount: 1
                  numPages: 1
                  pageId: 0
                  UserAccounts:
                  - Id: e7eb4520-34f6-48c3-8982-024366454ba4
                    CompanyAccountId: b289b086-c96f-4b09-a0e9-300631948601
                    CompanyName: ELTEC Inc. jvuvlsxwdzlh
                    Username: steve.armstrong@jvuvlsxwdzlh.eltec.test.ts.sv
                    Language: en-us
                    TimeZone: America/Los_Angeles
                    Memberships:
                    - UserId: e7eb4520-34f6-48c3-8982-024366454ba4
                      GroupId: b289b086-c96f-4b09-a0e9-300631948601
                      Role: a6a3edcd-00d9-427c-bf03-4ef0112ba16d
                    Created: '2017-04-04T10:58:54.585+02:00'
                    State: ACTIVE
                    Type: PERSON
                    FirstName: Steve
                    LastName: Armstrong
                    Visible: true
                  PrimaryUser: e7eb4520-34f6-48c3-8982-024366454ba4
        '404':
          description: ''
      description: Searches visible users in all companies (not only the current account) for the query string.
      operationId: get-rest-external-account-public-users
      parameters:
      - name: q
        in: query
        required: true
        description: User to search for
        schema:
          type: string
      - name: limit
        in: query
        required: true
        description: Page size per query
        schema:
          default: 10
          type: integer
      - name: page
        in: query
        description: Page number of the query
        schema:
          default: 0
          type: integer
      x-annotation-dx-category: users-accounts
      summary: find public users
      tags:
      - dx-category--users-accounts
  /rest/external/account/taxes:
    get:
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                example:
                  StackedTaxes: []
                  DefaultTaxIndex: '0'
        '404':
          description: ''
      description: Get tax categories. Lists the company taxes for the requesting context, if connectionID is specified it
        will also include the default tax from the connection properties.
      operationId: get-rest-external-account-taxes
      parameters:
      - name: connectionID
        in: query
        required: true
        description: Connection to get tax categories for.
        schema:
          type: string
      x-annotation-dx-category: accounts-taxes
      summary: get taxes
      tags:
      - dx-category--accounts-taxes
    put:
      responses:
        '204':
          description: ''
        '404':
          description: ''
      description: Update tax categories.
      operationId: put-rest-external-acco

# --- truncated at 32 KB (628 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/tradeshift/refs/heads/main/openapi/tradeshift-external-api-openapi.yml