API Documentation

    DocumentsAdd Document

    Method: /documents.[format]
    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 context is required for successfully saving a new account (see examples below)

    Document Fields:
    Name:Data Type:Description:
    customer_idStringCustomer ID
    context_idStringDetermines if it’s an estimate, invoice, or PO
    issue_dateStringThe date this document was issued (in YYYY-MM-DD format)
    shipping_addressStringThis is used when the shipping address is different than the mailing address
    Document Item Fields:
    NameData TypeDescription
    item_idStringItem ID
    descriptionStringUsed for overriding the items actual description
    quantityStringThe quantity of this item added to the order
    priceStringThe price you’re selling each unit for
    costStringOptional: The cost per unit
    taxStringOptional: Tax 1 rate for this item
    tax2StringOptional: Tax 2 rate for this item
    Permissions Required:
    • Billing Management
    • Modify Invoices and/or Modify Estimates
    Syntax:
    https://[subdomain].salesbinder.com/api/2.0/documents.json
    HTTP Request Type: POST
    Example JSON Data to Submit
    1{  
    2   "document":{  
    3      "context_id":5,
    4      "customer_id":"549490bc-d15c-433c-8e48-03d8a2d10228",
    5      "issue_date":"2017-02-08",
    6      "document_items":[  
    7         {  
    8            "quantity":2,
    9            "tax":8,
    10            "price":134,
    11            "weight":1,
    12            "item_id":"58014db1-8dd8-4133-87ca-337f6882ca98"
    13         }
    14      ]
    15   }
    16}
    Example XML Data to Submit
    1<?xml version="1.0" encoding="UTF-8" ?>
    2<document>
    3  <context_id>5</context_id>
    4  <customer_id>549490bc-d15c-433c-8e48-03d8a2d10228</customer_id>
    5  <issue_date>2017-02-08</issue_date>
    6  <document_items>
    7    <quantity>2</quantity>
    8    <tax>8</tax>
    9    <price>134</price>
    10    <weight>1</weight>
    11    <item_id>58014db1-8dd8-4133-87ca-337f6882ca98</item_id>
    12  </document_items>
    13</document>
    Success:

    If you have been successful in updating a document, the response will return the updated data object along with a “message” value of “Saved” as seen below.

    Updated on February 8th, 2022

    Network Status:
    100% Global Availability