1. Home
  2. API v2.0
  3. Accounts
  4. Add Account

Add Account

Method: /customers.[format]

Contexts:

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

Customers Context ID: 2 Prospects Context ID: 8 Suppliers Context ID: 10

Note:
  – although the method used is named “/customers.[format]”, this works for all 3 context types
  – 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)

Fields:

Name Data Type Description
name String Business Name
office_email String Office Email Address
office_number String Office Phone Number
office_fax String Office Fax
url String Company Website Address
billing_address_1 String Billing Address Line 1
billing_address_2 String Billing Address Line 2
billing_city String Billing City
billing_region String Billing Region (Province or State)
billing_country String Billing Country
billing_postal_code String Billing Postal Code or Zip Code
shipping_address_1 String Shipping Address Line 1
shipping_address_2 String Shipping Address Line 2
shipping_city String Shipping City
shipping_region String Shipping Region (Province or State)
shipping_country String Shipping Country
shipping_postal_code String Shipping Postal Code or Zip Code

Permissions Required:

  • View Customers and/or Prospects and/or Suppliers
  • Modify Customers and/or Prospects and/or Suppliers

Syntax

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

HTTP Request Type: POST

Example JSON Data to Submit

{
  "customer":{
    "context_id":"2",
    "name":"API Created Customer",
    "office_email":"sales@acme-company.com",
    "office_phone":"(604) 555-5555",
    "office_fax":"",
    "url":"acme-company.com",
    "billing_address_1":"Suite 100 - 1234 West 4th Avenue",
    "billing_city":"Vancouver",
    "billing_region":"BC",
    "billing_country":"Canada",
    "billing_postal_code":"V6P 6W5",
    "shipping_address_1":"Suite 100 - 1234 West 4th Avenue",
    "shipping_city":"Vancouver",
    "shipping_region":"BC",
    "shipping_country":"Canada",
    "shipping_postal_code":"V6P 6W5"
  }
}

Success

If you have been successful in saving a new account, the response will return the newly created data object along with a “message” value of “Saved” as seen below.

Example JSON Returned Response

{
    "message": "Saved",
    "customer": {
        "context_id": 2,
        "name": "API Created Customer",
        "office_email": "sales@acme-company.com",
        "office_phone": "(604) 555-5555",
        "office_fax": "",
        "url": "acme-company.com",
        "billing_address_1": "Suite 100 - 1234 West 4th Avenue",
        "billing_city": "Vancouver",
        "billing_region": "BC",
        "billing_country": "Canada",
        "billing_postal_code": "V6P 6W5",
        "shipping_address_1": "Suite 100 - 1234 West 4th Avenue",
        "shipping_city": "Vancouver",
        "shipping_region": "BC",
        "shipping_country": "Canada",
        "shipping_postal_code": "V6P 6W5",
        "customer_number": 641,
        "created": "2016-11-11T01:13:09+00:00",
        "modified": "2016-11-11T01:13:09+00:00",
        "id": "19d367c8-97c7-409f-bf67-2ad543493648"
    }
}

Example XML Data to Submit

<?xml version="1.0" encoding="UTF-8" ?>
<customer>
  <context_id>2</context_id>
  <name>API Created Customer</name>
  <office_email>sales@acme-company.com</office_email>
  <office_phone>(604) 555-5555</office_phone>
  <office_fax></office_fax>
  <url>acme-company.com</url>
  <billing_address_1>Suite 100 - 1234 West 4th Avenue</billing_address_1>
  <billing_city>Vancouver</billing_city>
  <billing_region>BC</billing_region>
  <billing_country>Canada</billing_country>
  <billing_postal_code>V6P 6W5</billing_postal_code>
  <shipping_address_1>Suite 100 - 1234 West 4th Avenue</shipping_address_1>
  <shipping_city>Vancouver</shipping_city>
  <shipping_region>BC</shipping_region>
  <shipping_country>Canada</shipping_country>
  <shipping_postal_code>V6P 6W5</shipping_postal_code>
</customer>
Was this article helpful to you? Yes 1 No