Skip to main content
POST
/
suppliers
/
sap
Lieferanten aus SAP-System erstellen oder aktualisieren
curl --request POST \
  --url https://api.comstruct.com/v1/suppliers/sap \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
[
  {
    "number": "EXTERNAL-09092",
    "title": "Beispiel GmbH-8",
    "legal_uid": "D456789900022202",
    "country_code": "US",
    "comment": "Bevorzugter Kontakt per E-Mail",
    "payment_term": "90T",
    "wth_tax_code": "90",
    "bank_details": [
      {
        "number": "9999912",
        "iban": "DE89370400440532013000"
      },
      {
        "external_id": "8881112",
        "iban": "GB33BUKB20201555555555"
      }
    ],
    "address": {
      "address": "Müllerstraße 1",
      "city": "Berlin",
      "zip": "10115",
      "country_code": "DE"
    }
  }
]
'
{
  "message": "Supplier data received successfully"
}

Documentation Index

Fetch the complete documentation index at: https://developer.comstruct.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Use this endpoint to sync suppliers from SAP into comstruct. The request body is always an array, so a single supplier and batches are handled through the same POST call. When number is present, comstruct stores it as the supplier external_id. If a supplier with the same external_id already exists for the customer, that supplier is updated.
Send number for every SAP supplier. The field is not required by schema validation, but it is required for idempotent SAP syncs and later lookups.

Permissions

ScopeTenant type
suppliers:writeCustomer API key
The API key must be linked to a customer.

Headers

HeaderRequiredDescription
x-api-keyYesAPI key with scope suppliers:write
Content-TypeYesapplication/json

Request body

The body must be a JSON array of suppliers.

Supplier fields

FieldRequiredDescription
titleYesSupplier name
numberNoSAP supplier number; mapped to external_id and used for upserts
legal_uidNoVAT ID or tax ID
country_codeNoISO 3166-1 alpha-2 country code
commentNoFree-text supplier comment
payment_termNoPayment term key; must exist in the comstruct customer tenant
wth_tax_codeNoWithholding tax code; defaults to 00
bank_detailsNoSupplier bank details
addressNoSupplier address

Bank details (bank_details[])

FieldRequiredDescription
ibanNoValid IBAN; entries without IBAN are ignored
numberNoExternal bank account number; preferred as the stored bank ID
external_idNoAlternative external ID when number is not present

Address (address)

FieldRequiredDescription
addressNoStreet and house number
cityNoCity
zipNoPostal code
country_codeNoISO 3166-1 alpha-2 country code

Example

curl -X POST "https://api.comstruct.com/v1/suppliers/sap" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "number": "SAP-SUP-001",
      "title": "Acme Supplies GmbH",
      "legal_uid": "DE123456789",
      "country_code": "DE",
      "comment": "Preferred contact by email",
      "payment_term": "30T",
      "wth_tax_code": "00",
      "bank_details": [
        {
          "number": "BANK-001",
          "iban": "DE89370400440532013000"
        }
      ],
      "address": {
        "address": "Example Street 1",
        "city": "Berlin",
        "zip": "10115",
        "country_code": "DE"
      }
    }
  ]'

Behavior

  • number is stored as external_id; existing suppliers with the same external_id and customer are updated.
  • On conflicts, only external_id, legal_uid, country_code, withholding_tax_code, payment_term_id, title, comment, address, city, and zip are updated.
  • payment_term is resolved against the customer’s payment terms. Unknown values return 400.
  • If wth_tax_code is omitted, comstruct stores the default value 00.
  • Bank details are merged by IBAN, supplier, and tenant; on conflicts, the bank detail external ID is updated.

Response codes

CodeDescription
200Supplier data processed successfully
400Invalid body, validation error, or unknown payment term
401Unauthorized — API key is not linked to a customer
403Forbidden — missing suppliers:write scope
500Internal server error

Authorizations

X-API-Key
string
header
required

API-Schlüssel zur Authentifizierung. Kontaktieren Sie Ihren Customer Success Manager, um einen API-Schlüssel zu erhalten.

Jeder Endpunkt erfordert spezifische Berechtigungen (Scopes); die erforderlichen Scopes werden pro Endpunkt angezeigt.

Body

application/json
title
string
required

Lieferantenname/Titel

Example:

"Beispiel GmbH-8"

number
string

Lieferantennummer aus SAP; wird als external_id gespeichert und für Upserts verwendet

Example:

"EXTERNAL-09092"

Optionale Umsatzsteuer-ID

Example:

"D456789900022202"

country_code
string

ISO 3166-1 alpha-2 Ländercode

Example:

"US"

comment
string

Freitext-Kommentar zum Lieferanten

Example:

"Bevorzugter Kontakt per E-Mail"

payment_term
string

Optionaler SAP-Zahlungsbedingungsschlüssel; muss, falls angegeben, im comstruct-Mandanten existieren

Example:

"90T"

wth_tax_code
string

Optionaler Quellensteuercode

Example:

"90"

bank_details
object[]

Optionale Bankverbindungen

address
object

Response

Lieferantendaten erfolgreich empfangen

message
string
Example:

"Supplier data received successfully"