This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Accounts in SalesBinder



Overview

The following operations allow you to work with accounts. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with accounts, see Sample configuration

OperationDescription

createAccount

Creates a new account.

getAccountByIdRetrieves account details.
listAccountsRetrieves all accounts.

Operation details

This section provides further details on the operations related to accounts.

Creating a new account

The createAccount operation creates a new account.

createAccount
<salesbinder.createAccount>
    <billingAddress1>{$ctx:billingAddress1}</billingAddress1>
    <billingAddress2>{$ctx:billingAddress2}</billingAddress2>
    <shippingPostalCode>{$ctx:shippingPostalCode}</shippingPostalCode>
    <shippingAddress1>{$ctx:shippingAddress1}</shippingAddress1>
    <officeFax>{$ctx:officeFax}</officeFax>
    <shippingAddress2>{$ctx:shippingAddress2}</shippingAddress2>
    <url>{$ctx:url}</url>
    <contextId>{$ctx:contextId}</contextId>
    <billingRegion>{$ctx:billingRegion}</billingRegion>
    <billingPostalCode>{$ctx:billingPostalCode}</billingPostalCode>
    <officeEmail>{$ctx:officeEmail}</officeEmail>
    <name>{$ctx:name}</name>
    <officeNumber>{$ctx:officeNumber}</officeNumber>
    <shippingRegion>{$ctx:shippingRegion}</shippingRegion>
    <billingCity>{$ctx:billingCity}</billingCity>
    <shippingCountry>{$ctx:shippingCountry}</shippingCountry>
    <billingCountry>{$ctx:billingCountry}</billingCountry>
    <shippingCity>{$ctx:shippingCity}</shippingCity>
	<customerLabelId>{$ctx:customerLabelId}</customerLabelId>
</salesbinder.createAccount>
Properties
  • billingAddress1: Billing address Line 1 of the customer.
  • billingAddress2: Billing address Line 2 of the customer.
  • shippingPostalCode: Shipping postal code or zip code of the customer.
  • shippingAddress1: Shipping address Line 1.
  • officeFax: Office fax of the customer.
  • shippingAddress2: Shipping address line 2.
  • url: Company website address of the customer.
  • contextId: The value to determine what type of account you want to create.
  • billingRegion: Billing region (Province or State).
  • billingPostalCode: Billing Postal Code or Zip Code of the customer.
  • officeEmail: Office email address of the customer.
  • name: Business name of the customer.
  • officeNumber: Office phone number of the customer.
  • shippingRegion: Shipping region (Province or State) of the customer.
  • billingCity: Billing city of the customer.
  • shippingCountry: Shipping country of the customer.
  • billingCountry: Billing country of the customer.
  • shippingCity: Shipping city for the customer.
  • customerLabelId: The ID of the customer label.
Sample request

Following is a sample REST/JSON request that can be handled by the createAccount operation.

Sample Request for createAccount
{
    "apiUrl": "https://sblsoft.salesbinder.com",
    "apiKey": "cb2192d4832db952ac5d0ec9f41770e88c733c0f",
    "billingAddress1": "Richland",
    "shippingAddress1": "Malabe",
    "officeFax": "234344",
    "contextId": "2",
    "billingRegion": "Ontario",
    "billingPostalCode": "23",
    "officeEmail": "sas.h@gmil.com",
    "name": "Peter pan",
    "officeNumber": "43545",
    "shippingRegion": "Western",
    "billingCity": "Toronto",
    "shippingCountry": "Sri Lanka",
	"customerLabelId":"54db4e6e-36ec-47c3-816d-4d240ad26590"
}

Note

There are more optional parameters available. For more information on the usage of these parameters please check the API document. 

Related SalesBinder documentation

http://www.salesbinder.com/kb/api-functions/create-new-account/

Retrieving account details by ID

The getAccountById operation retrieves account details by ID.

getAccountById
<salesbinder.getAccountById>
	<id>{$ctx:id}</id>
</salesbinder.getAccountById>
Properties
  • id: Required - The ID of the account.
Sample request

Following is a sample REST/JSON request that can be handled by the getAccountById operation.

Sample Request for getAccountById
{
	"apiUrl":"https://sblsoft.salesbinder.com",
	"apiKey":"cb2192d4832db952ac5d0ec9f41770e88c733c0f",
	"id":"54e72c32-63e4-47b0-8dfa-3e500ad1a5a6"
}
Related SalesBinder documentation

http://www.salesbinder.com/kb/api-functions/view-account/

Retrieving all accounts

The listAccounts operation retrieves all accounts.

