The Digital Coupon and External Loyalty API Client is a RESTful API Client that can be leveraged by a third party to allow CATAPULT Point of Sale (POS) terminals and CATAPULT WebCart™ sites to interact with external digital coupon and loyalty providers.
The requests are made directly from the individual POS or WebCart terminals to a server provided by the Third-Party provider. All requests expect to receive a response within a default of 5 seconds or the request will be aborted and the response ignored unless otherwise noted.
Configuration of the POS to make calls to an implementation of this server is controlled by Advanced Settings defined within CATAPULT Web Office. These Advanced Settings can be any combination of enterprise, store, or terminal specific.
com.ecrsoft.tserver.genericcoup.url - Indicates the URL and path the POS will attempt to use to communicate with the defined service (e.g., https://your.domain.com/). Required
com.ecrsoft.tserver.genericcoup.useExternalImages
/coupons
endpoint. /coupons
endpoint - to the URL entered with the com.ecrsoft.tserver.genericcoup.url Advanced Setting.com.ecrsoft.tserver.genericcoup.siteid - The site ID to be provided in requests. Required
com.ecrsoft.tserver.genericcoup.name - The name of the digital coupon service as it is displayed in the Point of Sale (ie on a busy dialogue for slow responses.). Required
com.ecrsoft.tserver.genericcoup.username - The username to be provided as part of the basic auth credentials. Required
com.ecrsoft.tserver.genericcoup.password - The password to be provided as part of the basic auth credentials. Required
com.ecrsoft.tserver.genericcoup.sharedkey - A shared key which can optionally be provided as as field on some requests. Defaults to empty.
com.ecrsoft.tserver.genericcoup.sharedsecret - A shared secret which can optionally be provided as field on some requests. Defaults to empty.
com.ecrsoft.tserver.genericcoup.cancelPost - If true the the cancel request is sent as a POST instead of as a GET. Defaults to false
com.ecrsoft.tserver.genericcoup.selfStacking - If true then the this service allows applying multiple provided coupons/discounts to the same item, if false then the POS will apply only the best provided coupon/discount to each individual item. Defaults to false.
com.ecrsoft.tserver.genericcoup.stackingMode - Determines how coupons/discounts provided by this service stack with physical coupons. Possible options include:
com.ecrsoft.tserver.genericcoup.commitEmpty - If true then a commit is sent when the transaction ends even if no coupons/discounts were applied to the transaction. Defaults to false.
com.ecrsoft.tserver.genericcoup.abortWithoutCustomer - If true then transaction updates are not sent when no customer is associated with the transaction, and if a customer is dissociated from the transaction then a cancel request is sent. Defaults to true.
com.ecrsoft.tserver.genericcoup.sendTransientUpdates - If true then transaction update requests are sent anytime an item is added/removed/updated or a customer is associated to the transaction. Defaults to false.
com.ecrsoft.tserver.genericcoup.sendPhones - If true then transaction update requests are sent with the list of phone numbers associated with the customer. Defaults to false.
com.ecrsoft.tserver.genericcoup.sendEmails - If true then transaction update requests are requests are sent with the list of email addresses associated with the customer. Defaults to false.
com.ecrsoft.tserver.genericcoup.demographics - If true then a POST will be made to the demographics method when an attempt is made to associate an unidentified customer. Defaults to false
All image URLs provided in coupon responses are subject to the following seurity validations:
image/jpeg
image/png
image/gif
The base URL configured in com.ecrsoft.tserver.genericcoup.url
must use HTTPS with TLS 1.2 or higher for secure API communication.
Enhanced Security Requirements (Added comprehensive validation for image URLs and base URLs)
image/jpeg
, image/png
, and image/gif
com.ecrsoft.tserver.genericcoup.useExternalImages
setting to prevent enabling on prior versionsGeneral
com.ecrsoft.tserver.genericcoup.useExternalImages
.Endpoint:
/coupons
(Clipping > GET Retrieve Coupons)
com.ecrsoft.tserver.genericcoup.useExternalImages
advanced setting to support external image sources. When enabled, this setting prevents the system from prepending the com.ecrsoft.tserver.genericcoup.url
value to coupon images, allowing retailers to use images hosted at different base URLs./transaction/commit
was erroneously defined as a GET method even though it had a request body defined.Used for retrieving the display data for all coupons available to a site/retailer.
This is cached in the POS/Webcart for quick search by and display to the consumer.
This method only needs to be implemented if the ability to clip coupons/discounts via the retailers coupon portal is needed. Otherwise only a stub needs to be implemented which returns an empty response.
site required | string The ID of the site to retrieve coupons for |
Array of objects (Coupon) | |||||||||||||||||||||||||||||
Array
|
Array of objects (ErrorCode) Error Code data if an error occurred, otherwise should not be present | |||||
Array
|
{- "coupons": [
- {
- "id": "C2222",
- "shortDescription": "10% Off A Certain Soft Drink",
- "requirementDescription": "Buy One X Brand Soft Drink and get 10% Off. Valid between 7/28/16 and 7/28/17",
- "longDescription": "Buy One X Brand Soft Drink and get 10% Off. Offer not valid in certain states and provinces.",
- "category": "Beverages",
- "brand": "Brand X",
- "startDate": "2016-07-28",
- "endDate": "2017-07-28",
- "imageUrl": "/CouponImage24.jpg",
- "targeted": false,
- "enabled": true,
- "featured": false,
- "requirementUpcs": [
- 894773001193,
- 894773001049
], - "rewardUpcs": [ ]
}
]
}
Used to determine the coupons which a particular customer can or has clipped.
This method only needs to be implemented if the ability to clip coupons/discounts via the retailers coupon portal is needed. Otherwise only a stub needs to be implemented which returns an empty response.
site required | string The ID of the site to retrieve coupons for. |
customer required | string The ID of the customer to retrieve coupon metadata for. Typically a barcode from the customers card, however, it can be any arbitrary string that uniquely identifies the customer. |
available | Array of strings[ items [ 1 .. 16 ] characters ] The list of coupon ID's that are currently available to be clipped by the customer. |
clipped | Array of strings[ items [ 1 .. 16 ] characters ] The list of coupon ID's that are clipped by the customer and available to be used |
redeemed | Array of strings[ items [ 1 .. 16 ] characters ] The list of coupon ID's that have been redeemed by the customer. History should be limited to coupons redeemed at most 30 days ago. |
expired | Array of strings[ items [ 1 .. 16 ] characters ] The list of coupons ID's that were clipped by the customer but not used before expiration. History should be limited to coupons that expired at most 30 days ago. |
pending | Array of strings[ items [ 1 .. 16 ] characters ] The list of coupons that were clipped and are currently allocated to a transaction. |
Array of objects (ErrorCode) Error Code data if an error occurred, otherwise should not be present | |||||
Array
|
{- "available": [
- "2222"
], - "clipped": [
- "1",
- "2",
- "3456",
- "7890"
], - "redeemed": [
- "C3"
], - "expired": [
- "B2"
], - "pending": [
- "A1"
]
}
Used to associate/clip a coupon to a customers card and/or unclip the coupon from the card.
Usually used for a single coupon at a time but could be used for batches of coupons.
This method only needs to be implemented if the ability to clip coupons/discounts via the retailers coupon portal is needed. Otherwise only a stub needs to be implemented which returns an empty response.
site required | string The ID of the site to edit coupons for |
customer required | string The ID of the customer to edit coupons for. |
The ids of the coupons to be added and/or removed from the transaction.
add | Array of strings[ items [ 1 .. 16 ] characters ] The list of coupons ID's to add to the customers card. |
remove | Array of strings[ items [ 1 .. 16 ] characters ] The list of coupon ID's to remove from the customers card. |
added | Array of strings[ items [ 1 .. 16 ] characters ] The list of coupon ID's added to the customer. |
removed | Array of strings[ items [ 1 .. 16 ] characters ] The list of coupon ID's removed from the customer. |
Array of objects (ErrorCode) Error Code data if an error occurred, otherwise should not be present | |||||
Array
|
{- "add": [
- "A123456",
- "B654321"
], - "remove": [
- "C2222"
]
}
{- "added": [
- "A123456",
- "B654321"
], - "removed": [
- "C2222"
]
}
Look up demographic data of a customer using Phone Numbers and/or Email Addresses.
This may be used if customer association via phone number or email address is performed in the Catapult POS and no matching customer is found. A request can be made to this method to pre-populate the fields used to create a local copy of the customer within Catapult.
This method will only be called if the 'com.ecrsoft.tserver.genericcoup.demographics' advanced setting is enabled.
site required | string The ID of the site to edit coupons for |
Information known about the customer to be looked up.
phones | Array of strings[ items <= 10 characters ] A list of numeric phone numbers associated with the current customer. These are typically 10 digits. |
emails | Array of strings[ items [ 1 .. 254 ] characters ] A list of email addresses associated with the current customer. |
id required | string [ 1 .. 16 ] characters The account number or ID of a customer |
firstName | string <= 25 characters The first name of the customer if available. This field is optional and may be used to add or update records in the Catapult customer database to keep it synchronized with the provider. |
lastName | string <= 25 characters The last name of the customer if available. This field is optional and may be used to add or update records in the Catapult customer database to keep it synchronized with the provider. |
string <= 254 characters The email address of the customer if available. This field is optional and may be used to add or update records in the Catapult customer database to keep it synchronized with the provider. It may also be used to send eReceipts to the customer. | |
phone | string <= 14 characters The phone number of the customer if available. This field is optional and may be used to add or update records in the Catapult customer database to keep it synchronized with the provider. This is typically provided as 10 digits, however, common formatting and 1-digit country codes are acceptable but ignored by the POS. |
Array of objects (ErrorCode) Error Code data if an error occurred, otherwise should not be present | |||||
Array
|
Array of objects (ErrorCode) Error Code data if an error occurred, otherwise should not be present | |||||
Array
|
{- "phones": [
- "8282652907"
], - "emails": [
- "support@ecrs.com"
]
}
{- "id": "12345678901234",
- "firstName": "John",
- "lastName": "Smith",
- "email": "support@ecrs.com",
- "phone": "(123)456-7890"
}
Creates or updates the transaction in the coupon providers system so that they can tell the POS which coupons should be applied to the transaction with it's current items.
Coupons used should enter a pending state with the transaction's ID preventing their use on any other transaction unless the current transaction is cancelled or later updated to a state where the coupon would not be used. This prevents over-redemption if the same card is used at multiple locations simultaneously.
If the POS is configured to send transient updates(disabled by default), then updates will be sent with the transient field set to true any time an item is added/removed/changed or the associated customer is changed. Any AppliedCoupons returned in the response to a transient update will be ignored by the POS. However, the customer field on the result can still be used to trigger a customer association at the POS.
Non-transient updates will always be sent when the cashier totals the transaction at the POS or immediately prior to the first tender. It is possible for the cashier to make modifications to the sale following a total or partial tender, in this case a new non-transient update will be sent to the digital coupon provider before it is committed.
site required | string The ID of the site at which the transaction occurred |
customer required | string The ID of the customer performing the transaction |
transaction required | string The ID of the transaction being applied |
The new content of the transaction to be updated.
site | string The ID of the site at which the transaction was performed. | ||||||||||||
customer | string The ID of the customer to which the transaction belongs | ||||||||||||
phones | Array of strings[ items <= 10 characters ] A list of numeric phone numbers associated with the current customer. These are typically 10 digits. Must be explicitly enabled via advanced setting. | ||||||||||||
emails | Array of strings[ items [ 1 .. 254 ] characters ] A list of email addresses associated with the current customer. Must be explicitly enabled via advanced settings. | ||||||||||||
transaction | string The ID of the transaction being committed. | ||||||||||||
cashier | integer <int32> The number of the cashier ringing up this transaction as defined in CATAPULT. | ||||||||||||
terminal | integer <int32> The number of the terminal/register at which this transaction is being rung up as defined in CATAPULT. | ||||||||||||
time | string <date> The time at which the transaction update request was made on the terminal in ISO-8601 date and time format. | ||||||||||||
transientRequest | boolean A true value in this field indicates that the transaction is expected to change before the final transaction update is transmitted and this update is meant to be informational. If false then further changes to the transaction may or may not occur(the last update prior to a commit will always be false). If true any AppliedCoupon objects in the result returned for the request will be ignored. Customer responses will still be handled. | ||||||||||||
Array of objects (Item) The list of items currently on the transaction. | |||||||||||||
Array
| |||||||||||||
subTotal | number The total price of all items on the transaction. | ||||||||||||
taxTotal | number The total amount of taxes applied to the transaction. | ||||||||||||
grossTotal | number The total price of all items on the transaction including taxes. |
Array of objects (AppliedCoupon) A list of all coupon applications that should be applied to this transaction. | |||||||||||||||||||||||||||||||
Array
| |||||||||||||||||||||||||||||||
Array of objects (ReceiptLine) A list of receipt lines to be placed on the receipt. | |||||||||||||||||||||||||||||||
Array
| |||||||||||||||||||||||||||||||
object (CustomerDemographics) A description of a customer | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
Array of objects (LoyaltyBalance) An optional list of loyalty balances which are available to optional coupons within the transaction. | |||||||||||||||||||||||||||||||
Array
|
Array of objects (ErrorCode) Error Code data if an error occurred, otherwise should not be present | |||||
Array
|
{- "site": "STO1",
- "customer": "412345",
- "phones": [
- "8282652907"
], - "emails": [
- "support@ecrs.com"
], - "transaction": "1234-5678-1234",
- "cashier": 99,
- "terminal": 6,
- "time": "2018-08-13T10:15:30",
- "transientRequest": false,
- "items": [
- {
- "id": 1,
- "quantity": 2,
- "upc": 894773001193,
- "price": 1.99,
- "discountPrice": 1.49,
- "dept": 3
}
], - "subTotal": 1.49,
- "taxTotal": 0.2,
- "grossTotal": 1.69
}
{- "applied": [
- {
- "couponId": "A123456",
- "externalId": "51112456789",
- "receiptAlias": "Buy One Get One Free Dog Food",
- "reducesTax": true,
- "type": "Mfr Discount",
- "items": [
- {
- "lineId": 4,
- "discount": 1.5
}
], - "totalDiscount": 1.5,
- "optional": {
- "prompt": "Would you like to use your ABCDEFG coupon for 100 points?",
- "loyaltyId": "12345678901234",
- "loyaltyCost": 100
}
}
], - "receiptLines": [
- {
- "type": "TEXT",
- "content": " I'm a line to print on a receipt. "
}
], - "customer": {
- "id": "12345678901234",
- "firstName": "John",
- "lastName": "Smith",
- "email": "support@ecrs.com",
- "phone": "(123)456-7890"
}, - "loyaltyBalances": [
- {
- "id": "12345678901234",
- "balance": 400
}
]
}
Cancels a transaction which was previously created. This changes the status of all coupons associated with the customer back to a clipped state so that they can be used on a future transaction.
This is typically done when a transaction is either voided or suspended at the POS. The transaction ID could be re-used if a cashier later resumes the transaction.
site required | string The ID of the site at which the transaction is being cancelled |
customer required | string The ID of the customer cancelling the transaction |
transaction required | string The ID of the transaction to be cancelled |
Array of objects (ErrorCode) Error Code data if an error occurred, otherwise should not be present | |||||
Array
|
{- "errors": [
- {
- "id": "INVALID_SITE",
- "details": "My Detailed Error Message."
}
]
}
Mark all coupons in the provided list as having been redeemed.
Any coupons not in the list but marked pending for the given transaction are moved back to the clipped state.
If the coupon list is empty then all coupons currently marked as pending for the transaction should be redeemed.
site required | string The ID of the site at which the transaction is being committed |
customer required | string The ID of the customer committing the transaction |
transaction required | string The ID of the transaction to be committed |
The ID's of the coupons which were used on the transaction by the POS
site | string The ID of the site at which the transaction was performed. | ||||
customer | string The ID of the customer to which the transaction belongs | ||||
transaction | string The ID of the transaction being committed. | ||||
coupons | Array of strings[ items [ 1 .. 15 ] characters ] The list of coupons to be committed for a transaction. | ||||
Array of objects (CommitTender) The list of tenders used to close this transaction. Tenders paid into the cash drawer will be negative. | |||||
Array
|
Array of objects (ReceiptLine) A list of receipt lines to be placed on the receipt. Note: When included on the commit response instead of the transaction update response the receipt lines are not guaranteed to be applied. If the server cannot be contacted(i.e., a network outage), then the commit will be delayed and tried periodically in the background. This would result in the commit receipt lines not being available when the customers receipt is initially printed. | |||||
Array
|
Array of objects (ErrorCode) Error Code data if an error occurred, otherwise should not be present | |||||
Array
|
{- "site": "STO1",
- "customer": "412345",
- "transaction": "1234-5678-1234",
- "coupons": [
- "A123456",
- "B654321"
], - "tenders": [
- {
- "type": "CASH",
- "amount": 5.21
}
]
}
{- "receiptLines": [
- {
- "type": "TEXT",
- "content": " I'm a line to print on a receipt. "
}
]
}