Get Companies
Retrieve a list of companies with pagination and search capabilities.
Endpoint
GET /companies
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number for pagination (defaults to 1) |
q | string | No | Search query to filter companies by name |
Request Example
curl -X GET \
"https://stream-orders-api-sandbox.herokuapp.com/client_api/v2/companies?page=1&q=Stream" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
Success Response
Status Code: 200 OK
{
"companies": [
{
"id": 2533,
"account_number": "STRNEW0013",
"account_status": "active_account",
"address": {
"id": 1075175,
"address_1": "221B Baker Street",
"address_2": "Flat 2",
"address_3": "",
"city": "London",
"classification": "business",
"company": "New Test Company",
"country_id": 232,
"email": "example@company.com",
"import_code": "IMP123456",
"latitude": null,
"longitude": null,
"name": "John Doe",
"phone": "+442079173000",
"postal_code": "NW1 6XE",
"province": "Greater London",
"summary": "United Kingdom",
"tax_number": "GB123456789",
"time_zone_id": null
},
"api_users": [
{
"id": 5474,
"email": "test@vatitstream.com"
},
{
"id": 5475,
"email": "admin@vatitstream.com"
}
],
"code": "STRNEW0013",
"currency_id": "GBP",
"name": "New Test Company"
},
{
"id": 2534,
"account_number": "DEMO0014",
"account_status": "active_account",
"address": {
"id": 1075176,
"address_1": "456 Demo Street",
"address_2": "Suite 100",
"address_3": "",
"city": "Manchester",
"classification": "business",
"company": "Demo Company Ltd",
"country_id": 232,
"email": "contact@democompany.com",
"import_code": "IMP789012",
"latitude": null,
"longitude": null,
"name": "Jane Smith",
"phone": "+441234567890",
"postal_code": "M1 1AA",
"province": "Greater Manchester",
"summary": "United Kingdom",
"tax_number": "GB987654321",
"time_zone_id": null
},
"api_users": [
{
"id": 5476,
"email": "demo@vatitstream.com"
}
],
"code": "DEMO0014",
"currency_id": "GBP",
"name": "Demo Company Ltd"
}
],
"meta": {
"page_count": 1,
"record_count": 2
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
companies | array | Array of company objects |
companies[].id | integer | Unique company identifier |
companies[].account_number | string | Company account number |
companies[].account_status | string | Current account status |
companies[].address | object | Company address information |
companies[].api_users | array | Array of API users associated with the company |
companies[].code | string | Company code |
companies[].currency_id | string | Currency for the company |
companies[].name | string | Company name |
meta | object | Pagination metadata |
meta.page_count | integer | Total number of pages |
meta.record_count | integer | Total number of records |
Notes
- Results are paginated with a default page size (10)
- The search parameter
qsearches across company name - Empty search returns all companies the authenticated user has access to
- API users array may be empty for some companies