Query Products by Criteria

Introduction

This API returns a list of product summary entities for the subset of products that meet the specified criteria and cursor view parameters.

Method

Service Name

Service Type

GET

productManagement/v1/products

Synchronous

URI: https://api.blackhawknetwork.com/productManagement/v1/products?{summary|details}.{attributeName}={attributeValue}&first={firstIndex}&maximum={maximumResults}&sortKey={attributeName}&ascending={true|false}&{exactMatch}={true|false}&{caseSensitive}={true|false}

Request Header Attributes

Note that all three of the header attributes are optional; however, if you want idempotency support then you should specify all three on every request.

Parameter

Description

Type

Required

requestorId

A value defined by the client application that can be used to uniquely identify that client application. If the client application does not specify a value, a globally unique identifier will be filled in automatically.

String

N

requestId

A value defined by the client application that can be used to uniquely identify that specific request from the client. This value should be set if the client application wants to take advantage of an idempotent operation on a service.

String

N

previousAttempts

The number of times this same request has been attempted unsuccessfully before. A value that is greater than zero will cause the service to view this request as a retry attempt and it will be treated idempotently.

Integer

N

In our example we will be sending the following values in the header:

Content-Type: application/json
requestorId: 1234
requestId: 2019-06-12T15:35:28-0500
previousAttempts: 0

Request Elements

Since this is a get request the request elements need to be sent in the URI itself. https://api.blackhawknetwork.com/productManagement/v1/products?{summary|details}.{attributeName}={attributeValue}&first={firstIndex}&maximum={maximumResults}&sortKey={attributeName}&ascending={true|false}&{exactMatch}={true|false}&{caseSensitive}={true|false}

The following parameters are available:

Parameter

Description

Type

Required

first

The index of the first entity in this cursor view of the list.

The default first index is zero referring to the first entity in the full list.

Integer
String

N

maximum

The maximum number of entities to be shown in this cursor view of the list. The default value is 10.

Integer
String

N

sortKey

The name of the attribute that should be used for ordering the results. If this value is not provided, then there is no explicit sorting of the results.

Only attributes in product summary can be used for ordering the results.

String

N

ascending

Whether or not the results are sorted in ascending order. The default value is true.

Boolean
String

N

exactMatch

Flag to exactly match the provided supported features.

Boolean

N

caseSensitive

Flag to exactly match the case of the supported features.

Boolean

N

Response Elements

The following elements are returned in the response.

Name

Description

Type

productSummaryList

List of matching product summary entities.

List

total

Total count returned from the query.

Integer

parameters

The Request Elements specified in the request or their default values if none specified.

List

Product Summary

Name

Description

Type

Max Length

Mandatory

entityId

A reference to the URI for the product.

URI

N

productName

The name of the product

String

255

Y

currency

The currency of the product

Currency

N

universalProductCode

The UPC of the product

String

50

Y

productLineId

The product line id of the product

Integer

Y

startDate

The date from which the product becomes active

Date

Y

endDate

The date at which the product becomes inactive

Date

N

locale

The two characters ISO 639-1 language code and 2 characters for the country code (separated by an underscore). eg: en_US

Locale

5

N

Sample Request and Response

Click on the tabs below to see a sample GET request and the sample response.

GET /productManagement/v1/products?summary.productName=Safeway/1.1
requestorID: ZPZB7DDS20PNHALMZCBX14RVCM
Content-Type: application/json; charset=UTF-8
Accept: application/json; charset=UTF-8
Host: api.blackhawknetwork.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.2 (java 1.5)
HTTP/1.1 200 OK
Date: Fri, 06 Jul 2012 22:31:51 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 2027
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive

{
   "results":[
          {
         "entityId":"http://api.blackhawknetwork.com/productManagement/v1/product/TESAN6ALP15AVT87BKPRVFVFS8",
         "productName":"Safeway",
         "productLineId":"https://api.blackhawknetwork.com/productManagement/v1/productLine/U94AN6ALP15AVT87BKPRVFVFS8",
         "currency":"USD",
         "universalProductCode":"987654",
         "startDate":"2012-09-27T19:14:45.000+0000",
         "endDate":"2018-09-27T19:14:45.000+0000"
      } 
   ],
   "total":2
}

Did this page help you?