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 Documents in SalesBinder
Overview
The following operations allow you to work with documents. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with documents, see Sample configuration.
Operation | Description |
---|---|
Creates a new document. | |
getDocumentById | Retrieves document details. |
listDocuments | Retrieves all documents. |
updateDocument | Updates a document. |
Operation details
This section provides further details on the operations related to documents.
Creates a new document
The createDocument operation creates a new document.
<salesbinder.createDocument> <contextId>{$ctx:contextId}</contextId> <totalCost>{$ctx:totalCost}</totalCost> <customerId>{$ctx:customerId}</customerId> <totalTax2>{$ctx:totalTax2}</totalTax2> <documentsItem>{$ctx:documentsItem}</documentsItem> <issueDate>{$ctx:issueDate}</issueDate> <totalTax>{$ctx:totalTax}</totalTax> <dropShipCustomerId>{$ctx:dropShipCustomerId}</dropShipCustomerId> <shippingAddress>{$ctx:shippingAddress}</shippingAddress> <totalPrice>{$ctx:totalPrice}</totalPrice> </salesbinder.createDocument>
Properties
The ID of the context.contextId:
The total amount of the cost.totalCost:
The ID of the customer.customerId:
The total amount of the tax2.totalTax2:
The array of the documents item.documentsItem:
The date of issue.issueDate:
The total amount of the tax.totalTax:
The customer ID for the drop ship.dropShipCustomerId:
The shipping address.shippingAddress:
The total value of the price.totalPrice:
Sample request
Following is a sample REST/JSON request that can be handled by the createDocument operation.
{ "apiUrl": "https://sblsoft.salesbinder.com", "apiKey": "cb2192d4832db952ac5d0ec9f41770e88c733c0f", "contextId": "11", "totalCost": "1000.00", "customerId": "54d35e07-d974-4401-9152-065a0ad26590", "totalTax": "98.00", "totalTax2": "70.00", "issueDate": "2013-06-02", "dropShipCustomerId": "54d35e07-d974-4401-9152-065a0ad26590", "shippingAddress": "(Same as above)", "totalPrice": "1400.00", "documentsItem": [ { "item_id": "54d35f54-d774-40cd-a958-04be0ad26590", "unit_id": 1, "description": "Our latest and greatest product!", "quantity": "2.00", "tax": "7.00", "tax2": "5.00", "cost": "1000.00", "price": "1400.00" } ] }
Related SalesBinder documentation
http://www.salesbinder.com/kb/api-functions/create-new-document/
Retrieving document details by ID
The getDocumentById operation retrieves document details by ID.
<salesbinder.getDocumentById> <id>{$ctx:id}</id> </salesbinder.getDocumentById>
Properties
Required - The ID of the document.id:
Sample request
Following is a sample REST/JSON request that can be handled by the getDocumentById operation.
{ "apiUrl":"https://sblsoft.salesbinder.com", "apiKey":"cb2192d4832db952ac5d0ec9f41770e88c733c0f", "id":"54d9af5b-5640-4a27-8fc4-42b50ad26590" }
Related SalesBinder documentation
http://www.salesbinder.com/kb/api-functions/view-document-details/
Retrieving all documents
The
operation retrieves all documents. listDocuments
<salesbinder.listDocuments> <contextId>{$ctx:contextId}</contextId> <page>{$ctx:page}</page> </salesbinder.listDocuments>
Properties
The context ID of the document.contextId:
The number of pages of documents.page:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.listDocuments
{ "apiUrl":"https://sblsoft.salesbinder.com", "apiKey":"cb2192d4832db952ac5d0ec9f41770e88c733c0f", "contextId":"11" }
Note
There are 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/list-documents/
Updating an existing document
The
operation updates an existing document.updateDocument
<salesbinder.updateDocument> <id>{$ctx:id}</id> <contextId>{$ctx:contextId}</contextId> <totalCost>{$ctx:totalCost}</totalCost> <customerId>{$ctx:customerId}</customerId> <totalTax2>{$ctx:totalTax2}</totalTax2> <documentsItem>{$ctx:documentsItem}</documentsItem> <issueDate>{$ctx:issueDate}</issueDate> <totalTax>{$ctx:totalTax}</totalTax> <shippingAddress>{$ctx:shippingAddress}</shippingAddress> <totalPrice>{$ctx:totalPrice}</totalPrice> </salesbinder.updateDocument>
Properties
The ID of the document.id:
The ID of the context.contextId:
Total value of the cost.totalCost:
The ID of the customer.customerId:
Total value of the tax2.totalTax2:
Array of the documents item.documentsItem:
The date of issue.issueDate:
Total value of the tax.totalTax:
The shipping address.shippingAddress:
Total value of the price.totalPrice:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.updateDocument
{ "apiUrl": "https://sblsoft.salesbinder.com", "apiKey": "cb2192d4832db952ac5d0ec9f41770e88c733c0f", "id": "54d9f0df-7224-430d-9e66-67c30ad26590", "contextId": "11", "totalCost": "3000.00", "customerId": "54d35e07-d974-4401-9152-065a0ad26590", "totalTax": "40.00", "totalTax2": "50.00", "issueDate": "2015-02-22", "shippingAddress": "(Same as above)", "totalPrice": "1500.00", "documentsItem": [ { "item_id": "54d35f54-d774-40cd-a958-04be0ad26590", "unit_id": 2, "description": "updated!", "quantity": "4.00", "tax": "2.00", "tax2": "3.00", "cost": "1300.00", "price": "1600.00" } ] }
Related SalesBinder documentation
http://www.salesbinder.com/kb/api-functions/edit-document/
Sample configuration
Following is a sample proxy service that illustrates how to connect to SalesBinder with the init
operation and use the createDocumentet operation. The sample request for this proxy can be found in the createDocument sample request. You can use this sample as a template for using other operations in this category.
<?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="salesbinder_createDocument" 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="contextId" expression="json-eval($.contextId)"/> <property name="totalCost" expression="json-eval($.totalCost)"/> <property name="customerId" expression="json-eval($.customerId)"/> <property name="totalTax2" expression="json-eval($.totalTax2)"/> <property name="documentsItem" expression="json-eval($.documentsItem)"/> <property name="issueDate" expression="json-eval($.issueDate)"/> <property name="totalTax" expression="json-eval($.totalTax)"/> <property name="dropShipCustomerId" expression="json-eval($.dropShipCustomerId)"/> <property name="shippingAddress" expression="json-eval($.shippingAddress)"/> <property name="totalPrice" expression="json-eval($.totalPrice)"/> <salesbinder.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiKey>{$ctx:apiKey}</apiKey> </salesbinder.init> <salesbinder.createDocument> <contextId>{$ctx:contextId}</contextId> <totalCost>{$ctx:totalCost}</totalCost> <customerId>{$ctx:customerId}</customerId> <totalTax2>{$ctx:totalTax2}</totalTax2> <documentsItem>{$ctx:documentsItem}</documentsItem> <issueDate>{$ctx:issueDate}</issueDate> <totalTax>{$ctx:totalTax}</totalTax> <dropShipCustomerId>{$ctx:dropShipCustomerId}</dropShipCustomerId> <shippingAddress>{$ctx:shippingAddress}</shippingAddress> <totalPrice>{$ctx:totalPrice}</totalPrice> </salesbinder.createDocument> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>