Request Context
The request context enables you to provide PromoBadger with contextual information about the requst being made (e.g. currency code, channel ID etc.).
The Context object
Attributes
- Name
bigcommerce- Type
- Object
- Description
More Details: BigCommerceContext
- Name
talonone- Type
- Object
- Description
More Details: TalonOneContext
- Name
custom- Type
- Object
- Description
More Details: CustomContext
The Context Object
{
"bigcommerce": {
...
},
"talonone": {
...
},
"custom": {
...
}
}
The BigCommerce Context object
Attributes
- Name
channel- Type
- Integer
- Optional
- optional
- Description
The BigCommerce storefront channel ID.
- Name
currency- Type
- String
- Optional
- optional
- Description
The current BigCommerce currency code (GBP, USD, AUD etc.)
- Name
customerGroup- Type
- Integer
- Optional
- optional
- Description
The customer group of the currently logged in customer
- Name
customerOrderCount- Type
- Integer
- Optional
- optional
- Description
The total number of orders placed by the current customer
- Name
customerSegments- Type
- Array<String>
- Optional
- optional
- Description
The segment IDs for the current customer
- Name
customerShippingCountry- Type
- String
- Optional
- optional
- Description
The shipping country of the current customer. This must be a 2 character ISO country code (GB, US, AU etc.).
The BigCommerce Context Object
{
"context": {
"bigcommerce": {
"channel": 123456,
"currency": "GBP",
"customerGroup": 1,
"customerOrderCount": 10,
"customerSegments": [
"d11a030f-45e7-4fc0-833b-d5c39d34cf91",
"55980e19-2bed-499f-acf6-3d196d51dde9"
],
"customerShippingCountry": "GB"
}
}
}
The TalonOne Context object
Attributes
- Name
applicationIds- Type
- Array<Number>
- Optional
- optional
- Description
The TalonOne application IDs for the request.
The TalonOne Context Object
{
"context": {
"talonone": {
"applicationIds": [123, 456]
}
}
}
The Custom Context object
Attributes
The custom context object accepts any custom attributes that are defined in your project.
For example, the snippet shown is based on you defining a boolean isLoggedIn custom attribute in your project.
The Custom Context Object
{
"context": {
"custom": {
"isLoggedIn": true
}
}
}