Skip to main content

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)​

ParameterTypeDescription
pageintegerThe page number to retrieve for pagination. Defaults to 1.
per_pageintegerThe 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)​

FieldTypeDescription
idintegerUnique identifier for the brand.
nameobjectContains the brand name in different languages.
name.arstringBrand name in Arabic.
name.enstringBrand name in English.

Response Fields (meta object)​

FieldTypeDescription
current_pageintegerThe current page number being displayed.
fromintegerThe index of the first item on the current page.
last_pageintegerThe total number of pages available.
pathstringThe base URL path for this resource.
per_pageintegerThe maximum number of items returned per page.
tointegerThe index of the last item on the current page.
totalintegerThe total number of brands available across all pages.

Error Responses​

401 Unauthorized - Authentication issues

{
"status": "error",
"message": "Unauthenticated."
}
500 Internal Server Error
{
"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.