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 Clients in FreshBooks
Overview
The following operations allow you to work with clients. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with clients, see Sample configuration.
Operation | Description |
|---|---|
Creates a client. | |
Deletes a client. | |
Retrieves a client. | |
Lists clients. | |
Updates a client. |
Operation details
This section provides details on the operation.
Creating a client
The createClient operation creates a new client. If a password is not supplied, one will be created at random.
createClient
<freshbooks.createClient>
<firstName>{$ctx:firstName}</firstName>
<lastName>{$ctx:lastName}</lastName>
<organization>{$ctx:organization}</organization>
<email>{$ctx:clientEmail}</email>
<username>{$ctx:username}</username>
<password>{$ctx:password}</password>
<contacts>{$ctx:contacts}</contacts>
<workPhone>{$ctx:workPhone}</workPhone>
<homePhone>{$ctx:homePhone}</homePhone>
<mobile>{$ctx:mobile}</mobile>
<fax>{$ctx:fax}</fax>
<language>{$ctx:language}</language>
<currencyCode>{$ctx:currencyCode}</currencyCode>
<notes>{$ctx:notes}</notes>
<pStreet1>{$ctx:pStreet1}</pStreet1>
<pStreet2>{$ctx:pStreet2}</pStreet2>
<pCity>{$ctx:pCity}</pCity>
<pState>{$ctx:pState}</pState>
<pCountry>{$ctx:pCountry}</pCountry>
<pCode>{$ctx:pCode}</pCode>
<sStreet1>{$ctx:sStreet1}</sStreet1>
<sStreet2>{$ctx:sStreet2}</sStreet2>
<sCity>{$ctx:sCity}</sCity>
<sState>{$ctx:sState}</sState>
<sCountry>{$ctx:sCountry}</sCountry>
<sCode>{$ctx:sCode}</sCode>
<vatName>{$ctx:vatName}</vatName>
<vatNumber>{$ctx:vatNumber}</vatNumber>
</freshbooks.createClient>Properties
firstName:The first name of the client.lastName:The last name of the client.organization:The organization name of the client.email:The email address of the client.username:The user name of the client. Defaults to the first name + last name.password:The password of the client. Defaults to a random password.contacts:An array of contact details for the client, each of which contains the following properties:username:The user name of the contact.first_name:The first name of the contact.last_name:The last name of the contact.email:Required - email address of the contactphone1:Phone number (1) of the contact.phone2:Phone number (2) of the contact.
workPhone:The work place telephone number of the client.homePhone:The home telephone number of the client.mobile:The mobile phone number of the client.fax:The fax number of the client.language:The language of the client.currencyCode:The currency code to use with this client.pStreet1:Primary address - street 1 of the client.pStreet2:Primary address - street 2 of the client.pCity:Primary address - city of the client.pState:Primary address - state of the client.pCountry:Primary address - country of the client.pCode:Primary address - postal code of the client.sStreet1:Secondary address - street 1 of the client.sStreet2:Secondary address - street 2 of the client.sCity:Secondary address - city of the client.sState:Secondary address - state of the client.sCountry:Secondary address - country of the client.sCode:Secondary address - postal code of the client.vatName:The VAT name of the client.vatNumber:The VAT number of the client.
Sample request
Following is a sample REST/XML request that can be handled by the createClient operation.
Sample Request for createClient
<createClient>
<arbitraryPassword></arbitraryPassword>
<apiUrl>https://sansu.freshbooks.com</apiUrl>
<authenticationToken>c361a63c745651941sdf2fa8051ea605a6d</authenticationToken>
<firstName>Jane</firstName>
<lastName>Doe</lastName>
<organization>ABC Corp</organization>
<clientEmail>janedoe@gmail.com</clientEmail>
<username>janedoe</username>
<password>seCret!7</password>
<contacts>
<contact>
<username>alex</username>
<first_name>alexander</first_name>
<last_name>Bell</last_name>
<email>janedoe123@gmail.com</email>
<phone1>(555)555-1234</phone1>
<phone2>(555)555-5678</phone2>
</contact>
</contacts>
<workPhone>(555)123-4567</workPhone>
<homePhone>(555)234-5678</homePhone>
<mobile>1445376789</mobile>
<fax>64576757</fax>
<language>en</language>
<currencyCode>USD</currencyCode>
<notes>This is a note</notes>
<pStreet1>123 Center St.</pStreet1>
<pStreet2>Apt. 555</pStreet2>
<pCity>Chicago</pCity>
<pState>IL</pState>
<pCountry>USA</pCountry>
<pCode>60606</pCode>
<sStreet1>456 Main St.</sStreet1>
<sStreet2>Unit 12</sStreet2>
<sCity>Boston</sCity>
<sState>MA</sState>
<sCountry>USA</sCountry>
<sCode>02134</sCode>
<vatName>Vat Name</vatName>
<vatNumber>44444</vatNumber>
</createClient>Related FreshBooks documentation
http://developers.freshbooks.com/docs/clients/#client.create
Deleting a client
The deleteClient operation deletes a client.
deleteClient
<freshbooks.deleteClient>
<clientId>{$ctx:clientId}</clientId>
</freshbooks.deleteClient>