Skip to main content

Sync suppliers

The sync suppliers API is a single API endpoint that you can use to send supplier data into TRAEDE.

Creating vs updating suppliers

TRAEDE will use supplier number to determine if a supplier already exists and we are trying to create a new supplier or updating an existing one. For instance, if you send a supplier with supplier number 1000 TRAEDE will look for an existing one. If one exists this supplier will be used. If one does not exist it will be created.

Updating supplier numbers of existing suppliers

Due to the above sync model you are not able to update supplier numbers using the supplier sync API. This is because if you pass a new supplier number, then it will be used to create a new supplier instead of updating the one you are trying to update.

Deleting suppliers

You can delete suppliers by passing along delete: true to the supplier data. Note that suppliers with production orders and other data cannot be deleted. TRAEDE will return an error response if the delete was unsuccessful for any reason

POST /production/suppliers/sync

Endpoint: POST /production/suppliers/sync

ParameterRequiredDefaultDescription
suppliers.*YesAn array of suppliers to update

Suppliers

ParameterData typeRequiredDefaultDescription
supplier_numberstringYesThe item number of the supplier. We use this to determine if a supplier already exists and we are updating it or we are creating a new one
namestringIf new supplierThe name of the supplier
currencystringIf new supplierWhat is the currency of the supplier
activebooleantrueShould this supplier be active for purchasing?
addresses_sync_modestringIf addresses key existsShould either be replace to replace existing addresses, or append to append to existing addresses
addresses_sync_keystringIf addresses key existsShould either be address_title or remote_erp_id. This will determine whether to use title field or remote_erp_id field to determine if you are creating a new address or updating an existing one
addressesArray<Address>Addresses of the supplier

Addresses

ParameterData typeRequiredDefaultDescription
titlestringYesThe title of the address. This is for internal use, so you know the difference between addresses. In TRAEDE we use Primary address for invoice address, and Shipping address for delivery address. But you can use whatever you want
namestringYesThis is the name of the receiver on the address. So this is the "top line" in the address. For B2B customers this is typically the name of the company, and for B2C customers this is typically the name of the receiver
addressstringYesThis the the address line
address_2stringAn optional extra line for the address
zipstringYesZip code
citystringYesCity
regionstringState, region, etc
countrystringYesCountry code must be a 2-letter code like DK, US, GB

Example

POST /production/suppliers/sync

{
"suppliers": [
{
"supplier_number": "1000",
"name": "A supplier",
"currency": "USD"
}
]
}