Component Search V4 API

Contents

1. Introduction

2. Client Credentials

3. Requesting Access Token using Client Credentials

3.1. Endpoint and Protocol

    3.2. Headers

    3.3. Input Parameters

    3.4. Output Parameters

    3.5. Sample Request

    3.6. Sample Response

4. Get Configured Suppliers Names

4.1. Endpoint and Protocol

4.2. Header

4.3. Output Parameters

4.4. Status Codes and Messages

4.5. Sample Request and Response

5. Initiate Pricing API

5.1. Endpoint and Protocol

5.2. Header

5.3. Input Parameters

5.4. Output Parameters

5.5. Status Codes and Messages

5.6. Sample Request and Response

6. Get Saved Pricing API

6.1. Endpoint and Protocol

6.2. Header

6.3. Input Parameters

6.4. Output Parameters

6.5. Status Codes and Messages

6.6. Sample Request and Response

7. Get UsageStatistics

7.1. Endpoint and Protocol

7.2. Header

7.3. Status Codes and Messages

7.4. Sample Request and Response

 

1. Introduction

Get pricing and availability information using Component Search API.

 

2. Client Credentials

We use OAuth 2.0 for API Authentication, we will provide ClientId and ClientSecret using which AccessToken can be generated to access our APIs.

 

3. Requesting Access Token using Client Credentials

3.1. Endpoint and Protocol

3.2. Headers

Content-Type: application/x-www-form-urlencoded

3.3. Input Parameters

The following section provides information about the parameters to be passed.

SR

Field Name

Data Type

Possible Values

Description

1

grant_type

String

client_credentials

Since we are using Client

Credentials Flow

2

Scope

String

CQPricingAPI

Name of the Scope for

which client wants Access Token

3

client_id

String

 

Will be provided by

CQ Support

4

client_secret

String

 

Will be provided by

CQ Support

 

3.4. Output Parameters

The following section provides information about the parameters in the response.

SR

Field Name

Data Type

Possible Values

Description

1

acces_token

String

 

Token Value

2

expires_in

Integer

3600

Token expiration time in

seconds

3

token_type

String

Bearer

 

3.5. Sample Request

3.6. Sample Response

The following section shows a sample response.

  • HTTP Status: 200

  • Body:

{
"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6ImEzck1VZ01Gdjl0UGNsTGE2eUYzekFrZnF1RSIsImtpZCI6ImEzck1VZ01Gdjl0UGNsTGE2eUYzekFrZnF1RSJ9.eyJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo0NDMwMC9pZGVudGl0eSIsImF1ZCI6Imh0dHBzOi8vbG9jYWxob3N0OjQ0MzAwL2lkZW50aXR5L3Jlc291cmNlcyIsImV4cCI6MTUxNDk4MTMzNiwibmJmIjoxNTE0OTc3NzM2LCJjbGllbnRfaWQiOiJlckQ1SEhGbHJnV0NMNkVTVTkyaUl6ZXRxeFFrbE5UYiIsInNjb3BlIjoiQ1FQcmljaW5nQVBJIn0.b_bOULk4tqJiOJchgynm_0pyGjy8DVXlqnoGE0TtSKbSNCLsyM0xA_U7rF6iqnkBfdt5YEaC-nMFN0T9bnZviZcQUeZ5ybFT0s2Q-kbEvcynxY-2916Llih_2Nd3d_X9sm3oN3pCx22xTJU_7jFSCy0LHMzDiPaYW-MDCYPmFwfMlxbeMTib7mITe9VCqP1JbtR0F79TtLoDuSMOYjcW_O8DMK_xiDUjPsm_j_RXVR4dqCVdPjkKz6yHqL6AzM8iNJhyEYPihXZqVyJHylutanx6baTFzHjCQpA03W509nRdUmijuHT8O5RztOlfoEJQWZ33Wks3dbZEsXPUZGBSIQ",
"expires_in": 3600,
"token_type": "Bearer"
}

 

Note: "expires_in": 3600, means bearer token will be expired in 1 hour.

 

 

 

4. Get Configured Suppliers Name

4.1. Endpoint and Protocol

4.2. Header

