API Documentation
DocumentsView 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: GETSample Returned JSON Data
1{
2 "document": {
3 "document_number": 722,
4 "name": "Sample invoice",
5 "context_id": 5,
6 "total_cost": 160,
7 "total_tax": 15.68,
8 "total_tax2": 0,
9 "total_price": 196,
10 "total_transactions": 0,
11 "issue_date": "2016-10-06T00:00:00+00:00",
12 "expiry_date": null,
13 "status_id": 9,
14 "customer_id": "549490bc-34a0-4600-ae54-03d8a2d10228",
15 "created": "2016-10-06T17:16:23+00:00",
16 "modified": "2016-10-06T17:17:21+00:00",
17 "id": "57f686e7-2c9c-439d-b113-73e96882ca98",
18 "status": {
19 "id": 9,
20 "name": "unpaid"
21 },
22 "context": {
23 "id": 5,
24 "name": "invoice"
25 },
26 "document_items": [
27 {
28 "name": null,
29 "unit_id": null,
30 "service_category_id": null,
31 "description": "",
32 "quantity": 2,
33 "quantity_partially_received": 0,
34 "tax": 8,
35 "tax2": 0,
36 "discount_percent": 0,
37 "cost": 80,
38 "price": 98,
39 "discounted_price": 0,
40 "weight": 1,
41 "modified": "2016-10-06T17:16:23+00:00",
42 "created": "2016-10-06T17:16:23+00:00",
43 "item_variations_location_id": 126324,
44 "item_variation_data": "eyJJdGVtVmFyaWF4iOltdfX0=",
45 "id": "57f686e7-4c3c-4d2e-8d3a-73e96882ca98",
46 "item_id": "54d7e076-96fc-4937-9eb8-0db0a2d10228",
47 "document_id": "57f686e7-2c9c-439d-b113-73e96882ca98"
48 }
49 ],
50 "customer": {
51 "id": "549490bc-34a0-4600-ae54-03d8a2d10228",
52 "name": "Sample Business Corp",
53 "customer_number": 527,
54 "office_email": "info@business-corp.com",
55 "office_phone": "1-800-445-8888",
56 "office_fax": "",
57 "url": "www.business-corp.com",
58 "billing_address_1": "1234 Main Street",
59 "billing_address_2": "",
60 "billing_city": "Vancouver",
61 "billing_region_id": null,
62 "billing_region": "British Columbia",
63 "billing_postal_code": "V6B 2T4",
64 "billing_country_id": null,
65 "billing_country": "Canada",
66 "shipping_address_1": "1234 Fake Street",
67 "shipping_address_2": "",
68 "shipping_city": "Vancouver",
69 "shipping_region_id": null,
70 "shipping_region": "British Columbia",
71 "shipping_postal_code": "V6B 2T4",
72 "shipping_country_id": null,
73 "shipping_country": "Canada",
74 "vat_number": "",
75 "context_id": 2,
76 "document_count": 4,
77 "tax_rate1": null,
78 "tax_rate2": null,
79 "customer_date": "2014-12-19T00:00:00+00:00",
80 "archived": false,
81 "customer_label_id": null,
82 "pricing_tier_id": "",
83 "user_id": "",
84 "modified": "2014-12-19T20:55:24+00:00",
85 "created": "2014-12-19T20:55:24+00:00"
86 }
87 }
88}
Sample Returned XML Data
1<?xml version="1.0" encoding="UTF-8" ?>
2<response>
3 <document>
4 <document_number>722</document_number>
5 <name>Sample invoice</name>
6 <context_id>5</context_id>
7 <total_cost>160</total_cost>
8 <total_tax>15.68</total_tax>
9 <total_tax2>0</total_tax2>
10 <total_price>196</total_price>
11 <total_transactions>0</total_transactions>
12 <issue_date>10/6/16</issue_date>
13 <expiry_date/>
14 <status_id>9</status_id>
15 <customer_id>549490bc-34a0-4600-ae54-03d8a2d10228</customer_id>
16 <created>10/6/16, 5:16 PM</created>
17 <modified>10/6/16, 5:17 PM</modified>
18 <id>57f686e7-2c9c-439d-b113-73e96882ca98</id>
19 <status>
20 <id>9</id>
21 <name>unpaid</name>
22 </status>
23 <context>
24 <id>5</id>
25 <name>invoice</name>
26 </context>
27 <document_items>
28 <name/>
29 <unit_id/>
30 <service_category_id/>
31 <description/>
32 <quantity>2</quantity>
33 <quantity_partially_received>0</quantity_partially_received>
34 <tax>8</tax>
35 <tax2>0</tax2>
36 <discount_percent>0</discount_percent>
37 <cost>80</cost>
38 <price>98</price>
39 <discounted_price>0</discounted_price>
40 <weight>1</weight>
41 <modified>10/6/16, 5:16 PM</modified>
42 <created>10/6/16, 5:16 PM</created>
43 <item_variations_location_id>126324</item_variations_location_id>
44 <item_variation_data>eyJJdGVtVmiOltdfX0=</item_variation_data>
45 <id>57f686e7-4c3c-4d2e-8d3a-73e96882ca98</id>
46 <item_id>54d7e076-96fc-4937-9eb8-0db0a2d10228</item_id>
47 <document_id>57f686e7-2c9c-439d-b113-73e96882ca98</document_id>
48 </document_items>
49 <customer>
50 <id>549490bc-34a0-4600-ae54-03d8a2d10228</id>
51 <name>Sample Business Corp</name>
52 <customer_number>527</customer_number>
53 <office_email>info@business-corp.com</office_email>
54 <office_phone>1-800-455-8888</office_phone>
55 <office_fax/>
56 <url>www.business-corp.com</url>
57 <billing_address_1>1234 Main Street</billing_address_1>
58 <billing_address_2/>
59 <billing_city>Vancouver</billing_city>
60 <billing_region_id/>
61 <billing_region>British Columbia</billing_region>
62 <billing_postal_code>V6B 2T4</billing_postal_code>
63 <billing_country_id/>
64 <billing_country>Canada</billing_country>
65 <shipping_address_1>1234 Main Street</shipping_address_1>
66 <shipping_address_2/>
67 <shipping_city>Vancouver</shipping_city>
68 <shipping_region_id/>
69 <shipping_region>British Columbia</shipping_region>
70 <shipping_postal_code>V6B 2T4</shipping_postal_code>
71 <shipping_country_id/>
72 <shipping_country>Canada</shipping_country>
73 <vat_number/>
74 <context_id>2</context_id>
75 <document_count>4</document_count>
76 <tax_rate1/>
77 <tax_rate2/>
78 <customer_date>12/19/14</customer_date>
79 <archived>0</archived>
80 <customer_label_id/>
81 <pricing_tier_id/>
82 <user_id/>
83 <modified>11/11/16, 12:08 AM</modified>
84 <created>12/19/14, 8:55 PM</created>
85 </customer>
86 </document>
87</response>
Updated on February 8th, 2022