1. Home
  2. API v2.0
  3. Documents
  4. List & Search Documents

List & Search Documents

Method: /documents.[format]

Parameters: (optional)

Param Name: Description:
contextId (required) Defines what type of document you’re retrieving (4, 5, 11)
page Which page to retrieve from paginated results (numeric)
pageLimit How many records per result set (numeric between 1 – 200)
customerId Filter results by customerId (36 char string)
accountNumber Filter results by accountNumber (numeric)
documentNumber Get data for specific document by documentNumber (numeric)
modifiedSince Return anything modified since timestamp (epoch timestamp)
s Search parameter
field Search a specific data field (document_number, status_id, customer_id, issue_date, name)
exact Only return exact matches in your search results (true or blank)
compact Reduces returned results’ object nested depth (true or blank)

Contexts:

SalesBinder Documents have 3 different “context” values to determine what type of document you want to create:

Estimates Context ID: 4 Invoices Context ID: 5 Purchase Order Context ID: 11

Note:
  – all three contexts share the same fields and data types outlined below
  – including a contextId is required for successfully retrieving and saving documents (see examples below)

Permissions Required:

  • Billing Management
  • View Invoices and/ View Estimates

Syntax

https://[subdomain].salesbinder.com/api/2.0/documents.json?page=2&contextId=5

HTTP Request Type: GET

Sample Returned JSON Data