SR

Field Name

Data Type

Possible Values

Parameter Type

Required

Description

1

Authorization

String

Bearer ZzzZzzZzz

Header

Required

Bearer Token

2

Content-Type

String

application/json

Header

Required

 

3

ClientId

String

ZzzZzzZzz

Header

Required

ClientId

3

ClientCode

String

demo

Header

Required

ClientCode

 

4.3. Output Parameters

This section provides information about the possible parameters that can be present in the response.

SR   Field Name      Data Type      Possible Values      Description

1 Suppliers String Array "Suupliers":[. List of
{ configured
"SourceOfPrice": vendor APIs
"Mouser", for given
"APIName": "Mouser" client.
}]

 

4.4. Status Codes and Messages

  • Status Code: 200

  • Status Message: The requested resource returned.

4.5. Sample Request and Response

{
"status": 200,
"message": "Success",
"data": {
"Suppliers": [
{
"SourceOfPrice": "Mouser",
"APIName": "Mouser"
},
{
"SourceOfPrice": "Newark",
"APIName": "Newark"
},
{
"SourceOfPrice": "Arrow",
"APIName": "Arrow"
},
{
"SourceOfPrice": "DigiKey",
"APIName": "DigiKey"
}
]
},
"messageType": "Success"
}

 

5. Initiate Pricing API

This API initiates the process on the CQ cloud to start collecting pricing and availability data from all the configured vendors.

 

5.1. Endpoint and Protocol

5.2. Header

SR Field Name      Data     Possible  Parameter Required/   Descrptn         
Type Values Type Optional

1 Authorization String Bearer Header Required OAuth
ABC3SpgR Bearer
mQsS5XQb4 Token
dy91zG-ZE
5VHd8Lv4Q

2 Content-Type String application Header Required
/json

3 ClientId String ZzzZzzZz Header Required OAuth
ClientId
4 ClientCode String demo Header Required

 

5.3. Input Parameters

This section provides information about the parameters that need to be sent while invoking this API.

SR Field Name     Data    Possible    Parameter Required/  Descrptn         
Type Values Type Optional

1 ClientCode String demo Request Required Client
Body Name
provided
by CQ

2 ReferenceData Key Value Request Optional Any
Object Body Reference
Array Data which
will
return in
response
back
3 Suppliers String [{ Request Optional If any
Array "Sourceof Body supplier
Price": names
"StringValue", passed then
"APIName": only that
"StringValue" supplier
}] API will be
executed.
If left
null then
all
configured
supplier
APIs will
be executed

4 MpnDetails Mpn Mpn(string, Request Required Multiple
Array Required), Body MPN details
Qty(number, to get
optional), pricing
LineitemId for up to
(integer, 100 MPN's
optional) Per
request.


5 IncludeRaw bool true Request Optional Include RAW
Response Body response.

6 Allowzero bool true Request Optional Include zero
Pricing Body pricing records
Records

 

"AllowZeroPriceRecords" field help in excluding the zero pricing records.

Example, When "allowZeroPriceRecords": true then if any API has zero pricing records it will include in the received response and if we pass "allowZeroPriceRecords": false then only non-zero records received in response.

 

 

When pass "includeRawResponse": true then in response we get original API response on "RawResponse" field, and when we pass as "includeRawResponse": false then no data received in "RawResponse" field.

 

5.4. Output Parameters

This section provides information about the possible parameters that can be present in the response.

SR   Field Name      Data Type      Possible Values      Description

1 Requested String "RequestId": This request
"e57a9c7a-040b- id can be
464b-9c40-ce6c7 used to get
1182839" pricing
data using
next
subsequent
API.

 

5.5. Status Codes and Messages

Status Code         Status Message   

200 The request was completed successfully.
400 Bad request. Incorrect value provided.

 

5.6. Sample Request and Response

{
"ReferenceData": [{ "Key": "MyId", "Value": "1"}],
"Suppliers": [
{
"SourceOfPrice": "DigiKey",
"APIName": "DigiKey"
}
],
"MpnDetails": [
{
"Mpn": "03434",
"Qty": 110,
"LineitemId": 1,
"RefStrLineitemId": "string",
"RefStrMpnId": "string",
},
"allowZeroPriceRecords": true,
“IncludeRawResponse”:true
]
}
  • Response:

