Customers
This resource provides a set of operations to create/update a Customer/Company.
You can create a Company of corporate/master bill type, with all information billing and shipping information. Multiple Contacts can be created for a company at once.
GET
End Point: /customers
You can search for any existing R2 Customer/Company using this service.
In the Customer record list, who created/updated the customer along with date and time is fetched for the respective record as shown in the payload.
Synchronize R2 field: It is a lookup field which has three possible values — Created in R2, Synchronized with R2, and Created in CRM.
GET service fetches the Customers list where the value of Synchronize R2 field is either Created in R2 or Synchronized with R2.
You can also apply filters as defined here.
Pagination is supported for this API. Click here to see the details of it.
Sample response payload
[
{
"recordid": "string",
"customerid": "string",
category": "Customer",
"companyname": "string",
"customertype": "Individual",
"customerstatus": "Active",
"corporatememberof": "string",
"salespersonname": "string",
"subregionid": "string",
"customeraddressline": "string",
"customercity": "string",
"customerstate": "string",
"customerzip": "string",
"customercountry": "string",
"createdbyid": "string",
"createdbyname": "string",
"createddate": "MM/dd/yyyy HH:mm",
"updatedbyid": "string",
"updatedbyname": "string",
"updateddate": "MM/dd/yyyy HH:mm",
"contactrecordid": "string",
"contactid": "string",
"firstname": "string",
"middlename": "string",
"lastname": "string",
"departmentid": "string",
"paymenttermsid": "string",
"isfirstcontact": true,
"emailaddress": "string",
"phonenumber": "string",
"workphone": "string",
"mobilephone": "string",
"homephone": "string",
"faxnumber": "string",
"pagernumber": "string",
"contactaddressline": "string",
"contactcity": "string",
"contactstate": "string",
"contactzip": "string",
"contactcountry": "string",
"contactcreatedbyid": "string",
"contactcreatedbyname": "string",
"contactcreateddate": "MM/dd/yyyy HH:mm",
"contactupdatedbyid": "string",
"contactupdatedbyname": "string",
"contactupdateddate": "MM/dd/yyyy HH:mm"
}
]
GET by ID
End Point: /customers/{id}
You can retrieve all information of a specific R2 Customer/Company using this service.
Along with the customer information, you will also see who created/updated the customer along with date and time as shown in the payload.
Synchronize R2 lookup field: You can fetch Customer details irrespective of the value provided for this field.
Sample response payload
{
"recordid": "string",
"customerid": "string",
"type": "Normal",
"category": "Customer",
"companyname": "string",
"phonenumber": "string",
"faxnumber": "string",
"vendorid": "string",
"customertype": "Individual",
"masterbillingid": "string",
"languageid": "string",
"address":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"billingaddress":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"shippingaddress":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"web": "string",
"membergroupid": "string",
"discountgroupid": "string",
"commissiongroupid": "string",
"taxgroupid": "string",
"marketinggroupid": "string",
"pricinggroupid": "string",
"laborpricinggroupid": "string",
"termgroupid": "string",
"contacts":
[
{
"recordid": "string",
"contactid": "string",
"driverlicenceno": "string",
"firstname": "string",
"middlename": "string",
"lastname": "string",
"departmentid": "string",
"title": "string",
"password": "string",
"emailaddr": "string",
"address":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"billingaddress":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"shippingaddress":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"workphone": "string",
"faxnumber": "string",
"homephone": "string",
"mobilephone": "string",
"pager": "string",
"isprimarycontact": true,
"createdbyid": "string",
"createdbyname": "string",
"createddate": "MM/dd/yyyy HH:mm",
"updatedbyid": "string",
"updatedbyname": "string",
"updateddate": "MM/dd/yyyy HH:mm"
"udfs":
[
{
"caption": "string",
"value": "string"
}
]
}
],
"creditlimit": 0,
"glaccount": 0,
"customerstatus": "Active",
"insuranceamount": 0,
"deductibleamount": 0,
"insuranceexpdate": "MM/dd/yyyy HH:mm",
"insuneverexpire": true,
"insucontactid": "string",
"defaultpayat": "Rent",
"salespersonid": "string",
"billable": "Bill",
"burdenpct": 0,
"billingtermid": "string",
"paymenttermsid": "string",
"payabletermsid": "string",
"taxcertno": "string",
"applytax": true,
"porequired": true,
"synchronizer2": "Created in R2",
"phase": "Suspect",
"createdbyid": "string",
"createdbyname": "string",
"createddate": "MM/dd/yyyy HH:mm",
"updatedbyid": "string",
"updatedbyname": "string",
"updateddate": "MM/dd/yyyy HH:mm"
"udfs":
[
{
"caption": "string",
"value": "string"
}
]
}
POST
End Point: /customers
This action is used to create a Customer/Company record. Multiple Contacts can be created for the Customer/Company at once.
Synchronize R2 field: It is a lookup field which has three possible values — Created in R2, Synchronized with R2, and Created in CRM.
You can create the Customer using either of the three values. Only the Customers created with the value Created in R2 or Synchronized with R2 are searchable in R2. Customers created with the value Created in CRM are searchable in CRM module.
On successful creation, you will see the entire object in the response along created details i.e. created by id, created name, and created date.
The ID of the new record will be returned in 'Location' attribute of the HTTP Header.
The 'Location' indicates the target of a redirection or the URL of a newly created resource.
For example: /customers/{id}
Sample request payload
{
"recordid": "string",
"customerid": "string",
"type": "Normal",
"category": "Customer",
"companyname": "string",
"phonenumber": "string",
"faxnumber": "string",
"vendorid": "string",
"customertype": "Individual",
"masterbillingid": "string",
"languageid": "string",
"address":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"billingaddress":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"shippingaddress":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"web": "string",
"membergroupid": "string",
"discountgroupid": "string",
"commissiongroupid": "string",
"taxgroupid": "string",
"marketinggroupid": "string",
"pricinggroupid": "string",
"laborpricinggroupid": "string",
"termgroupid": "string",
"contacts":
[
{
"recordid": "string",
"contactid": "string",
"driverlicenceno": "string",
"firstname": "string",
"middlename": "string",
"lastname": "string",
"departmentid": "string",
"title": "string",
"password": "string",
"emailaddr": "string",
"address":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"billingaddress":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"shippingaddress":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"workphone": "string",
"faxnumber": "string",
"homephone": "string",
"mobilephone": "string",
"pager": "string",
"isprimarycontact": true,
"createdbyid": "string",
"createdbyname": "string",
"createddate": "MM/dd/yyyy HH:mm",
"updatedbyid": "string",
"updatedbyname": "string",
"updateddate": "MM/dd/yyyy HH:mm"
"udfs":
[
{
"caption": "string",
"value": "string"
}
]
}
],
"creditlimit": 0,
"glaccount": 0,
"customerstatus": "Active",
"insuranceamount": 0,
"deductibleamount": 0,
"insuranceexpdate": "MM/dd/yyyy HH:mm",
"insuneverexpire": true,
"insucontactid": "string",
"defaultpayat": "Rent",
"salespersonid": "string",
"billable": "Bill",
"burdenpct": 0,
"billingtermid": "string",
"paymenttermsid": "string",
"payabletermsid": "string",
"taxcertno": "string",
"applytax": true,
"porequired": true,
"synchronizer2": "Created in R2",
"phase": "Suspect",
"createdbyid": "string",
"createdbyname": "string",
"createddate": "MM/dd/yyyy HH:mm",
"updatedbyid": "string",
"updatedbyname": "string",
"updateddate": "MM/dd/yyyy HH:mm"
"udfs":
[
{
"caption": "string",
"value": "string"
}
]
}
PUT
End Point: /customers/{id}
You can modify the details of an existing R2 Customer/Company and can also modify the Contact information associated with the Company.
Synchronize R2 field: It is a lookup field which has three possible values — Created in R2, Synchronized with R2, and Created in CRM.
You can update the Customer with any one of these three values. The Customers updated with the value Created in R2 or Synchronized with R2 are searchable in R2 and the Customers updated with the value Created in CRM are searchable in CRM module.
After a successful update, you will see the entire object in the response along with created and updated details i.e, created and updated ID, name, and date.
Sample request payload
{
"recordid": "string",
"customerid": "string",
"type": "Normal",
"category": "Customer",
"companyname": "string",
"phonenumber": "string",
"faxnumber": "string",
"vendorid": "string",
"customertype": "Individual",
"masterbillingid": "string",
"languageid": "string",
"address":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"billingaddress":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"shippingaddress":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"web": "string",
"membergroupid": "string",
"discountgroupid": "string",
"commissiongroupid": "string",
"taxgroupid": "string",
"marketinggroupid": "string",
"pricinggroupid": "string",
"laborpricinggroupid": "string",
"termgroupid": "string",
"contacts":
[
{
"recordid": "string",
"contactid": "string",
"driverlicenceno": "string",
"firstname": "string",
"middlename": "string",
"lastname": "string",
"departmentid": "string",
"title": "string",
"password": "string",
"emailaddr": "string",
"address":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"billingaddress":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"shippingaddress":
{
"addressline": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string"
},
"workphone": "string",
"faxnumber": "string",
"homephone": "string",
"mobilephone": "string",
"pager": "string",
"isprimarycontact": true,
"createdbyid": "string",
"createdbyname": "string",
"createddate": "MM/dd/yyyy HH:mm",
"updatedbyid": "string",
"updatedbyname": "string",
"updateddate": "MM/dd/yyyy HH:mm"
"udfs":
[
{
"caption": "string",
"value": "string"
}
]
}
],
"creditlimit": 0,
"glaccount": 0,
"customerstatus": "Active",
"insuranceamount": 0,
"deductibleamount": 0,
"insuranceexpdate": "MM/dd/yyyy HH:mm",
"insuneverexpire": true,
"insucontactid": "string",
"defaultpayat": "Rent",
"salespersonid": "string",
"billable": "Bill",
"burdenpct": 0,
"billingtermid": "string",
"paymenttermsid": "string",
"payabletermsid": "string",
"taxcertno": "string",
"applytax": true,
"porequired": true,
"synchronizer2": "Created in R2",
"phase": "Suspect",
"createdbyid": "string",
"createdbyname": "string",
"createddate": "MM/dd/yyyy HH:mm",
"updatedbyid": "string",
"updatedbyname": "string",
"updateddate": "MM/dd/yyyy HH:mm"
"udfs":
[
{
"caption": "string",
"value": "string"
}
]
}
PATCH
End Point: /customers/{id}
You can partially modify the details of an existing R2 Customer/Company record and the Contact information associated with the Company.
Synchronize R2 field: It is a lookup field which has three possible values — Created in R2, Synchronized with R2, and Created in CRM.
You can modify the customer with any one of these three values. The Customers modified with the value Created in R2 or Synchronized with R2 are searchable in R2 and the Customers modified with the value Created in CRM are searchable in CRM module.
After a successful update, the service returns HTTPStatus 200 – Ok status response code.