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
Parameter | Required | Default | Description |
---|---|---|---|
suppliers.* | Yes | An array of suppliers to update |
Suppliers
Parameter | Data type | Required | Default | Description |
---|---|---|---|---|
supplier_number | string | Yes | The 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 | |
name | string | If new supplier | The name of the supplier | |
currency | string | If new supplier | What is the currency of the supplier | |
active | boolean | true | Should this supplier be active for purchasing? | |
addresses_sync_mode | string | If addresses key exists | Should either be replace to replace existing addresses, or append to append to existing addresses | |
addresses_sync_key | string | If addresses key exists | Should 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 | |
addresses | Array<Address> | Addresses of the supplier |
Addresses
Parameter | Data type | Required | Default | Description |
---|---|---|---|---|
title | string | Yes | The 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 | |
name | string | Yes | This 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 | |
address | string | Yes | This the the address line | |
address_2 | string | An optional extra line for the address | ||
zip | string | Yes | Zip code | |
city | string | Yes | City | |
region | string | State, region, etc | ||
country | string | Yes | Country 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"
}
]
}