This article lists the ToolWatch API requests for vendors: Create, Retrieve, and Retrieve List. Every request needs an authorization token. To get one, see ToolWatch API: Authorization.
Create
Request
URI
https://api.{cluster}.toolwatch.net/vendorsHttp Method
POST
Headers
Authorization: {token}
Request Body
Field | Type | Required | Description |
Number | string | Yes | Vendor number. Max 15 characters. |
Name | string | Yes | Vendor name. Max 50 characters. |
Inactive | boolean | No | Whether the vendor is inactive. |
Url | string | No | Vendor URL. |
Notes | string | No | Free-form notes. |
ContactName | string | No | Contact name. |
ContactEmail | string | No | Contact email. |
ContactPhone | string | No | Contact phone. |
ContactMobile | string | No | Contact mobile. |
ContactFax | string | No | Contact fax. |
AccountNumber | string | No | Account number. |
ShippingMethod | guid | No | Shipping method id. |
DiscrepancyTolerance | decimal | No | Discrepancy tolerance. |
Response
201 Created
The response header contains the URI for the newly created vendor.
Location: https://api.{cluster}.toolwatch.net/vendors/{id}400 Bad Request
Triggered when field level validation fails.
Response body will contain validation message
[
{
"PropertyName": "Number",
"Message": "Please provide a vendor number.",
"AttemptedValue": ""
}
]
Retrieve
Request
URI
https://api.{cluster}.toolwatch.net/vendors/{id}Allowable querystring parameters
Parameter | Description |
columns | Comma-separated list of properties to return. |
Http Method
GET
Headers
Authorization: {token}
Request Body
Not allowed for GET
Response
200 Ok
By default every property is returned. Use the columns querystring parameter to limit the response to specific properties.
Field | Type | Description |
Id | guid | Unique identifier. |
Number | string | Vendor number. |
Name | string | Vendor name. |
Inactive | boolean | Whether the vendor is inactive. |
Url | string | Vendor URL. |
Notes | string | Free-form notes. |
ContactName | string | Contact name. |
ContactEmail | string | Contact email. |
ContactPhone | string | Contact phone. |
ContactMobile | string | Contact mobile. |
ContactFax | string | Contact fax. |
AccountNumber | string | Account number. |
ShippingMethod | guid | Shipping method id. |
DiscrepancyTolerance | decimal | Discrepancy tolerance. |
Example response body:
{
"Id": "{id}",
"Number": "Vendor Number",
"Name": "Vendor Name",
"Url": "https://example.com",
"AccountNumber": "12345",
"DiscrepancyTolerance": 0.05
}404 Not Found
Triggered when id parameter is not a valid guid or no matching record was found.
Response body will contain error message
{id} is not a valid vendor id.Retrieve List
Request
URI
https://api.{cluster}.toolwatch.net/vendorsAllowable querystring parameters
Parameter | Description |
columns | Comma-separated list of properties to return. |
number | Filter by vendor number. |
Http Method
GET
Headers
Authorization: {token}
Request Body
Not allowed for GET
Response
200 Ok
By default every property is returned. Use the columns querystring parameter to limit the response to specific properties.
Field | Type | Description |
Id | guid | Unique identifier. |
Number | string | Vendor number. |
Name | string | Vendor name. |
Inactive | boolean | Whether the vendor is inactive. |
Url | string | Vendor URL. |
Notes | string | Free-form notes. |
ContactName | string | Contact name. |
ContactEmail | string | Contact email. |
ContactPhone | string | Contact phone. |
ContactMobile | string | Contact mobile. |
ContactFax | string | Contact fax. |
AccountNumber | string | Account number. |
ShippingMethod | guid | Shipping method id. |
DiscrepancyTolerance | decimal | Discrepancy tolerance. |
Example response body:
[
{
"Id": "849197e3-6cc4-4150-ae71-3f2fc1fbc53d",
"Number": "Vendor Number 1",
"Name": "Vendor Name 1",
"Url": "https://example.com",
"AccountNumber": "12345",
"DiscrepancyTolerance": 0.05
},
{
"Id": "cc09dbb0-6cc4-4150-ae71-3f2fc1fbc53d",
"Number": "Vendor Number 2",
"Name": "Vendor Name 2",
"Url": "https://example.com",
"AccountNumber": "67890",
"DiscrepancyTolerance": 0.10
}
]
404 Not Found
Triggered when field parameters in querystring are not allowed.
Response body will contain error message
{"Message":"Criteria is invalid","Type":"Exception"}