/customer/{customerId}/locations 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
getCustomerIdLocations
Code samples
const headers = {
Accept: "application/json",
};
fetch("https://goldleaf.app/api/v1/customer/{customerId}/locations", {
method: "GET",
headers: headers,
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
GET /customer/{customerId}/locations
Get customer locations
Retrieves a paginated list of active locations associated with a customer within the user's organization. Supports filtering by description, ERP ID, address line 1, city, region, postal code, and country. Access is blocked for users with the customer role.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| customerId | path | string | true | The MongoDB ObjectId of the customer |
| page | query | integer | false | Page number for pagination (default is 1) |
| locationsPerPage | query | integer | false | Number of locations to return per page (default is 10) |
| sortBy[0].key | query | string | false | Field to sort by (default is description) |
| sortBy[0].order | query | string | false | Sort order (ascending or descending, default is asc) |
| search.description | query | string | false | Filter locations by description (optional) |
| search.erpId | query | string | false | Filter locations by ERP ID (optional) |
| search.address1 | query | string | false | Filter locations by address line 1 (optional) |
| search.city | query | string | false | Filter locations by city (optional) |
| search.region | query | string | false | Filter locations by region/state (optional) |
| search.postalCode | query | string | false | Filter locations by postal code (optional) |
| search.country | query | string | false | Filter locations by country (optional) |
Enumerated Values
| Parameter | Value |
|---|---|
| sortBy[0].key | description |
| sortBy[0].key | erpId |
| sortBy[0].key | address1 |
| sortBy[0].key | city |
| sortBy[0].key | region |
| sortBy[0].key | postalCode |
| sortBy[0].key | country |
| sortBy[0].order | asc |
| sortBy[0].order | desc |
Example responses
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | A paginated list of customer locations | None |