{
    "count": "90",
    "page": "5",
    "pages": "5",
    "documents": [
        [
            {
                "document_number": 745,
                "name": "Short description of this order",
                "context_id": 5,
                "total_cost": 336,
                "total_tax": 33.02,
                "total_tax2": 0,
                "total_price": 412.8,
                "total_transactions": 0,
                "issue_date": "2016-11-04T00:00:00+00:00",
                "expiry_date": null,
                "date_sent": null,
                "status_id": 9,
                "id": "c3224573-9fe3-4838-8312-62f24ea947b3",
                "customer_id": "549490bc-d880-4f1c-9c29-03d8a2d10228",
                "user_id": "55259a96-c660-4eae-b0d8-3fb16882ca98",
                "created": "2016-11-05T01:39:21+00:00",
                "modified": "2016-11-05T01:39:21+00:00",
                "status": {
                    "id": 9,
                    "name": "unpaid"
                },
                "context": {
                    "id": 5,
                    "name": "invoice"
                },
                "document_items": [
                    {
                        "name": null,
                        "unit_id": null,
                        "service_category_id": null,
                        "description": "",
                        "quantity": 2,
                        "quantity_partially_received": 0,
                        "tax": 8,
                        "tax2": 0,
                        "discount_percent": 0,
                        "cost": 72,
                        "price": 84,
                        "discounted_price": 0,
                        "weight": 1,
                        "modified": "2016-11-05T01:39:21+00:00",
                        "created": "2016-11-05T01:39:21+00:00",
                        "item_variations_location_id": 125898,
                        "item_variation_data": "eyJJdGVtVmFyaWF0aW9uc01dfX0=",
                        "id": "12806eb1-ceab-4d65-aa8e-0f3204f999e1",
                        "item_id": "54d7e4bb-5ec4-4aa4-a2be-7a8ca2d10228",
                        "document_id": "c3224573-9fe3-4838-8312-62f24ea947b3"
                    },
                    {
                        "name": null,
                        "unit_id": null,
                        "service_category_id": null,
                        "description": "Tight fitting pants.",
                        "quantity": 1,
                        "quantity_partially_received": 0,
                        "tax": 8,
                        "tax2": 0,
                        "discount_percent": 0,
                        "cost": 84,
                        "price": 100.8,
                        "discounted_price": 0,
                        "weight": 3,
                        "modified": "2016-11-05T01:39:21+00:00",
                        "created": "2016-11-05T01:39:21+00:00",
                        "item_variations_location_id": 125940,
                        "item_variation_data": "eyJnV0ZXNJdGVtc0l0ZWb24iOltdfX0=",
                        "id": "7b1add1d-7387-45aa-a4bf-8805a0c44c62",
                        "item_id": "54e7a8a2-bc94-4529-aa57-29416882ca98",
                        "document_id": "c3224573-9fe3-4838-8312-62f24ea947b3"
                    },
                    {
                        "name": null,
                        "unit_id": null,
                        "service_category_id": null,
                        "description": "",
                        "quantity": 3,
                        "quantity_partially_received": 0,
                        "tax": 8,
                        "tax2": 0,
                        "discount_percent": 0,
                        "cost": 36,
                        "price": 48,
                        "discounted_price": 0,
                        "weight": 2,
                        "modified": "2016-11-05T01:39:21+00:00",
                        "created": "2016-11-05T01:39:21+00:00",
                        "item_variations_location_id": 125936,
                        "item_variation_data": "eyJJdGVtVmFyaWF0apYXRpb24iOltdfX0=",
                        "id": "ad8e16e0-adae-44d6-a1ad-e087d2fcf00d",
                        "item_id": "54d7e8d4-d608-44f1-ad13-1523a2d10228",
                        "document_id": "c3224573-9fe3-4838-8312-62f24ea947b3"
                    }
                ]
            },
            {
                "document_number": 735,
                "name": "Another test invoice",
                "context_id": 5,
                "total_cost": 336,
                "total_tax": 33.02,
                "total_tax2": 0,
                "total_price": 412.8,
                "total_transactions": 0,
                "issue_date": "2016-11-01T00:00:00+00:00",
                "expiry_date": null,
                "status_id": 9,
                "id": "bf237b0e-7ee1-4485-bd41-1c562b356fe1",
                "customer_id": "549490bc-d880-4f1c-9c29-03d8a2d10228",
                "user_id": "4d76bc2e-74a0-4d5a-ae47-7439b86a92d9",
                "created": "2016-11-01T22:04:29+00:00",
                "modified": "2016-11-01T22:04:29+00:00",
                "status": {
                    "id": 9,
                    "name": "unpaid"
                },
                "context": {
                    "id": 5,
                    "name": "invoice"
                },
                "document_items": [
                    {
                        "name": null,
                        "unit_id": null,
                        "service_category_id": null,
                        "description": "",
                        "quantity": 3,
                        "quantity_partially_received": 0,
                        "tax": 8,
                        "tax2": 0,
                        "discount_percent": 0,
                        "cost": 36,
                        "price": 48,
                        "discounted_price": 0,
                        "weight": 2,
                        "modified": "2016-11-01T22:04:29+00:00",
                        "created": "2016-11-01T22:04:29+00:00",
                        "item_variations_location_id": 125936,
                        "item_variation_data": "eyJJdGVtVmJpYXRpb24iOltdfX0=",
                        "id": "004b50b4-1d8c-4e13-ba59-c1932e938b23",
                        "item_id": "54d7e8d4-d608-44f1-ad13-1523a2d10228",
                        "document_id": "bf237b0e-7ee1-4485-bd41-1c562b356fe1"
                    },
                    {
                        "name": null,
                        "unit_id": null,
                        "service_category_id": null,
                        "description": "",
                        "quantity": 2,
                        "quantity_partially_received": 0,
                        "tax": 8,
                        "tax2": 0,
                        "discount_percent": 0,
                        "cost": 72,
                        "price": 84,
                        "discounted_price": 0,
                        "weight": 1,
                        "modified": "2016-11-01T22:04:29+00:00",
                        "created": "2016-11-01T22:04:29+00:00",
                        "item_variations_location_id": 125898,
                        "item_variation_data": "eyJInZhbHVlIjoiTGFyZ2UifX1dfX0=",
                        "id": "23788a45-e1eb-4747-8868-e4170ebab9e3",
                        "item_id": "54d7e4bb-5ec4-4aa4-a2be-7a8ca2d10228",
                        "document_id": "bf237b0e-7ee1-4485-bd41-1c562b356fe1"
                    },
                    {
                        "name": null,
                        "unit_id": null,
                        "service_category_id": null,
                        "description": "Tight fitting pants.",
                        "quantity": 1,
                        "quantity_partially_received": 0,
                        "tax": 8,
                        "tax2": 0,
                        "discount_percent": 0,
                        "cost": 84,
                        "price": 100.8,
                        "discounted_price": 0,
                        "weight": 3,
                        "modified": "2016-11-01T22:04:29+00:00",
                        "created": "2016-11-01T22:04:29+00:00",
                        "item_variations_location_id": 125940,
                        "item_variation_data": "0ZXNJdGVtc0l0ZW1WYXJpYXRpb24iOltdfX0=",
                        "id": "7df4e593-b8cb-4bd6-8a97-9c656b161017",
                        "item_id": "54e7a8a2-bc94-4529-aa57-29416882ca98",
                        "document_id": "bf237b0e-7ee1-4485-bd41-1c562b356fe1"
                    }
                ]
            },
            {
                "document_number": 730,
                "name": "",
                "context_id": 5,
                "total_cost": 208,
                "total_tax": 13.8,
                "total_tax2": 19.32,
                "total_price": 276,
                "total_transactions": 0,
                "issue_date": "2016-10-29T00:00:00+00:00",
                "expiry_date": null,
                "status_id": 9,
                "id": "a7d195f7-614e-4f29-b312-95b74253df14",
                "customer_id": "571bb2eb-232c-4c90-99f6-05396882ca98",
                "user_id": "55259a96-c660-4eae-b0d8-3fb16882ca98",
                "created": "2016-10-30T04:47:27+00:00",
                "modified": "2016-10-30T04:47:27+00:00",
                "status": {
                    "id": 9,
                    "name": "unpaid"
                },
                "context": {
                    "id": 5,
                    "name": "invoice"
                },
                "document_items": [
                    {
                        "name": null,
                        "unit_id": null,
                        "service_category_id": null,
                        "description": "Comfortable dress pants.",
                        "quantity": 2,
                        "quantity_partially_received": 0,
                        "tax": 5,
                        "tax2": 7,
                        "discount_percent": 0,
                        "cost": 104,
                        "price": 138,
                        "discounted_price": 0,
                        "weight": 1,
                        "modified": "2016-10-30T04:47:27+00:00",
                        "created": "2016-10-30T04:47:27+00:00",
                        "item_variations_location_id": null,
                        "item_variation_data": "",
                        "id": "1628c4e3-37b1-4834-86b0-4213b128a8ff",
                        "item_id": "55fc6df8-613c-474e-a4d9-04d16882ca98",
                        "document_id": "a7d195f7-614e-4f29-b312-95b74253df14"
                    }
                ]
            }
        ]
    ]
}

