/create-vendor/
Purpose
Allows users to create a vendor and associate that vendor to a client. If the DebtorKey variable matches a vendor already in the system; the sub-vendor information will be updated. If there is no matching DebtorKey a master vendor will be created and associated to the user.
Header Information
The following Authorization keys need to be added to any API call header.
Auth-FactorID: an ID provided by FactorCloud to the Factor who owns the instance of FactorCloud.
Auth-SystemKey: A Key to Identify the specific system.
Auth-APIKey: An API password.
HTTP Methods
Accepts POST requests.
URI
/api_factor/create-vendor/
Body Information
The body is a JSON Object with the following paramaters:
Main Schedule:
Variable Name |
Type |
Required |
Purpose |
ClientKey |
String |
Y |
Unique Identifier for a client in system. |
DebtorKey |
String |
Y |
Unique Identifier for a vendor in system, if this vendor key exists the sub-vendor information for the client will be updated. Otherwise a new vendor will be created. |
CompCode |
String |
|
Unique Identifier for a company; if a duplicate or no comp-code is given in the request, a new one will be generated. |
Name |
String |
Y |
The name of the vendor. |
Address1 |
String |
|
The primary address of the vendor |
Address2 |
String |
|
Additional address information, e.g. suite number |
City |
String |
|
The city where the vendor is located. |
State |
String |
|
The state where the vendor is located. State code must be used, e.g. “KY”, “NY”, or “BC” (Canadian) |
Zipcode |
String |
|
The zip code where the vendor is located. May be in American, Mexican, or Canadian format depending on country. |
Country |
String |
|
Which Country the vendor is based, can be either the United States “USA”, Mexico “MEX”, or Canada “CAN” |
Phone |
String |
|
The vendor’s phone number, may be in formats ###-###-####, ##########, or (###) ###-#### |
Fax |
String |
|
The vendor’s fax number, may be in formats ###-###-####, ##########, or (###) ###-#### |
Email |
String |
|
The vendor’s email address: this address will be used to send invoice information and NOAs to the client. |
McNumber |
String |
|
The vendor’s Motor Carrier Number. |
DOTNumber |
String |
|
The vendor’s USDOT Number. |
Expected Return
An echo JSON object with the in-system information, this may be different then the information in the API call; and reflects the formatting applied to it when entered into the database.
Curl Example
Request:
<<<<<<< HEAD
curl -H 'Auth-FactorId: FACTORID' -H 'Auth-SystemKey: SYSTEMKEY' -H 'Auth-ApiKey: APIKEY' --data '{"ClientKey":"EXAMPLE_CLIENT","VendorKey":"EXAMPLE_VENDOR","CompCode":"EV","Name":"EXAMPLE VENDOR NAME","Address1":"EXAMPLE ADDRESS","Address2":"EXAMPLE LINE 2","city":"EXAMPLE","state":"GA","zipcode":"30303","country":"USA","phone":"111-111-1111","fax":"222-222-2222","email":"example@na.com","MCNumber":"1","DOTNumber":"2"}' https://wstest.factorcloud.com/api_factor/create-vendor/
=======
{
curl --location --request POST 'https://EXAMPLE.factorcloud.com/api_factor/create-vendor/' \
--header 'Auth-Factorid: EXAMPLE' \
--header 'Auth-Apikey: EXAMPLE' \
--header 'Auth-SystemKey: 1' \
--header 'Content-Type: text/plain' \
--data-raw '{"ClientKey": "EXAMPLE_CLIENT","VendorKey": "EXAMPLE_VENDOR","CompCode": "EV","Name": "EXAMPLE VENDOR NAME","Address1": "EXAMPLE ADDRESS","Address2": "EXAMPLE LINE 2","city": "EXAMPLE","state": "GA","zipcode": "30303","country": "USA","phone": "111-111-1111","fax": "222-222-2222", "email": "example@na.com","MCNumber": "1","DOTNumber": "2"}'
}
>>>>>>> 2newcalls
Response:
Header for updated vendor: Status OK 200
Header for newly created vendor: Status Created 201
{
"message": "200"
}