1. Home
  2. API v2.0
  3. Documents
  4. View Document

View Document

Method: /documents/[id].[format]

Permissions Required:

  • Billing Management
  • View Invoices and/ View Estimates

Syntax

https://[subdomain].salesbinder.com/api/2.0/documents/[id].json

HTTP Request Type: GET

Sample Returned JSON Data

{
    "document": {
        "document_number": 722,
        "name": "Sample invoice",
        "context_id": 5,
        "total_cost": 160,
        "total_tax": 15.68,
        "total_tax2": 0,
        "total_price": 196,
        "total_transactions": 0,
        "issue_date": "2016-10-06T00:00:00+00:00",
        "expiry_date": null,
        "status_id": 9,
        "customer_id": "549490bc-34a0-4600-ae54-03d8a2d10228",
        "created": "2016-10-06T17:16:23+00:00",
        "modified": "2016-10-06T17:17:21+00:00",
        "id": "57f686e7-2c9c-439d-b113-73e96882ca98",
        "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": 80,
                "price": 98,
                "discounted_price": 0,
                "weight": 1,
                "modified": "2016-10-06T17:16:23+00:00",
                "created": "2016-10-06T17:16:23+00:00",
                "item_variations_location_id": 126324,
                "item_variation_data": "eyJJdGVtVmFyaWF4iOltdfX0=",
                "id": "57f686e7-4c3c-4d2e-8d3a-73e96882ca98",
                "item_id": "54d7e076-96fc-4937-9eb8-0db0a2d10228",
                "document_id": "57f686e7-2c9c-439d-b113-73e96882ca98"
            }
        ],
        "customer": {
            "id": "549490bc-34a0-4600-ae54-03d8a2d10228",
            "name": "Sample Business Corp",
            "customer_number": 527,
            "office_email": "info@business-corp.com",
            "office_phone": "1-800-445-8888",
            "office_fax": "",
            "url": "www.business-corp.com",
            "billing_address_1": "1234 Main Street",
            "billing_address_2": "",
            "billing_city": "Vancouver",
            "billing_region_id": null,
            "billing_region": "British Columbia",
            "billing_postal_code": "V6B 2T4",
            "billing_country_id": null,
            "billing_country": "Canada",
            "shipping_address_1": "1234 Fake Street",
            "shipping_address_2": "",
            "shipping_city": "Vancouver",
            "shipping_region_id": null,
            "shipping_region": "British Columbia",
            "shipping_postal_code": "V6B 2T4",
            "shipping_country_id": null,
            "shipping_country": "Canada",
            "vat_number": "",
            "context_id": 2,
            "document_count": 4,
            "tax_rate1": null,
            "tax_rate2": null,
            "customer_date": "2014-12-19T00:00:00+00:00",
            "archived": false,
            "customer_label_id": null,
            "pricing_tier_id": "",
            "user_id": "",
            "modified": "2014-12-19T20:55:24+00:00",
            "created": "2014-12-19T20:55:24+00:00"
        }
    }
}

Sample Returned XML Data

<?xml version="1.0" encoding="UTF-8" ?>
<response>
    <document>
        <document_number>722</document_number>
        <name>Sample invoice</name>
        <context_id>5</context_id>
        <total_cost>160</total_cost>
        <total_tax>15.68</total_tax>
        <total_tax2>0</total_tax2>
        <total_price>196</total_price>
        <total_transactions>0</total_transactions>
        <issue_date>10/6/16</issue_date>
        <expiry_date/>
        <status_id>9</status_id>
        <customer_id>549490bc-34a0-4600-ae54-03d8a2d10228</customer_id>
        <created>10/6/16, 5:16 PM</created>
        <modified>10/6/16, 5:17 PM</modified>
        <id>57f686e7-2c9c-439d-b113-73e96882ca98</id>
        <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>80</cost>
            <price>98</price>
            <discounted_price>0</discounted_price>
            <weight>1</weight>
            <modified>10/6/16, 5:16 PM</modified>
            <created>10/6/16, 5:16 PM</created>
            <item_variations_location_id>126324</item_variations_location_id>
            <item_variation_data>eyJJdGVtVmiOltdfX0=</item_variation_data>
            <id>57f686e7-4c3c-4d2e-8d3a-73e96882ca98</id>
            <item_id>54d7e076-96fc-4937-9eb8-0db0a2d10228</item_id>
            <document_id>57f686e7-2c9c-439d-b113-73e96882ca98</document_id>
        </document_items>
        <customer>
            <id>549490bc-34a0-4600-ae54-03d8a2d10228</id>
            <name>Sample Business Corp</name>
            <customer_number>527</customer_number>
            <office_email>info@business-corp.com</office_email>
            <office_phone>1-800-455-8888</office_phone>
            <office_fax/>
            <url>www.business-corp.com</url>
            <billing_address_1>1234 Main Street</billing_address_1>
            <billing_address_2/>
            <billing_city>Vancouver</billing_city>
            <billing_region_id/>
            <billing_region>British Columbia</billing_region>
            <billing_postal_code>V6B 2T4</billing_postal_code>
            <billing_country_id/>
            <billing_country>Canada</billing_country>
            <shipping_address_1>1234 Main Street</shipping_address_1>
            <shipping_address_2/>
            <shipping_city>Vancouver</shipping_city>
            <shipping_region_id/>
            <shipping_region>British Columbia</shipping_region>
            <shipping_postal_code>V6B 2T4</shipping_postal_code>
            <shipping_country_id/>
            <shipping_country>Canada</shipping_country>
            <vat_number/>
            <context_id>2</context_id>
            <document_count>4</document_count>
            <tax_rate1/>
            <tax_rate2/>
            <customer_date>12/19/14</customer_date>
            <archived>0</archived>
            <customer_label_id/>
            <pricing_tier_id/>
            <user_id/>
            <modified>11/11/16, 12:08 AM</modified>
            <created>12/19/14, 8:55 PM</created>
        </customer>
    </document>
</response>
Was this article helpful to you? Yes No