Counterparty (Create)
Creates a new Counterparty, or updates an existing one.
Counterparties are matched on CompanyName. If a Counterparty with that name already exists in cieTrade it is updated, along with its billing address and primary contact; otherwise a new Counterparty is created.
Authentication
Every request needs both of the following:
- An authorized UserID, passed in to the request body — this is the user's cieTrade.net email.
- A Bearer Token in the Authorization header of your tool or code call. The token is found under Settings → Integration → Api Token.
The user must have Can Access cieTrade API checked under Settings → Users & Roles, and must have an email address on their user record — the create and update endpoints record that user against every change they make.
Request Example
{
"UserID": "example@email.net",
"CompanyName": "Acme Recycling Inc",
"Role": "C",
"Status": "A",
"Website": "www.acmerecycling.com",
"Reference": "ERP-10045",
"Currency": "USD",
"CustomerTerms": "NET 30",
"VendorTerms": "",
"DefaultSalesAcct": "Sales - Plastics",
"DefaultExpenseAcct": "",
"PrimarySalesRep": "Jane Smith",
"SecondarySalesRep": "",
"TaxCode": "CT SALES TAX",
"TaxID": "06-1234567",
"IECNumber": "",
"PrimarySalesRepCharge": 2.5,
"PrimarySalesRepChargeUOM": "% GP",
"SecondarySalesRepCharge": 0,
"SecondarySalesRepChargeUOM": "",
"CreditLimit": 50000,
"CreditOnHold": "",
"BillingAddrName": "INVOICE",
"BillingCompanyName": "Acme Recycling Inc",
"BillingStreet": "123 Main St",
"BillingCity": "Stamford",
"BillingRegion": "CT",
"BillingPostalCd": "06901",
"BillingCountry": "USA",
"ContactFirstNm": "John",
"ContactLastNm": "Doe",
"ContactEmail": "john.doe@acmerecycling.com",
"ContactWorkPhone": "203-555-0100",
"ContactMobilePhone": "203-555-0101"
}
Body Parameters
| Parameter | Description | Required |
|---|---|---|
UserID |
cieTrade.NET User Email. Used for Authentication and Logging. | REQUIRED |
CompanyName |
Counterparty company name. If a Counterparty with this name already exists in cieTrade, it is updated instead of a new one being created. | REQUIRED |
Role |
Counterparty role. Defaults to C. Accepts C, S, D, A, P, V, X. See Roles section below. |
OPTIONAL |
Status |
Counterparty status. Defaults to A. Accepts A (Active), P (Prospect), I (Inactive). |
OPTIONAL |
Website |
Company website. | OPTIONAL |
Reference |
Counterparty reference. An additional field that can be used on documents or by custom ERP APIs. | OPTIONAL |
Currency |
Three-letter currency code, for example USD. |
REQUIRED |
CustomerTerms |
Customer payment terms. Must match a Billing Term in cieTrade. | OPTIONAL |
VendorTerms |
Vendor payment terms. Must match a Billing Term in cieTrade. Required when Role is not C. See Roles section below. |
OPTIONAL |
DefaultSalesAcct |
Default sales GL account name. See GL Accounts section below. | OPTIONAL |
DefaultExpenseAcct |
Default expense GL account name. Required when Role is not C. |
OPTIONAL |
PrimarySalesRep |
Primary sales rep. Must match the name of a Sales Rep in cieTrade. | OPTIONAL |
SecondarySalesRep |
Secondary sales rep. Must match the name of a Sales Rep in cieTrade. | OPTIONAL |
TaxCode |
Sales tax code for the billing address. Must match a Sales Tax Code in cieTrade. | OPTIONAL |
TaxID |
Tax ID for the billing address. | OPTIONAL |
IECNumber |
Importer Exporter Code (IEC) number. | OPTIONAL |
PrimarySalesRepCharge |
Charge amount or rate for the primary sales rep. Defaults to 0. | OPTIONAL |
PrimarySalesRepChargeUOM |
What the primary sales rep charge is applied per. Defaults to ST. |
OPTIONAL |
SecondarySalesRepCharge |
Charge amount or rate for the secondary sales rep. Defaults to 0. | OPTIONAL |
SecondarySalesRepChargeUOM |
What the secondary sales rep charge is applied per. Defaults to ST. |
OPTIONAL |
CreditLimit |
Credit limit, in the Counterparty's currency. Defaults to 0. | OPTIONAL |
CreditOnHold |
Credit hold behavior. Accepts A (Always), N (Never). Leave blank to use the default behavior. |
OPTIONAL |
BillingAddrName |
Name of the billing address. Defaults to INVOICE. |
OPTIONAL |
BillingCompanyName |
Company name shown on the billing address. | OPTIONAL |
BillingStreet |
Billing street address. | OPTIONAL |
BillingCity |
Billing city. | OPTIONAL |
BillingRegion |
Billing state or region. Accepts either the abbreviation or the full name, for example CT or Connecticut. Must match a Region in cieTrade. |
OPTIONAL |
BillingPostalCd |
Billing postal code. | OPTIONAL |
BillingCountry |
Billing country. | OPTIONAL |
ContactFirstNm |
Primary contact first name. | OPTIONAL |
ContactLastNm |
Primary contact last name. | OPTIONAL |
ContactEmail |
Primary contact email address. | OPTIONAL |
ContactWorkPhone |
Primary contact work phone number. | OPTIONAL |
ContactMobilePhone |
Primary contact mobile phone number. | OPTIONAL |
Roles
Role sets which types of business can be done with the Counterparty. Defaults to C when it is not provided.
| Role | Description |
|---|---|
C |
Customer only. |
S |
Supplier only. |
D |
Service or Freight only. |
A |
Customer, Supplier, and Service or Freight. |
P |
Customer and Supplier, but not Service or Freight. |
V |
Supplier, and Service or Freight. |
X |
Customer, and Service or Freight. |
For any role other than C, both VendorTerms and DefaultExpenseAcct are required.
Response Example
On Success [HTTP 201]:
{
"Msg": "Successfully Created Counterparty Acme Recycling Inc"
}
On Error [HTTP 500/HTTP 401/HTTP 400]:
{
"ErrMsg": "Customer Terms NET 45 not found in cieTrade."
}