Get Brands
Retrieve a list of all available item brands within the Presto system.
Overview
This endpoint allows you to fetch the brands that can be associated with items. While optional, associating items with brands can enhance product information.
Endpoint Details
Method: GET
URL: /api/developer/v1/brands
Authentication: Bearer Token Required
Pagination
This endpoint supports pagination. Check the meta object in the response for pagination details. Use query parameters like ?page=2 to fetch subsequent pages.
Request Specification
Query Parameters (Optional)
| Parameter | Type | Description |
|---|---|---|
page | integer | The page number to retrieve for pagination. Defaults to 1. |
per_page | integer | The number of brands to return per page. Defaults may apply. |
Example Request
GET /api/developer/v1/brands
Authorization: Bearer <your-token>
Accept: application/json
Response Specification
Success Response (200 OK)
{
"data": [
{
"id": 1,
"name": {
"ar": "جرين كولا",
"en": "Green Cola"
}
}
// ... more brands
],
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "{{BASE_URL}}/api/developer/v1/brands",
"per_page": 100,
"to": 1,
"total": 1
}
}
Response Fields (data array objects)
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier for the brand. |
name | object | Contains the brand name in different languages. |
name.ar | string | Brand name in Arabic. |
name.en | string | Brand name in English. |
Response Fields (meta object)
| Field | Type | Description |
|---|---|---|
current_page | integer | The current page number being displayed. |
from | integer | The index of the first item on the current page. |
last_page | integer | The total number of pages available. |
path | string | The base URL path for this resource. |
per_page | integer | The maximum number of items returned per page. |
to | integer | The index of the last item on the current page. |
total | integer | The total number of brands available across all pages. |
Error Responses
401 Unauthorized - Authentication issues
{
"status": "error",
"message": "Unauthenticated."
}
{
"status":"error",
"message": "An unexpected error occurred on the server"
}
Implementation Tips
- Consider caching the brand list if needed for UI selection, although brand association might be less common than category association.
- Handle pagination if the brand list is extensive.