listAccounts
<salesbinder.listAccounts>
	<contextId>{$ctx:contextId}</contextId>
    <page>{$ctx:page}</page>
</salesbinder.listAccounts>
Properties
  • contextId: The context ID of the account.
  • page: The number of pages of the accounts.
Sample request

Following is a sample REST/JSON request that can be handled by the listAccounts operation.

Sample Request for listAccounts
{
	"apiUrl":"https://sblsoft.salesbinder.com",
	"apiKey":"cb2192d4832db952ac5d0ec9f41770e88c733c0f",
	"contextId":"2",
	"page":"2"
}
Related SalesBinder documentation

http://www.salesbinder.com/kb/api-functions/list-accounts/

Sample configuration

Following is a sample proxy service that illustrates how to connect to SalesBinder with the init operation and use the createAccount operation. The sample request for this proxy can be found in the createAccount sample request. You can use this sample as a template for using other operations in this category.

Sample Proxy
<?xml version="1.0" encoding="UTF-8"?>
	<proxy xmlns="http://ws.apache.org/ns/synapse" name="salesbinder_createAccount" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
	 <target>
	 <inSequence onError="faultHandlerSeq">
      <property name="apiUrl" expression="json-eval($.apiUrl)"/>
      <property name="apiKey" expression="json-eval($.apiKey)"/>
      <property name="billingAddress1" expression="json-eval($.billingAddress1)"/>
      <property name="billingAddress2" expression="json-eval($.billingAddress2)"/>
      <property name="shippingPostalCode" expression="json-eval($.shippingPostalCode)"/>
      <property name="shippingAddress1" expression="json-eval($.shippingAddress1)"/>
      <property name="officeFax" expression="json-eval($.officeFax)"/>
      <property name="shippingAddress2" expression="json-eval($.shippingAddress2)"/>
      <property name="url" expression="json-eval($.url)"/>
      <property name="contextId" expression="json-eval($.contextId)"/>
      <property name="billingRegion" expression="json-eval($.billingRegion)"/>
      <property name="billingPostalCode" expression="json-eval($.billingPostalCode)"/>
      <property name="officeEmail" expression="json-eval($.officeEmail)"/>
      <property name="name" expression="json-eval($.name)"/>
      <property name="officeNumber" expression="json-eval($.officeNumber)"/>
      <property name="shippingRegion" expression="json-eval($.shippingRegion)"/>
      <property name="billingCity" expression="json-eval($.billingCity)"/>
      <property name="shippingCountry" expression="json-eval($.shippingCountry)"/>
      <property name="billingCountry" expression="json-eval($.billingCountry)"/>
      <property name="shippingCity" expression="json-eval($.shippingCity)"/>
	  <property name="customerLabelId" expression="json-eval($.customerLabelId)"/>
      <salesbinder.init>
         <apiUrl>{$ctx:apiUrl}</apiUrl>
         <apiKey>{$ctx:apiKey}</apiKey>
      </salesbinder.init>
      <salesbinder.createAccount>
         <billingAddress1>{$ctx:billingAddress1}</billingAddress1>
         <billingAddress2>{$ctx:billingAddress2}</billingAddress2>
         <shippingPostalCode>{$ctx:shippingPostalCode}</shippingPostalCode>
         <shippingAddress1>{$ctx:shippingAddress1}</shippingAddress1>
         <officeFax>{$ctx:officeFax}</officeFax>
         <shippingAddress2>{$ctx:shippingAddress2}</shippingAddress2>
         <url>{$ctx:url}</url>
         <contextId>{$ctx:contextId}</contextId>
         <billingRegion>{$ctx:billingRegion}</billingRegion>
         <billingPostalCode>{$ctx:billingPostalCode}</billingPostalCode>
         <officeEmail>{$ctx:officeEmail}</officeEmail>
         <name>{$ctx:name}</name>
         <officeNumber>{$ctx:officeNumber}</officeNumber>
         <shippingRegion>{$ctx:shippingRegion}</shippingRegion>
         <billingCity>{$ctx:billingCity}</billingCity>
         <shippingCountry>{$ctx:shippingCountry}</shippingCountry>
         <billingCountry>{$ctx:billingCountry}</billingCountry>
         <shippingCity>{$ctx:shippingCity}</shippingCity>
		 <customerLabelId>{$ctx:customerLabelId}</customerLabelId>
      </salesbinder.createAccount>
	   <respond/>
	 </inSequence>
	  <outSequence>
	   <send/>
	  </outSequence>
	 </target>
   <description/>
  </proxy>