/customers v1.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Base URLs:
Customers
getCustomers
Code samples
const headers = {
Accept: "application/json",
};
fetch("https://goldleaf.app/api/v1/customers", {
method: "GET",
headers: headers,
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
GET /customers
Gets customers
Retrieves customers for the current organization, optionally filtered by name, ERP ID, or domain.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| search.name | query | string | false | Name to search for. |
| search.erpId | query | string | false | ERP ID to search for. |
| search.domain | query | string | false | Domain to search for. |
Example responses
200 Response
{
"type": "object",
"properties": {
"items": {
"type": "array",
"items": false
},
"total": {
"type": "integer",
"example": 3
},
"page": {
"type": "integer",
"example": 1
}
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | A list of customers (may be empty). | Inline |
| 500 | Internal Server Error | Server error | Inline |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » items | array | false | none | none |
| »» anonymous | any | false | none | none |
| » total | integer | false | none | none |
| » page | integer | false | none | none |
Status Code 500
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | false | none | none |