{
"status": 200,
"message": "Request queued",
"data": {
"RequestId": "4bec9f43-43c1-4c53-900f-d651528512e6"
},
"messageType": "Success"
}

 

6. Get Saved Pricing API

This API will return the collected pricing and availability information for the given request id.

 

6.1. Endpoint and Protocol

6.2. Header

SR Field Name      Data     Possible  Parameter Required/   Descrptn         
Type Values Type Optional

1 Authorization String Bearer Header Required OAuth
ABC3SpgR Bearer
mQsS5XQb4 Token
dy91zG-ZE
5VHd8Lv4Q

2 Content-Type String application Header Required
/json

3 ClientId String Ert45Ykdl Header Required OAuth
IINDN67LkT ClientId
4 ClientCode String demo Header Required

 

6.3. Input Parameters

This section provides information about the parameters that need to be sent while invoking this API.

SR Field Name    Data     Possible  Parameter Required/  Descrptn         
Type Values Type Optional

1 RequestId String Request Required RequestId
Body generated
from previous
API i.e.
initiate
pricing

2 PageSize int 100 Request Required Number of
Body pricing records
in one response

 

6.4. Output Parameters

This section provides information about the possible parameters that can be present in the response.

SR   Field Name   Data Type   Possible Values        Description

1 Completed Double 10.23 Shows percentage
Percentage of pricing
process

