/create-debtor/

Purpose
Allows users to create a debtor and associate that debtor to a client. If the DebtorKey variable matches a debtor already in the system; the sub-debtor information will be updated. If there is no matching DebtorKey a master debtor 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-debtor/
Body Information
The body is a JSON Object with the following paramaters:
Variable Name Type Required Purpose
Client Key String Y Unique Identifier for a client in system.
Debtor Key String Y Unique Identifier for a debtor in system. If the client and debtor keys both exist for a subdebtor, that subdebtor will be updated. If neither key has a subdebtor, a new debtor will be made and a subdebtor will be associated. If both keys exist but don't have a pair together, that debtor will have a subdebtor associated to the client.
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 debtor.
Address1 String The primary address of the debtor
Address2 String Additional address information, e.g. suite number
City String The city where the debtor is located.
State String The state where the debtor is located. State code must be used, e.g. “KY”, “NY”, or “BC” (Canadian)
Zipcode String The zip code where the debtor is located. May be in American, Mexican, or Canadian format depending on country.
Country String Which Country the debtor is based, can be either the United States “USA”, Mexico “MEX”, or Canada “CAN”
Phone String The debtor’s phone number, may be in formats ###-###-####, ##########, or (###) ###-####
Fax String The debtor’s fax number, may be in formats ###-###-####, ##########, or (###) ###-####
Email String The debtor’s email address: this address will be used to send invoice information and NOAs to the client.
McNumber String The Debtor’s Motor Carrier Number.
DOTNumber String The Debtor’s USDOT Number.
Notes String Notes for debtor collection information. Optional.
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:
curl --location --request POST 'https://wstest.factorcloud.com/api_factor/create-debtor/' --header 'Auth-Factorid: PHDEV' --header 'Auth-SystemKey: 1' --header 'Auth-Apikey: !@#GREGSMOM!@#' --header 'Content-Type: text/plain' --data-raw '{"ClientKey":"TCC","DebtorKey":"WSTA","CompCode":"WSTA","Name":"WebCallDebtorA"}'
Response:
Header for updated debtor: Status OK 200
Header for newly created debtor: Status Created 201
{
   "message": "200"
}