Ir al contenido

Vendors

Esta página aún no está disponible en tu idioma.

Vendors in BenchKey are your parts suppliers and distributors. This API manages supplier contact details and returns stored integration settings. MobileSentrix order tracking isn’t available for your shop yet. We’re waiting on MobileSentrix to approve connections for more shops.

{
"object": "vendor",
"id": 12,
"name": "Parts Depot Inc.",
"contact_name": "Alex Rivera",
"email": "orders@partsdepot.example.com",
"phone": "800-555-0199",
"website": "https://partsdepot.example.com",
"address": "4501 Industrial Blvd, Austin, TX 78745",
"domain": "partsdepot.example.com",
"notes": "Net-30 terms. Preferred for LCD panels.",
"active": true,
"api_configured": false,
"api_adapter": null,
"created_at": "2024-06-10T18:30:00.000Z"
}
FieldTypeDescription
idintegerUnique vendor ID
namestringVendor / supplier name
contact_namestring|nullPrimary contact person
emailstring|nullContact email address
phonestring|nullContact phone number
websitestring|nullVendor website URL
addressstring|nullMailing or warehouse address
domainstring|nullSupplier email domain
notesstring|nullInternal notes about this vendor
activebooleanWhether this vendor is active
api_configuredbooleanWhether a supplier API integration is configured
api_adapterstring|nullSupplier API adapter key, if configured
created_atstringISO-8601 timestamp of when the vendor was created

GET /api/v1/vendors

Returns a cursor-paginated list of vendors ordered by ID ascending.

Scope required: vendors.read

ParameterTypeDescription
qstringSearch by name or domain (partial match)
activebooleanFilter by active status. Accepts true, false, 1, or 0 only, any other value returns 400 invalid_param
limitintegerPage size, 1–100 (default: 20)
cursorstringOpaque cursor from a previous response’s next_cursor
Terminal window
curl "https://app.benchkey.com/api/v1/vendors?limit=10&active=true" \
-H "Authorization: Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa"
const res = await fetch(
"https://app.benchkey.com/api/v1/vendors?limit=10&active=true",
{ headers: { Authorization: "Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa" } }
);
const { data, has_more, next_cursor } = await res.json();
{
"object": "list",
"data": [
{
"object": "vendor",
"id": 12,
"name": "Parts Depot Inc.",
"contact_name": "Alex Rivera",
"email": "orders@partsdepot.example.com",
"phone": "800-555-0199",
"website": "https://partsdepot.example.com",
"address": "4501 Industrial Blvd, Austin, TX 78745",
"domain": "partsdepot.example.com",
"notes": "Net-30 terms. Preferred for LCD panels.",
"active": true,
"api_configured": false,
"api_adapter": null,
"created_at": "2024-06-10T18:30:00.000Z"
}
],
"has_more": false,
"next_cursor": null
}

See Pagination for how to page through results.


GET /api/v1/vendors/:id

Returns a single vendor by its integer ID.

Scope required: vendors.read

Terminal window
curl "https://app.benchkey.com/api/v1/vendors/12" \
-H "Authorization: Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa"
const res = await fetch(
"https://app.benchkey.com/api/v1/vendors/12",
{ headers: { Authorization: "Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa" } }
);
const vendor = await res.json();

Returns the vendor object. Returns 404 if no vendor with that ID exists.


POST /api/v1/vendors

Creates a new vendor in your supplier catalog.

Scope required: vendors.write

FieldRequiredMax lengthDescription
nameyes200 charsVendor / supplier name
contact_nameno200 charsPrimary contact person
emailno320 charsContact email address
phoneno50 charsContact phone number
websiteno500 charsVendor website URL
addressno500 charsMailing or warehouse address
domainno255 charsSupplier email domain (e.g. "partsdepot.example.com")
notesno5000 charsInternal notes

All optional string fields must be strings if supplied (not numbers or booleans); fields exceeding their max length return 400 invalid_field. The email field is validated as a proper email address, invalid addresses return 400 invalid_field.

Terminal window
curl -X POST https://app.benchkey.com/api/v1/vendors \
-H "Authorization: Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa" \
-H "Content-Type: application/json" \
-d '{
"name": "Parts Depot Inc.",
"contact_name": "Alex Rivera",
"email": "orders@partsdepot.example.com",
"phone": "800-555-0199",
"website": "https://partsdepot.example.com",
"address": "4501 Industrial Blvd, Austin, TX 78745",
"domain": "partsdepot.example.com",
"notes": "Net-30 terms. Preferred for LCD panels."
}'
const res = await fetch("https://app.benchkey.com/api/v1/vendors", {
method: "POST",
headers: {
Authorization: "Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Parts Depot Inc.",
contact_name: "Alex Rivera",
email: "orders@partsdepot.example.com",
phone: "800-555-0199",
website: "https://partsdepot.example.com",
address: "4501 Industrial Blvd, Austin, TX 78745",
domain: "partsdepot.example.com",
notes: "Net-30 terms. Preferred for LCD panels.",
}),
});
const vendor = await res.json(); // HTTP 201

Returns the vendor object with HTTP 201.


PATCH /api/v1/vendors/:id

Updates one or more fields on an existing vendor. Only fields present in the request body are changed.

Scope required: vendors.write

At least one of the following fields must be included. Length limits and string-type requirements are the same as for Create. Sending a field that is not in this list returns 400 invalid_field.

FieldMax lengthDescription
name200 charsVendor / supplier name (cannot be empty)
contact_name200 charsPrimary contact person
email320 charsContact email address
phone50 charsContact phone number
website500 charsVendor website URL
address500 charsMailing or warehouse address
domain255 charsSupplier email domain
notes5000 charsInternal notes
Terminal window
curl -X PATCH "https://app.benchkey.com/api/v1/vendors/12" \
-H "Authorization: Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa" \
-H "Content-Type: application/json" \
-d '{ "notes": "Net-15 terms as of Q3. Preferred for screens." }'
const res = await fetch("https://app.benchkey.com/api/v1/vendors/12", {
method: "PATCH",
headers: {
Authorization: "Bearer bk_live_01J8X4_kvWz9nP3mRqTs7uYeBfGhDjLa",
"Content-Type": "application/json",
},
body: JSON.stringify({ notes: "Net-15 terms as of Q3. Preferred for screens." }),
});
const vendor = await res.json();

Returns the updated vendor object.


HTTP statusCodeMeaning
400invalid_queryA list filter parameter was supplied as an array or object instead of a single scalar value
400invalid_paramactive filter value is not a recognized boolean (true, false, 1, or 0)
400invalid_idThe :id is not a positive integer
400missing_fieldRequired field name is absent or empty
400invalid_fieldA string field exceeds its max length, is not a string, email is not a valid email address, or PATCH included an unrecognized field (active, api_adapter, etc. are not patchable)
400nothing_to_updatePATCH body contains no recognized fields
404not_foundNo vendor with that ID exists
422create_failedVendor could not be created (internal route error)
422update_failedVendor could not be updated (internal route error)
403insufficient_scopeAPI key lacks vendors.read or vendors.write

See Errors for the full error envelope format.

Estado del sistema