Create a supplier
POST
/suppliers
const url = 'https://app.buildtrace.eu/api/suppliers';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"code":"example","name":"example","contact":"example","notes":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.buildtrace.eu/api/suppliers \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "code": "example", "name": "example", "contact": "example", "notes": "example" }'Required scope: suppliers:write.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
code
required
string
name
required
string
contact
string
notes
string
Example generated
{ "code": "example", "name": "example", "contact": "example", "notes": "example"}Responses
Section titled “Responses”Created
Media typeapplication/json
object
id
required
string format: uuid
code
required
string
name
required
string
contact
string
notes
string
active
required
boolean
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "code": "example", "name": "example", "contact": "example", "notes": "example", "active": true}Bad request
Media typeapplication/json
object
error
required
string
Example generated
{ "error": "example"}Unauthorized
A supplier with this code already exists in the workspace
Media typeapplication/json
object
error
required
string
Example generated
{ "error": "example"}