Distinguish Customers and Suppliers

Easily distinguish between customers and suppliers in 24SevenOffice using the `"isSupplier"` flag in the Customers object.

Welcome to the world of 24SevenOffice API, where we like to keep things simple. Whether you’re a developer or just someone curious about how our system works, this page is here to help you understand how we manage Customers and Suppliers.

Important: When referencing API endpoints in your code, be sure to use lowercase instead of camel case. While camel case is used in this article to enhance readability, it's not the format required in the actual implementation. Always refer to the API documentation to ensure correct usage before integrating it into your project.

One Object to Rule Them All

In our system, there’s no separate “Supplier” object. Nope! We have just one object called Customers. So, when you’re working with the 24SevenOffice API, all company contacts—whether they’re buying from you or selling to you—are stored as Customers.

But Wait, How Do You Know Who’s Who?

Great question! Every customer is, by default, a customer (surprise!). But some of these customers also happen to be suppliers. How do you know? Simple! Just look for the magic flag called "isSupplier".

The Magic Flag: isSupplier

In the API response, you’ll find a property called "isSupplier". If this is set to true, congratulations—you’ve got yourself a customer who is also a supplier! If it’s false, then they’re just a regular customer.

Here’s an example of what this looks like in the API:

{
"id": 12345,
"name": "ABC Corporation",
"isSupplier": false, // Just a customer
...
}

And if "isSupplier": true, like this:

{
"id": 67890,
"name": "XYZ Supplies",
"isSupplier": true, // A customer who is also a supplier
...
}

Important Note: No “Supplier Only” State

It’s important to remember that in 24SevenOffice, there’s no such thing as a “Supplier Only”. Every entry in the Customers object is always a customer first. The "isSupplier" flag just adds a layer of information indicating that they can also supply goods or services.

Filtering Out Suppliers Using the API

Want to get a list of just your suppliers? No problem! When sending a request to the /customers endpoint, simply add the parameter isSupplier=true. This will filter the results to only include customers who are also suppliers.

Example request:

 
GET /customers?isSupplier=true

This will return a list of all your suppliers, like so:

[
  {
    "id": 67890,
    "name": "XYZ Supplies",
    "isSupplier": true
  },
  {
    "id": 54321,
    "name": "Widgets Inc.",
    "isSupplier": true
  }
]

Wrap Up

So, there you have it! In 24SevenOffice, everyone is a customer, and some are also suppliers. Just keep an eye on that "isSupplier" flag, and you’ll have no trouble distinguishing between them.

Feel free to dive into our API docs for the /customers endpoint for all the details.