API Documentation

    DocumentsList & Search Documents

    Method: /documents.[format]
    Parameters: (optional)
    Param Name:Description:
    contextId (required)Defines what type of document you’re retrieving (4, 5, 11)
    pageWhich page to retrieve from paginated results (numeric)
    pageLimitHow many records per result set (numeric between 1 – 200)
    customerIdFilter results by customerId (36 char string)
    accountNumberFilter results by accountNumber (numeric)
    documentNumberGet data for specific document by documentNumber (numeric)
    modifiedSinceReturn anything modified since timestamp (epoch timestamp)
    sSearch parameter
    fieldSearch a specific data field (document_number, status_id, customer_id, issue_date, name)
    exactOnly return exact matches in your search results (true or blank)
    compactReduces 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
    1{
    2    "count": "90",
    3    "page": "5",
    4    "pages": "5",
    5    "documents": [
    6        [
    7            {
    8                "document_number": 745,
    9                "name": "Short description of this order",
    10                "context_id": 5,
    11                "total_cost": 336,
    12                "total_tax": 33.02,
    13                "total_tax2": 0,
    14                "total_price": 412.8,
    15                "total_transactions": 0,
    16                "issue_date": "2016-11-04T00:00:00+00:00",
    17                "expiry_date": null,
    18                "date_sent": null,
    19                "status_id": 9,
    20                "id": "c3224573-9fe3-4838-8312-62f24ea947b3",
    21                "customer_id": "549490bc-d880-4f1c-9c29-03d8a2d10228",
    22                "user_id": "55259a96-c660-4eae-b0d8-3fb16882ca98",
    23                "created": "2016-11-05T01:39:21+00:00",
    24                "modified": "2016-11-05T01:39:21+00:00",
    25                "status": {
    26                    "id": 9,
    27                    "name": "unpaid"
    28                },
    29                "context": {
    30                    "id": 5,
    31                    "name": "invoice"
    32                },
    33                "document_items": [
    34                    {
    35                        "name": null,
    36                        "unit_id": null,
    37                        "service_category_id": null,
    38                        "description": "",
    39                        "quantity": 2,
    40                        "quantity_partially_received": 0,
    41                        "tax": 8,
    42                        "tax2": 0,
    43                        "discount_percent": 0,
    44                        "cost": 72,
    45                        "price": 84,
    46                        "discounted_price": 0,
    47                        "weight": 1,
    48                        "modified": "2016-11-05T01:39:21+00:00",
    49                        "created": "2016-11-05T01:39:21+00:00",
    50                        "item_variations_location_id": 125898,
    51                        "item_variation_data": "eyJJdGVtVmFyaWF0aW9uc01dfX0=",
    52                        "id": "12806eb1-ceab-4d65-aa8e-0f3204f999e1",
    53                        "item_id": "54d7e4bb-5ec4-4aa4-a2be-7a8ca2d10228",
    54                        "document_id": "c3224573-9fe3-4838-8312-62f24ea947b3"
    55                    },
    56                    {
    57                        "name": null,
    58                        "unit_id": null,
    59                        "service_category_id": null,
    60                        "description": "Tight fitting pants.",
    61                        "quantity": 1,
    62                        "quantity_partially_received": 0,
    63                        "tax": 8,
    64                        "tax2": 0,
    65                        "discount_percent": 0,
    66                        "cost": 84,
    67                        "price": 100.8,
    68                        "discounted_price": 0,
    69                        "weight": 3,
    70                        "modified": "2016-11-05T01:39:21+00:00",
    71                        "created": "2016-11-05T01:39:21+00:00",
    72                        "item_variations_location_id": 125940,
    73                        "item_variation_data": "eyJnV0ZXNJdGVtc0l0ZWb24iOltdfX0=",
    74                        "id": "7b1add1d-7387-45aa-a4bf-8805a0c44c62",
    75                        "item_id": "54e7a8a2-bc94-4529-aa57-29416882ca98",
    76                        "document_id": "c3224573-9fe3-4838-8312-62f24ea947b3"
    77                    },
    78                    {
    79                        "name": null,
    80                        "unit_id": null,
    81                        "service_category_id": null,
    82                        "description": "",
    83                        "quantity": 3,
    84                        "quantity_partially_received": 0,
    85                        "tax": 8,
    86                        "tax2": 0,
    87                        "discount_percent": 0,
    88                        "cost": 36,
    89                        "price": 48,
    90                        "discounted_price": 0,
    91                        "weight": 2,
    92                        "modified": "2016-11-05T01:39:21+00:00",
    93                        "created": "2016-11-05T01:39:21+00:00",
    94                        "item_variations_location_id": 125936,
    95                        "item_variation_data": "eyJJdGVtVmFyaWF0apYXRpb24iOltdfX0=",
    96                        "id": "ad8e16e0-adae-44d6-a1ad-e087d2fcf00d",
    97                        "item_id": "54d7e8d4-d608-44f1-ad13-1523a2d10228",
    98                        "document_id": "c3224573-9fe3-4838-8312-62f24ea947b3"
    99                    }
    100                ]
    101            },
    102            {
    103                "document_number": 735,
    104                "name": "Another test invoice",
    105                "context_id": 5,
    106                "total_cost": 336,
    107                "total_tax": 33.02,
    108                "total_tax2": 0,
    109                "total_price": 412.8,
    110                "total_transactions": 0,
    111                "issue_date": "2016-11-01T00:00:00+00:00",
    112                "expiry_date": null,
    113                "status_id": 9,
    114                "id": "bf237b0e-7ee1-4485-bd41-1c562b356fe1",
    115                "customer_id": "549490bc-d880-4f1c-9c29-03d8a2d10228",
    116                "user_id": "4d76bc2e-74a0-4d5a-ae47-7439b86a92d9",
    117                "created": "2016-11-01T22:04:29+00:00",
    118                "modified": "2016-11-01T22:04:29+00:00",
    119                "status": {
    120                    "id": 9,
    121                    "name": "unpaid"
    122                },
    123                "context": {
    124                    "id": 5,
    125                    "name": "invoice"
    126                },
    127                "document_items": [
    128                    {
    129                        "name": null,
    130                        "unit_id": null,
    131                        "service_category_id": null,
    132                        "description": "",
    133                        "quantity": 3,
    134                        "quantity_partially_received": 0,
    135                        "tax": 8,
    136                        "tax2": 0,
    137                        "discount_percent": 0,
    138                        "cost": 36,
    139                        "price": 48,
    140                        "discounted_price": 0,
    141                        "weight": 2,
    142                        "modified": "2016-11-01T22:04:29+00:00",
    143                        "created": "2016-11-01T22:04:29+00:00",
    144                        "item_variations_location_id": 125936,
    145                        "item_variation_data": "eyJJdGVtVmJpYXRpb24iOltdfX0=",
    146                        "id": "004b50b4-1d8c-4e13-ba59-c1932e938b23",
    147                        "item_id": "54d7e8d4-d608-44f1-ad13-1523a2d10228",
    148                        "document_id": "bf237b0e-7ee1-4485-bd41-1c562b356fe1"
    149                    },
    150                    {
    151                        "name": null,
    152                        "unit_id": null,
    153                        "service_category_id": null,
    154                        "description": "",
    155                        "quantity": 2,
    156                        "quantity_partially_received": 0,
    157                        "tax": 8,
    158                        "tax2": 0,
    159                        "discount_percent": 0,
    160                        "cost": 72,
    161                        "price": 84,
    162                        "discounted_price": 0,
    163                        "weight": 1,
    164                        "modified": "2016-11-01T22:04:29+00:00",
    165                        "created": "2016-11-01T22:04:29+00:00",
    166                        "item_variations_location_id": 125898,
    167                        "item_variation_data": "eyJInZhbHVlIjoiTGFyZ2UifX1dfX0=",
    168                        "id": "23788a45-e1eb-4747-8868-e4170ebab9e3",
    169                        "item_id": "54d7e4bb-5ec4-4aa4-a2be-7a8ca2d10228",
    170                        "document_id": "bf237b0e-7ee1-4485-bd41-1c562b356fe1"
    171                    },
    172                    {
    173                        "name": null,
    174                        "unit_id": null,
    175                        "service_category_id": null,
    176                        "description": "Tight fitting pants.",
    177                        "quantity": 1,
    178                        "quantity_partially_received": 0,
    179                        "tax": 8,
    180                        "tax2": 0,
    181                        "discount_percent": 0,
    182                        "cost": 84,
    183                        "price": 100.8,
    184                        "discounted_price": 0,
    185                        "weight": 3,
    186                        "modified": "2016-11-01T22:04:29+00:00",
    187                        "created": "2016-11-01T22:04:29+00:00",
    188                        "item_variations_location_id": 125940,
    189                        "item_variation_data": "0ZXNJdGVtc0l0ZW1WYXJpYXRpb24iOltdfX0=",
    190                        "id": "7df4e593-b8cb-4bd6-8a97-9c656b161017",
    191                        "item_id": "54e7a8a2-bc94-4529-aa57-29416882ca98",
    192                        "document_id": "bf237b0e-7ee1-4485-bd41-1c562b356fe1"
    193                    }
    194                ]
    195            },
    196            {
    197                "document_number": 730,
    198                "name": "",
    199                "context_id": 5,
    200                "total_cost": 208,
    201                "total_tax": 13.8,
    202                "total_tax2": 19.32,
    203                "total_price": 276,
    204                "total_transactions": 0,
    205                "issue_date": "2016-10-29T00:00:00+00:00",
    206                "expiry_date": null,
    207                "status_id": 9,
    208                "id": "a7d195f7-614e-4f29-b312-95b74253df14",
    209                "customer_id": "571bb2eb-232c-4c90-99f6-05396882ca98",
    210                "user_id": "55259a96-c660-4eae-b0d8-3fb16882ca98",
    211                "created": "2016-10-30T04:47:27+00:00",
    212                "modified": "2016-10-30T04:47:27+00:00",
    213                "status": {
    214                    "id": 9,
    215                    "name": "unpaid"
    216                },
    217                "context": {
    218                    "id": 5,
    219                    "name": "invoice"
    220                },
    221                "document_items": [
    222                    {
    223                        "name": null,
    224                        "unit_id": null,
    225                        "service_category_id": null,
    226                        "description": "Comfortable dress pants.",
    227                        "quantity": 2,
    228                        "quantity_partially_received": 0,
    229                        "tax": 5,
    230                        "tax2": 7,
    231                        "discount_percent": 0,
    232                        "cost": 104,
    233                        "price": 138,
    234                        "discounted_price": 0,
    235                        "weight": 1,
    236                        "modified": "2016-10-30T04:47:27+00:00",
    237                        "created": "2016-10-30T04:47:27+00:00",
    238                        "item_variations_location_id": null,
    239                        "item_variation_data": "",
    240                        "id": "1628c4e3-37b1-4834-86b0-4213b128a8ff",
    241                        "item_id": "55fc6df8-613c-474e-a4d9-04d16882ca98",
    242                        "document_id": "a7d195f7-614e-4f29-b312-95b74253df14"
    243                    }
    244                ]
    245            }
    246        ]
    247    ]
    248}
    Sample Returned XML Data
    1<?xml version="1.0" encoding="UTF-8" ?>
    2<response>
    3    <document>
    4        <document_number>745</document_number>
    5        <name>API 2.0 - Nov.4 Test B</name>
    6        <context_id>5</context_id>
    7        <total_cost>336</total_cost>
    8        <total_tax>33.02</total_tax>
    9        <total_tax2>0</total_tax2>
    10        <total_price>412.8</total_price>
    11        <total_transactions>0</total_transactions>
    12        <issue_date>11/4/16</issue_date>
    13        <expiry_date/>
    14        <status_id>9</status_id>
    15        <id>c3224573-9fe3-4838-8312-62f24ea947b3</id>
    16        <customer_id>549490bc-d880-4f1c-9c29-03d8a2d10228</customer_id>
    17        <user_id>55259a96-c660-4eae-b0d8-3fb16882ca98</user_id>
    18        <created>11/5/16, 1:39 AM</created>
    19        <modified>11/5/16, 1:39 AM</modified>
    20        <status>
    21            <id>9</id>
    22            <name>unpaid</name>
    23        </status>
    24        <context>
    25            <id>5</id>
    26            <name>invoice</name>
    27        </context>
    28        <document_items>
    29            <name/>
    30            <unit_id/>
    31            <service_category_id/>
    32            <description/>
    33            <quantity>2</quantity>
    34            <quantity_partially_received>0</quantity_partially_received>
    35            <tax>8</tax>
    36            <tax2>0</tax2>
    37            <discount_percent>0</discount_percent>
    38            <cost>72</cost>
    39            <price>84</price>
    40            <discounted_price>0</discounted_price>
    41            <weight>1</weight>
    42            <modified>11/5/16, 1:39 AM</modified>
    43            <created>11/5/16, 1:39 AM</created>
    44            <item_variations_location_id>125898</item_variations_location_id>
    45            <item_variation_data>eyJJdGVtFyZ2UifX1dfX0=</item_variation_data>
    46            <id>12806eb1-ceab-4d65-aa8e-0f3204f999e1</id>
    47            <item_id>54d7e4bb-5ec4-4aa4-a2be-7a8ca2d10228</item_id>
    48            <document_id>c3224573-9fe3-4838-8312-62f24ea947b3</document_id>
    49        </document_items>
    50        <document_items>
    51            <name/>
    52            <unit_id/>
    53            <service_category_id/>
    54            <description>Tight fitting pants.</description>
    55            <quantity>1</quantity>
    56            <quantity_partially_received>0</quantity_partially_received>
    57            <tax>8</tax>
    58            <tax2>0</tax2>
    59            <discount_percent>0</discount_percent>
    60            <cost>84</cost>
    61            <price>100.8</price>
    62            <discounted_price>0</discounted_price>
    63            <weight>3</weight>
    64            <modified>11/5/16, 1:39 AM</modified>
    65            <created>11/5/16, 1:39 AM</created>
    66            <item_variations_location_id>125940</item_variations_location_id>
    67            <item_variation_data>eyJJdGVtVmFyaW24iOltdfX0=</item_variation_data>
    68            <id>7b1add1d-7387-45aa-a4bf-8805a0c44c62</id>
    69            <item_id>54e7a8a2-bc94-4529-aa57-29416882ca98</item_id>
    70            <document_id>c3224573-9fe3-4838-8312-62f24ea947b3</document_id>
    71        </document_items>
    72        <document_items>
    73            <name/>
    74            <unit_id/>
    75            <service_category_id/>
    76            <description/>
    77            <quantity>3</quantity>
    78            <quantity_partially_received>0</quantity_partially_received>
    79            <tax>8</tax>
    80            <tax2>0</tax2>
    81            <discount_percent>0</discount_percent>
    82            <cost>36</cost>
    83            <price>48</price>
    84            <discounted_price>0</discounted_price>
    85            <weight>2</weight>
    86            <modified>11/5/16, 1:39 AM</modified>
    87            <created>11/5/16, 1:39 AM</created>
    88            <item_variations_location_id>125936</item_variations_location_id>
    89            <item_variation_data>eyJJdGVtVmFYXJpYXRpb24iOltdfX0=</item_variation_data>
    90            <id>ad8e16e0-adae-44d6-a1ad-e087d2fcf00d</id>
    91            <item_id>54d7e8d4-d608-44f1-ad13-1523a2d10228</item_id>
    92            <document_id>c3224573-9fe3-4838-8312-62f24ea947b3</document_id>
    93        </document_items>
    94    </document>
    95    <document>
    96        <document_number>735</document_number>
    97        <name>API 2.0 - Nov.1 Test A</name>
    98        <context_id>5</context_id>
    99        <total_cost>336</total_cost>
    100        <total_tax>33.02</total_tax>
    101        <total_tax2>0</total_tax2>
    102        <total_price>412.8</total_price>
    103        <total_transactions>0</total_transactions>
    104        <issue_date>11/1/16</issue_date>
    105        <expiry_date/>
    106        <status_id>9</status_id>
    107        <id>bf237b0e-7ee1-4485-bd41-1c562b356fe1</id>
    108        <customer_id>549490bc-d880-4f1c-9c29-03d8a2d10228</customer_id>
    109        <user_id>4d76bc2e-74a0-4d5a-ae47-7439b86a92d9</user_id>
    110        <created>11/1/16, 10:04 PM</created>
    111        <modified>11/1/16, 10:04 PM</modified>
    112        <status>
    113            <id>9</id>
    114            <name>unpaid</name>
    115        </status>
    116        <context>
    117            <id>5</id>
    118            <name>invoice</name>
    119        </context>
    120        <document_items>
    121            <name/>
    122            <unit_id/>
    123            <service_category_id/>
    124            <description/>
    125            <quantity>3</quantity>
    126            <quantity_partially_received>0</quantity_partially_received>
    127            <tax>8</tax>
    128            <tax2>0</tax2>
    129            <discount_percent>0</discount_percent>
    130            <cost>36</cost>
    131            <price>48</price>
    132            <discounted_price>0</discounted_price>
    133            <weight>2</weight>
    134            <modified>11/1/16, 10:04 PM</modified>
    135            <created>11/1/16, 10:04 PM</created>
    136            <item_variations_location_id>125936</item_variations_location_id>
    137            <item_variation_data>eyJJdJpYXRpb24iOltdfX0=</item_variation_data>
    138            <id>004b50b4-1d8c-4e13-ba59-c1932e938b23</id>
    139            <item_id>54d7e8d4-d608-44f1-ad13-1523a2d10228</item_id>
    140            <document_id>bf237b0e-7ee1-4485-bd41-1c562b356fe1</document_id>
    141        </document_items>
    142        <document_items>
    143            <name/>
    144            <unit_id/>
    145            <service_category_id/>
    146            <description/>
    147            <quantity>2</quantity>
    148            <quantity_partially_received>0</quantity_partially_received>
    149            <tax>8</tax>
    150            <tax2>0</tax2>
    151            <discount_percent>0</discount_percent>
    152            <cost>72</cost>
    153            <price>84</price>
    154            <discounted_price>0</discounted_price>
    155            <weight>1</weight>
    156            <modified>11/1/16, 10:04 PM</modified>
    157            <created>11/1/16, 10:04 PM</created>
    158            <item_variations_location_id>125898</item_variations_location_id>
    159            <item_variation_data>eyJJdGVtVmFyaWF0aW9uifX1dfX0=</item_variation_data>
    160            <id>23788a45-e1eb-4747-8868-e4170ebab9e3</id>
    161            <item_id>54d7e4bb-5ec4-4aa4-a2be-7a8ca2d10228</item_id>
    162            <document_id>bf237b0e-7ee1-4485-bd41-1c562b356fe1</document_id>
    163        </document_items>
    164        <document_items>
    165            <name/>
    166            <unit_id/>
    167            <service_category_id/>
    168            <description>Tight fitting pants.</description>
    169            <quantity>1</quantity>
    170            <quantity_partially_received>0</quantity_partially_received>
    171            <tax>8</tax>
    172            <tax2>0</tax2>
    173            <discount_percent>0</discount_percent>
    174            <cost>84</cost>
    175            <price>100.8</price>
    176            <discounted_price>0</discounted_price>
    177            <weight>3</weight>
    178            <modified>11/1/16, 10:04 PM</modified>
    179            <created>11/1/16, 10:04 PM</created>
    180            <item_variations_location_id>125940</item_variations_location_id>
    181            <item_variation_data>eyJJdGVtVmFyaWdfX0=</item_variation_data>
    182            <id>7df4e593-b8cb-4bd6-8a97-9c656b161017</id>
    183            <item_id>54e7a8a2-bc94-4529-aa57-29416882ca98</item_id>
    184            <document_id>bf237b0e-7ee1-4485-bd41-1c562b356fe1</document_id>
    185        </document_items>
    186    </document>
    187    <document>
    188        <document_number>730</document_number>
    189        <name>API v2 Created Invoice 2</name>
    190        <context_id>5</context_id>
    191        <total_cost>208</total_cost>
    192        <total_tax>13.8</total_tax>
    193        <total_tax2>19.32</total_tax2>
    194        <total_price>276</total_price>
    195        <total_transactions>0</total_transactions>
    196        <issue_date>10/29/16</issue_date>
    197        <expiry_date/>
    198        <status_id>9</status_id>
    199        <id>a7d195f7-614e-4f29-b312-95b74253df14</id>
    200        <customer_id>571bb2eb-232c-4c90-99f6-05396882ca98</customer_id>
    201        <user_id>55259a96-c660-4eae-b0d8-3fb16882ca98</user_id>
    202        <created>10/30/16, 4:47 AM</created>
    203        <modified>10/30/16, 4:47 AM</modified>
    204        <status>
    205            <id>9</id>
    206            <name>unpaid</name>
    207        </status>
    208        <context>
    209            <id>5</id>
    210            <name>invoice</name>
    211        </context>
    212        <document_items>
    213            <name/>
    214            <unit_id/>
    215            <service_category_id/>
    216            <description>Comfortable dress pants.</description>
    217            <quantity>2</quantity>
    218            <quantity_partially_received>0</quantity_partially_received>
    219            <tax>5</tax>
    220            <tax2>7</tax2>
    221            <discount_percent>0</discount_percent>
    222            <cost>104</cost>
    223            <price>138</price>
    224            <discounted_price>0</discounted_price>
    225            <weight>1</weight>
    226            <modified>10/30/16, 4:47 AM</modified>
    227            <created>10/30/16, 4:47 AM</created>
    228            <item_variations_location_id/>
    229            <item_variation_data/>
    230            <id>1628c4e3-37b1-4834-86b0-4213b128a8ff</id>
    231            <item_id>55fc6df8-613c-474e-a4d9-04d16882ca98</item_id>
    232            <document_id>a7d195f7-614e-4f29-b312-95b74253df14</document_id>
    233        </document_items>
    234    </document>
    235</response>

    Updated on February 8th, 2022

    Network Status:
    100% Global Availability