API AccountAdd
AccountAdd(
object Account
)
Add and Account to a Customer.
Request
Request Data:
- (object) Account(required)
- (string) Name (required) – Account Name
- (int) CustomerID (required) – Identify the Customer by ID
- (string) CustomerName (required) – Identify the Customer by Name (it will be ignored if CustomerID is provided.
- (int) SupplierID (required) – Identify the Supplier by ID.
- (string) SupplierName (required) – Identify the Supplier by Name (it will be ignored if SupplierID is provided.
- (int) LocationID (optional) – Identify the Location by ID.
- (string) LocationName (optional) – Identify the Location by Name (it will be ignored if LocationID is provided.
- (int) AssignedRepID (optional) – Identify the account’s Assigned Rep by ID.
- (string) AssignedRep (optional) – Identify the account’s Assigned Rep by Name (it will be ignored if AssignedRepID is provided). Must be used along with AssignedRepAgencyID or AssignedRepAgency.
- (int) AssignedRepAgencyID (optional) – identify the named rep by agency ID.
- (string) AssignedRepAgency (optional) – identify the named rep by agency name (it will be ignored if AssignedRepAgencyID is provided).
- (int) AccountGroupID (optional) – Identify the Account Group by ID.
- (string) AccountGroupName (optional) – Identify the Account Group by Name (it will be ignored if AccountGroupID is provided
- (array) Fields (required) – list of custom fields object.
{
"Account":
{
"Name": <string>,
"CustomerID": <int>,
"CustomerName": <string>,
"SupplierID": <int>,
"SupplierName": <string>,
"LocationID": <int>,
"LocationName": <string>,
"AccountGroupID": <int>,
"AssignedRep": <string>, // Since RPM28
"AssignedRepID": <int>, // Since RPM28
"AssignedRepAgencyName": <string>, // Since RPM28: To be used along AssignedRep
"AssignedRepAgencyID": <string>, // Since RPM28: To be used along AssignedRep
"AccountGroupName": <string>,
"Fields": [
{
"Field": <string>,
"Value": <string>
},
<... more custom fields>
]
}
}
Response
{
"Result": {
"Account": <string>,
"AccountGroup": <string>,
"AccountGroupID": <int>,
"AccountID": <int>,
"Added": "<Date>",
"Customer": <string>,
"CustomerID": <int>,
"Fields": [<fields>],
"Modified": "<Date>",
"Address": <string>, // Since RPM26: the primary location's address line
"City": <string>, // Since RPM26: the primary location's city
"StateProvince": <string>, // Since RPM26: the primary location's state or province
"Country": <string>, // Since RPM26: the primary location's country
"ZipPostalCode": <string>, // Since RPM26: the primary location's zip/postal code
"Reps": [
{
"Agency": <string>,
"AgencyID": <int>,
"AssignmentCodesRecent": [<int>], // Assignment Code IDs
"Rep": <string>,
"RepID": <int>
},
<more reps...>
],
"Supplier": <string>,
"SupplierID": <int>,
"Splits": [ // Since RPM28
{
"Agency": <string>,
"AgencyID": <int>,
"Rep": <string>,
"RepID": <int>,
"Percentage": <double> // the percentage value divided by 100 (e.g. if the UI shows 55% the value will be 0.55)
},
<more splits...>
],
"Addendums": [ // Since RPM28
{
"Agency": <string>,
"AgencyID": <int>,
"GrossRate": <double>,
"GrossRateType": <enum:
1 = % Net Billed
3 = cash
5 = % (net billed - wholesale)
6 = % wholesale
9 = % contract value
>,
"SalesRate": <double>,
"SalesRateType": <enum:
1 = % Net Billed
2 = % gross comm
3 = cash
5 = % (net billed - wholesale)
6 = % wholesale
9 = % contract value
>
},
<more addendums...>
],
"Referrals": [ // Since RPM28
{
"PayToAgency": <string>,
"PayToAgencyID": <int>,
"Type": "Override" | "Deduction",
"Rate": <double>,
"RateType": <enum:
1 = % net billed
2 = % gross comm
5 = % (net billed - wholesale)
6 = % wholesale
9 = % contract value
4 = % agent comm
7 = % (gross - agent)
8 = (% gross) - agent
3 = cash
>,
"Start": <string>, // Start run in the following format: YYYYMM
"End": <string>, // End run in the following format: YYYYMM
}
]
}
}
Errors
- “Permission denied”
This endpoint requires the user’s role to have “Commissions section” and “Commissions setup” - “An account name is required”
- “A valid customer is required”
- “A valid supplier is required”
- “A unique account number is required”
- “The location specified is not valid” – When the specified Location does not belong to the specified customer
- “A valid rep is required” – if the Assigned Rep provided does not exist.
- "Call requires parameter: \"Account\" which was not found"