Brand OData

Overview

Use the Brand Odata to filter, sort, retrieve and update a brand across an Aimbase instance. This is an OData endpoint and it will support the OData query language. More information about this can be found at odata.org

Related APIs: 

  • To create a product with an Aimbase use the Product API. 
  • To filter, sort, retrieve and update a product use the Product Odata. 


Possible Response Codes

  • 200 (OK). This request was successful and information will be returned.
  • 204 (No Content). The patch was successful. 
  • 400 (Bad Request). The request is invalid.
  • 401 (Unauthorized). The token is missing, invalid, or expired.
  • 404 (Not Found). The prospect was not able to be found.
  • 500 (Internal Server Error). The request was malformed, the prospect given in the request did not exist, or some other unspecified error occurred when attempting to retrieve lead information.

Authentication

The Brand OData API requires authentication. The GET, CREATE and PATCH request will require a valid Authenticate message header with an API token. See the Aimbase Authentication API for more information on how to authenticate your request. 

Authenticate message header example:

Authenticate: Avala-Api {username}:{token}

Query Information

This OData API allows GET, CREATE and PATCH.

Endpoint for GET

GET https://{baseurl}/odata/V2/Brands

Endpoint for CREATE

POST https://{baseurl}/odata/V2/Brands

Endpoint for PATCH

PATCH https://{baseurl}/odata/V2/Brands

Brand OData Data Schema 

The information below will be returned in a GET. It can also be updated via a PATCH. 

Field Name 

Editable

Format 

Description 

Id 


 

The brand record’s identifier. 

Code

X

 

Unique brand code.

Name

X


Brand name.
IsActive

X
Indicates if the brand is active, or not.
IsDefault

X

Indicates if the brand is a default, or not.
ManufacturerCode

X
Unique manufacturer code.


Expand Options 

The product information is not included by default, but you can expand the Brand object to get product information or vice versa. When you expand, you will get additional fields related to the brand. The brand can have multiple products and they are returned in a collection under the Brand object.

Field Name 

Field Name 

Editable

Values

Description 

Id 


 

The Aimbase Id of the product.

Name


 

Product Name.

ManufacturerPlantId



The Id of the plant manufacturer.
ProductTypeId



Unique product type Id.
SkuId



The sku id.
Model



The product model name.
ModelYear

The product model year.
Code

The unique product code.
CodeOverride



DisplayOrder

The order in which the product will display on a form.
IsActive

The product is active or not.
LegacyProductKey


ApplicationContextId

Id that Indicates if the product applicable for the sales or marketing module.
CreatedDate

The date the product is created.
UpdateDate

The date the product was last updated.
CreateAccountId

The account that created the product.
UpdateAccountId


The account that last updated the product.
LegacyProductId


ProductCategoryId


The Id used for a unique product category.
BrandId

The brand's unique identifier. 
ProductCategoryCode

The code used for a unique product category.
ProductTypeCode

The code used for a unique product type.
ProductBrandCode

The code used for a unique product brand.
ManufacturerPlantCode

The code for the manufacturer plant.
SkuCode


ApplicationContextCode

The code that Indicates if the product applicable for the sales or marketing module.
Customs



Sample Queries

Get all Brands

GET http://{baseurl}/odata/V2/Brands

Get Brand by Id

GET http://{baseurl}/odata/V2/Brands(id)

Create Brand

POST https://{baseurl}/odata/V2/Brands
Content-Type: application/json
Authenticate: Avala-Api {username}:{token}


{
      "Name": "Falcon",
      "Code": "FL12",
      "IsActive":true,
      "ManufacturerCode":"ROL",
      "IsDefault":false
}


Update Brand  

PATCH https://{baseurl}/odata/V2/Brand(2)
Content-Type: application/json
Authenticate: Avala-Api {username}:{token}


{
  "Name": "Falcon XR"
  "Customs": {
     "FieldName" : "FieldValue"
  }
}


Example Response (Expanded by Product) 

{
  "@odata.context": "https://rollickqa.aimbase.com/odata/V2/$metadata#Brands/$entity",
  "Id": 3,
  "Code": "Test_264_edited",
  "Name": "ReTest_264_edited",
  "IsActive": true,
  "IsDefault": false,
  "ManufacturerCode": "ROL",
  "Products": [
    {
      "Id": 67764,
      "Name": "Product_264",
      "ManufacturerPlantId": null,
      "ProductTypeId": 11,
      "SkuId": null,
      "Model": "PROD264",
      "ModelYear": 2018,
      "Code": "264264",
      "CodeOverride": null,
      "DisplayOrder": 0,
      "IsActive": true,
      "LegacyProductKey": null,
      "ApplicationContextId": 1,
      "CreateDate": "2019-10-24T03:53:52.427-05:00",
      "UpdateDate": null,
      "CreateAccountId": 270,
      "UpdateAccountId": null,
      "LegacyProductId": null,
      "ProductCategoryId": 690,
      "BrandId": 3,
      "ProductCategoryCode": "Boats",
      "ProductTypeCode": "On-Off Road",
      "ProductBrandCode": "Test_264_edited",
      "ManufacturerPlantCode": null,
      "SkuCode": null,
      "ApplicationContextCode": "B",
      "Customs": {}
    },
    {
      "Id": 71996,
      "Name": "Uncategorized",
      "ManufacturerPlantId": null,
      "ProductTypeId": null,
      "SkuId": null,
      "Model": null,
      "ModelYear": 0,
      "Code": "Uncategorized",
      "CodeOverride": null,
      "DisplayOrder": 0,
      "IsActive": true,
      "LegacyProductKey": null,
      "ApplicationContextId": 1,
      "CreateDate": "2021-05-27T06:36:29.997-05:00",
      "UpdateDate": null,
      "CreateAccountId": 0,
      "UpdateAccountId": null,
      "LegacyProductId": null,
      "ProductCategoryId": 661,
      "BrandId": 3,
      "ProductCategoryCode": "   ",
      "ProductTypeCode": null,
      "ProductBrandCode": "Test_264_edited",
      "ManufacturerPlantCode": null,
      "SkuCode": null,
      "ApplicationContextCode": "B",
      "Customs": {}
    }
  ]
}