Sample Returned XML Data

<?xml version="1.0" encoding="UTF-8" ?>
<response>
    <document>
        <document_number>745</document_number>
        <name>API 2.0 - Nov.4 Test B</name>
        <context_id>5</context_id>
        <total_cost>336</total_cost>
        <total_tax>33.02</total_tax>
        <total_tax2>0</total_tax2>
        <total_price>412.8</total_price>
        <total_transactions>0</total_transactions>
        <issue_date>11/4/16</issue_date>
        <expiry_date/>
        <status_id>9</status_id>
        <id>c3224573-9fe3-4838-8312-62f24ea947b3</id>
        <customer_id>549490bc-d880-4f1c-9c29-03d8a2d10228</customer_id>
        <user_id>55259a96-c660-4eae-b0d8-3fb16882ca98</user_id>
        <created>11/5/16, 1:39 AM</created>
        <modified>11/5/16, 1:39 AM</modified>
        <status>
            <id>9</id>
            <name>unpaid</name>
        </status>
        <context>
            <id>5</id>
            <name>invoice</name>
        </context>
        <document_items>
            <name/>
            <unit_id/>
            <service_category_id/>
            <description/>
            <quantity>2</quantity>
            <quantity_partially_received>0</quantity_partially_received>
            <tax>8</tax>
            <tax2>0</tax2>
            <discount_percent>0</discount_percent>
            <cost>72</cost>
            <price>84</price>
            <discounted_price>0</discounted_price>
            <weight>1</weight>
            <modified>11/5/16, 1:39 AM</modified>
            <created>11/5/16, 1:39 AM</created>
            <item_variations_location_id>125898</item_variations_location_id>
            <item_variation_data>eyJJdGVtFyZ2UifX1dfX0=</item_variation_data>
            <id>12806eb1-ceab-4d65-aa8e-0f3204f999e1</id>
            <item_id>54d7e4bb-5ec4-4aa4-a2be-7a8ca2d10228</item_id>
            <document_id>c3224573-9fe3-4838-8312-62f24ea947b3</document_id>
        </document_items>
        <document_items>
            <name/>
            <unit_id/>
            <service_category_id/>
            <description>Tight fitting pants.</description>
            <quantity>1</quantity>
            <quantity_partially_received>0</quantity_partially_received>
            <tax>8</tax>
            <tax2>0</tax2>
            <discount_percent>0</discount_percent>
            <cost>84</cost>
            <price>100.8</price>
            <discounted_price>0</discounted_price>
            <weight>3</weight>
            <modified>11/5/16, 1:39 AM</modified>
            <created>11/5/16, 1:39 AM</created>
            <item_variations_location_id>125940</item_variations_location_id>
            <item_variation_data>eyJJdGVtVmFyaW24iOltdfX0=</item_variation_data>
            <id>7b1add1d-7387-45aa-a4bf-8805a0c44c62</id>
            <item_id>54e7a8a2-bc94-4529-aa57-29416882ca98</item_id>
            <document_id>c3224573-9fe3-4838-8312-62f24ea947b3</document_id>
        </document_items>
        <document_items>
            <name/>
            <unit_id/>
            <service_category_id/>
            <description/>
            <quantity>3</quantity>
            <quantity_partially_received>0</quantity_partially_received>
            <tax>8</tax>
            <tax2>0</tax2>
            <discount_percent>0</discount_percent>
            <cost>36</cost>
            <price>48</price>
            <discounted_price>0</discounted_price>
            <weight>2</weight>
            <modified>11/5/16, 1:39 AM</modified>
            <created>11/5/16, 1:39 AM</created>
            <item_variations_location_id>125936</item_variations_location_id>
            <item_variation_data>eyJJdGVtVmFYXJpYXRpb24iOltdfX0=</item_variation_data>
            <id>ad8e16e0-adae-44d6-a1ad-e087d2fcf00d</id>
            <item_id>54d7e8d4-d608-44f1-ad13-1523a2d10228</item_id>
            <document_id>c3224573-9fe3-4838-8312-62f24ea947b3</document_id>
        </document_items>
    </document>
    <document>
        <document_number>735</document_number>
        <name>API 2.0 - Nov.1 Test A</name>
        <context_id>5</context_id>
        <total_cost>336</total_cost>
        <total_tax>33.02</total_tax>
        <total_tax2>0</total_tax2>
        <total_price>412.8</total_price>
        <total_transactions>0</total_transactions>
        <issue_date>11/1/16</issue_date>
        <expiry_date/>
        <status_id>9</status_id>
        <id>bf237b0e-7ee1-4485-bd41-1c562b356fe1</id>
        <customer_id>549490bc-d880-4f1c-9c29-03d8a2d10228</customer_id>
        <user_id>4d76bc2e-74a0-4d5a-ae47-7439b86a92d9</user_id>
        <created>11/1/16, 10:04 PM</created>
        <modified>11/1/16, 10:04 PM</modified>
        <status>
            <id>9</id>
            <name>unpaid</name>
        </status>
        <context>
            <id>5</id>
            <name>invoice</name>
        </context>
        <document_items>
            <name/>
            <unit_id/>
            <service_category_id/>
            <description/>
            <quantity>3</quantity>
            <quantity_partially_received>0</quantity_partially_received>
            <tax>8</tax>
            <tax2>0</tax2>
            <discount_percent>0</discount_percent>
            <cost>36</cost>
            <price>48</price>
            <discounted_price>0</discounted_price>
            <weight>2</weight>
            <modified>11/1/16, 10:04 PM</modified>
            <created>11/1/16, 10:04 PM</created>
            <item_variations_location_id>125936</item_variations_location_id>
            <item_variation_data>eyJJdJpYXRpb24iOltdfX0=</item_variation_data>
            <id>004b50b4-1d8c-4e13-ba59-c1932e938b23</id>
            <item_id>54d7e8d4-d608-44f1-ad13-1523a2d10228</item_id>
            <document_id>bf237b0e-7ee1-4485-bd41-1c562b356fe1</document_id>
        </document_items>
        <document_items>
            <name/>
            <unit_id/>
            <service_category_id/>
            <description/>
            <quantity>2</quantity>
            <quantity_partially_received>0</quantity_partially_received>
            <tax>8</tax>
            <tax2>0</tax2>
            <discount_percent>0</discount_percent>
            <cost>72</cost>
            <price>84</price>
            <discounted_price>0</discounted_price>
            <weight>1</weight>
            <modified>11/1/16, 10:04 PM</modified>
            <created>11/1/16, 10:04 PM</created>
            <item_variations_location_id>125898</item_variations_location_id>
            <item_variation_data>eyJJdGVtVmFyaWF0aW9uifX1dfX0=</item_variation_data>
            <id>23788a45-e1eb-4747-8868-e4170ebab9e3</id>
            <item_id>54d7e4bb-5ec4-4aa4-a2be-7a8ca2d10228</item_id>
            <document_id>bf237b0e-7ee1-4485-bd41-1c562b356fe1</document_id>
        </document_items>
        <document_items>
            <name/>
            <unit_id/>
            <service_category_id/>
            <description>Tight fitting pants.</description>
            <quantity>1</quantity>
            <quantity_partially_received>0</quantity_partially_received>
            <tax>8</tax>
            <tax2>0</tax2>
            <discount_percent>0</discount_percent>
            <cost>84</cost>
            <price>100.8</price>
            <discounted_price>0</discounted_price>
            <weight>3</weight>
            <modified>11/1/16, 10:04 PM</modified>
            <created>11/1/16, 10:04 PM</created>
            <item_variations_location_id>125940</item_variations_location_id>
            <item_variation_data>eyJJdGVtVmFyaWdfX0=</item_variation_data>
            <id>7df4e593-b8cb-4bd6-8a97-9c656b161017</id>
            <item_id>54e7a8a2-bc94-4529-aa57-29416882ca98</item_id>
            <document_id>bf237b0e-7ee1-4485-bd41-1c562b356fe1</document_id>
        </document_items>
    </document>
    <document>
        <document_number>730</document_number>
        <name>API v2 Created Invoice 2</name>
        <context_id>5</context_id>
        <total_cost>208</total_cost>
        <total_tax>13.8</total_tax>
        <total_tax2>19.32</total_tax2>
        <total_price>276</total_price>
        <total_transactions>0</total_transactions>
        <issue_date>10/29/16</issue_date>
        <expiry_date/>
        <status_id>9</status_id>
        <id>a7d195f7-614e-4f29-b312-95b74253df14</id>
        <customer_id>571bb2eb-232c-4c90-99f6-05396882ca98</customer_id>
        <user_id>55259a96-c660-4eae-b0d8-3fb16882ca98</user_id>
        <created>10/30/16, 4:47 AM</created>
        <modified>10/30/16, 4:47 AM</modified>
        <status>
            <id>9</id>
            <name>unpaid</name>
        </status>
        <context>
            <id>5</id>
            <name>invoice</name>
        </context>
        <document_items>
            <name/>
            <unit_id/>
            <service_category_id/>
            <description>Comfortable dress pants.</description>
            <quantity>2</quantity>
            <quantity_partially_received>0</quantity_partially_received>
            <tax>5</tax>
            <tax2>7</tax2>
            <discount_percent>0</discount_percent>
            <cost>104</cost>
            <price>138</price>
            <discounted_price>0</discounted_price>
            <weight>1</weight>
            <modified>10/30/16, 4:47 AM</modified>
            <created>10/30/16, 4:47 AM</created>
            <item_variations_location_id/>
            <item_variation_data/>
            <id>1628c4e3-37b1-4834-86b0-4213b128a8ff</id>
            <item_id>55fc6df8-613c-474e-a4d9-04d16882ca98</item_id>
            <document_id>a7d195f7-614e-4f29-b312-95b74253df14</document_id>
        </document_items>
    </document>
</response>
Was this article helpful to you? Yes 1 No