Altria Service

The Altria Service provides endpoints to retrieve promotional content and SSO tokens for integration with Altria’s content delivery system.

Endpoints

Get Content

GET altria/content.json

Retrieves promotional content from Altria’s content delivery system. The content can be returned in either HTML or JSON format depending on the responsetype parameter.

The following authentication methods are allowed for this endpoint:

Query Parameters:
 
  • merchantId (Integer) – (required) Paytronix-assigned merchant ID for the merchant.
  • loyaltyid (String) – (required) Retailer’s Consumer Loyalty ID.
  • accountnumber (String) – (required) AGDC designated Retail Control Number (RCN) for an individual store or Management Account Number (MA) for a collection of individual stores managed at a hierarchy.
  • channeltype (String) – (required) The request channel. Supported values: “DT” (Desktop), “MB” (Mobile), “TB” (Tablet).
  • responsetype (String) – (required) Request format for response body. Supported values: “html” or “json”. Currently only “html” is supported, support for “json” expected by 9/17.
  • showcontentas (String) – (required) HTML response display format. Supported values: “modal” or “non-modal”.
  • retries (String) – (required) (deprecated) Number of times to retry failed requests. Will be removed 9/17.
"result": "success"
JSON Parameters:
 
  • result (String) – (required) success
  • content (String) – (required) HTML content containing the promotional offer.

Example:

{
  "result": "success",
  "content": "<div class='altria-modal-content'><h2>Save $1.00</h2><p>Save $1.00 when you buy any 2 packs of Marlboro</p><img src='https://api.insightsc3m.com/contentdelivery/assets/images/mar-dig-retail-asset-300x400-b-pi180.jpg' alt='Marlboro Offer'/></div>"
}
<div class='altria-modal-content'>
    <h2>Save $1.00</h2>
    <p>Save $1.00 when you buy any 2 packs of Marlboro</p><img
        src='https://api.insightsc3m.com/contentdelivery/assets/images/mar-dig-retail-asset-300x400-b-pi180.jpg'
        alt='Marlboro Offer' />
</div>
"result": "success"
JSON Parameters:
 
  • result (String) – (required) success
  • status (Object) – (required) See Status for format of the object.
  • baseUrl (String) – (required) URL to obtain equity image.
  • data (Array[Object]) – (required) See Data for format of the object.

Example:

{
  "result": "success",
  "status": {
    "statusCode": "0000",
    "statusMessage": "Success",
    "errorDetails": null
  },
  "baseUrl": "https://dev1-cdm.insightsc3m.com/contentdelivery",
  "data": {
    "imageId": "mar-dig-retail-asset-300x400-b-pi180",
    "imageType": "jpg",
    "offerText": "Save $1.00 when you buy any 2 packs of Marlboro",
    "imagePath": "assets/images",
    "offerValue": "1.00",
    "brandName": "Marlboro",
    "category": "Cigarette"
  }
}

Reply Objects

Status
JSON Parameters:
 
  • statusCode (String) – (required) One of: “0000” (Success), “1008” (Invalid serverDate or past date supplied), “1013” (Experience not found), “1014” (Campaign not found), “1015” (Offer not found), “1016” (Consumer info not found), “9999” (Something went wrong with API)
  • errorDetails (String) – (optional) Empty for successful calls.
  • statusMessage (String) – (required) Human-readable status message.
Data
JSON Parameters:
 
  • imageId (String) – (optional)
  • imageType (String) – (optional)
  • offerText (String) – (optional)
  • imagePath (String) – (optional)
  • offerValue (String) – (optional)
  • brandName (String) – (optional)
  • category (String) – (optional)
"result": "failure"
JSON Parameters:
 
  • result (String) – (required) failure
  • errorCode (String) – (required)
  • errorMessage (String) – (required)

Example:

{
  "result": "failure",
  "errorCode": "401",
  "errorMessage": "failed to get Altria SSO token"
}

Error Codes

The following are the possible codes and messages that can be returned by the Altria Service.

There may be other system-level errors which are not documented here.

Code Message
400 Unsupported response type
401 failed to get Altria SSO token
404 Received Altria content not found
500 Failed to get content from Altria
500 Received internal error from Altria
500 Failed to parse Altria content JSON response
500 Received unexpected Altria content HTML response
500 Received unsupported Altria content status