2 Pricings Json obj "Pricings": [ { Array of pricing
"ManufacturerName": detail object
"Apex Tool Group Mfr.",
"ManufacturerPartNumber":
"03434",
"RequestedPartNumber":
"03434",
"RequestedQty": 110,
"SupplierName": "Allied",
"Pricings": [
{
"UnitPrice": 12.06,
"QtyBreak": 12
}
],
"PriceNotes": "",
"MinimumBuy": 12,
"Multiplier": 12,
"LeadTime": null,
"CurrentStockQty": 0,
"ProductUrl":
"https://www.alliedelec.com/m/d/
aeb8bb88d84dac66e48fcd66229e2e52.pdf",
"HomePageUrl":
"https://www.alliedelec.com/",
"DataSheetUrl": null,
"Sku": "70220006",
"SupplierQuoteNo": "",
"Packaging": "",
"Authorized_Reseller": true,
"OnOrderEta": null,
"OnOrderQuantity": null,
"DockLeadTime": null,
"StandardCost": null,
"LineItemFee": null,
"Tax": null,
"NCNR": "Unknown",
"RoHS": "No",
"Region": null,
"Reeling": "Unknown",
"ModifiedDate":
"2017-12-08T14:10:27.576Z",
"Currency": "USD",
"QuotedCurrency": "USD",
"CurrencyConversionRate": 1.0,
"Obsolete": "No",
"ImagePath":
http://media.allied.com/Photos/
Panasonic%20Photos/NHG12-SERIES.jpg",
"Category": null,
"HtsCode": "",
"CountryOfOrigin": null,
"LeadStatus": "Lead Free",
"EccnCode": "",
"Tariff": "",
"Quote": null,
"RawResponse": "{\"MyPricing\":
[],\"Obsolete\":false,\"MediaLinks\":
[{\"MediaType\":\"Datasheets ..."
}
]

3 Manufacturer String Apex Tool Group Mfr Manufacturer Name
Name of given part

4 Manufacturer String 03434 Manufacturers MPN
PartNumber

5 Requested String 03434 Ref PartNumber
PartNumber from api request

6 Requested Double 110 Ref Qty from api
Qty request

7 Supplier String Allied
Name

8 Pricings Json Array "Pricings":[ Pricing cost
{ detail for given
"UnitPrice": 12.06, given Qty break
"QtyBreak": 12
}
]

9 MinimumBuy Double 12 To get this
pricing minimum
number of Qty
to buy

10 PriceNotes String Price from
supplier

11 Multiplier Double 12 Multiplier number

12 LeadTime int 1 LeadTime in day

13 Current Double 1 Stock qty
StockQty

14 Product String Product URL
URL

15 HomePage String Home Page URL
URL

16 Datasheet String Datasheet URL
URL

17 SKU String Stock keeping unit

18 Packaging String Cut | Reel Type of package

19 Authorized_ Bool true Authorized
Reseller Reseller
indicated
whether this
supplier is
authorized by
manufacturer

20 NCNR String "Unknown" | "NO" None cancelable
nonrefundable
flag

21 RoHS String RoHS flag

22 Reeling String "Unknown" Reeling type

 

6.5. Status Codes and Messages

Status Code         Status Message   

200 The request was completed successfully.

 

6.6. Sample Request and Response

{
"RequestId": "4bec9f43-43c1-4c53-900f-d651528512e6",
"PageSize": 100
}
  • Response:

{
"status": 200,
"message": "",
"data": {
"CompletedPercentage": 100,
"Pricings": [
{
"ManufacturerName": "Apex Tool Group Mfr.",
"ManufacturerPartNumber": "03434",
"RequestedPartNumber": "03434",
"RequestedQty": 110,
"SupplierName": "Allied",
"Pricings": [
{
"UnitPrice": 12.06,
"QtyBreak": 12
}
],
"PriceNotes": "",
"MinimumBuy": 12,
"Multiplier": 12,
"LeadTime": null,
"CurrentStockQty": 0,
"ProductUrl": "https://www.alliedelec.com/m/d/aeb8bb88d84dac66e48fcd66229e2e52.pdf",
"HomePageUrl": "https://www.alliedelec.com/",
"DataSheetUrl": null,
"Sku": "70220006",
"SupplierQuoteNo": "",
"Packaging": "",
"Authorized_Reseller": true,
"OnOrderEta": null,
"OnOrderQuantity": null,
"DockLeadTime": null,
"StandardCost": null,
"LineItemFee": null,
"Tax": null,
"NCNR": "Unknown",
"RoHS": "No",
"Region": null,
"Reeling": "Unknown",
"ModifiedDate": "2017-12-08T14:10:27.576Z",
"Currency": "USD",
"QuotedCurrency": "USD",
"CurrencyConversionRate": 1.0,
"Obsolete": "No",
"ImagePath": "http://media.allied.com/Photos/Panasonic%20Photos/NHG12-SERIES.jpg",
"Category": null,
"HtsCode": "",
"CountryOfOrigin": null,
"LeadStatus": "Lead Free",
"EccnCode": "",
"Tariff": "",
"Quote": null,
"RawResponse": "{\"MyPricing\":[],\"Obsolete\":false,\"MediaLinks\":[{\"MediaType\":\"Datasheets ..."
}
]
},
"messageType": "Success"
}

 

7. Get Usage Statistics

This API will give you the usage information or number of calls initiated. The 'count' field in return response give you the number of calls initiated by counting the number of MPNs and multiply with the number of suppliers within the date range passed in request body.

 

7.1. Endpoint and Protocol

7.2. Header

SR Field Name      Data     Possible  Parameter Required/   Descrptn         
Type Values Type Optional

1 Authorization String Bearer Header Required OAuth
ABC3SpgR Bearer
mQsS5XQb4 Token
dy91zG-ZE
5VHd8Lv4Q

2 Content-Type String application Header Required
/json

3 ClientId String Ert45Ykdl Header Required OAuth
IINDN67LkT ClientId
4 ClientCode String demo Header Required

 

7.3. Status Codes and Messages

Status Code         Status Message   

200 The request was completed successfully.

7.4. Sample Request and Response

{
"StartDate": "2023-10-04T01:30:28.856Z",
"EndDate": "2023-10-04T11:27:28.856Z"
}

 

  • Response:

{
"UsageCount": 9,
"LastUpdatedOn": "2023-10-04T11:42:44.6909217Z",
"Message": "Success",
"MessageType": "Success"
}

 

Note: "UsageCount" is the total number of call initiated which is counted by number of MPNs multiply with the number of suppliers included in past calls.

 

Example, if I initated call using MPN: 5014 and supplier: Digikey, Mouser, then it is counted as 2 calls.