The Digital Coupon and External Loyalty API Client is a RESTful API Client that can be leveraged by a third party to allow CATAPULT Transaction Server and CATAPULT WebCart™ sites to interact with external digital coupon and loyalty providers.
This is not a generic RESTful API. It is an API Client that sends requests from CATAPULT Transaction Server/WebCart to a third-party-hosted service. The third-party provider is responsible for implementing and hosting endpoints that respond to these requests within 5 seconds. If the response is not received within 5 seconds, the request will be aborted and the response ignored unless otherwise noted.
Use Case 1: Digital Coupon Redemption: A retailer integrates with a third-party coupon provider. When a customer scans their loyalty card, the Point of Sale (Transaction Server) sends a transaction update to the provider. The provider responds with applicable digital coupons, which are applied to the transaction.
Use Case 2: Loyalty Points Redemption: A customer with a loyalty account adds items to their cart. The Point of Sale (Transaction Server) sends a transaction update to the loyalty provider. The provider returns optional coupons that can be redeemed using loyalty points. The cashier is prompted to apply the coupon if the customer has sufficient balance.
There are certain prerequisites and configuration details that are required to successfully implement and operate the Digital Coupon and External Loyalty API Client. Review the requirements in this section thoroughly to ensure secure, compatible integration with CATAPULT Transaction Server and WebCart systems.
These settings are configured in CATAPULT Web Office and control how Transaction Server interacts with the third-party service. They may be applied at the enterprise, store, or terminal level.
Required Advanced Settings
Conditional Advanced Settings
/coupons endpoint. If false, or not applied at all, the API will append the path speified in the imageUrl - as provided in the response to the /coupons endpoint - to the URL entered with the com.ecrsoft.tserver.genericcoup.url Advanced Setting.All image URLs provided in coupon responses are subject to the following security validations:
image/jpegimage/pngimage/gifThe base URL configured in com.ecrsoft.tserver.genericcoup.url must use HTTPS with TLS 1.2 or higher for secure API communication.
Revision Date
New
Fixes & Improvements
Endpoint:
/transaction/cancel(Redemption > GET Cancel Transaction)
/transaction/cancel endpoint fails due to the terminal experiencing a network outage, then the "Cancel" request will be reattempted later when a stable connection is restored.Enhanced Overview Section
New Requirements Section
Endpoint:
/coupons(Clipping > GET Retrieve Coupons)
Enhanced Security Requirements (Added comprehensive validation for image URLs and base URLs)
image/jpeg, image/png, and image/gifcom.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.This endpoint is used to retrieve the display data for all coupons available to a site/retailer. This data is cached in Transaction Server/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 retailer's 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) List of digital coupons with display and eligibility details. | |||||||||||||||||||||||||||||
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": [ ]
}
]
}This endpoint is 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 retailer's 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"
]
}This endpoint is used to associate/clip a coupon to a customer's card and/or unclip a coupon from the card. Typically, this endpoint is 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 retailer's coupon portal is needed. Otherwise only a stub needs to be implemented which returns an empty response.
| site required | string The site ID where coupon data should be modified. |
| 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"
]
}This endpoint is used to 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 at the Point of Sale (Transaction Server) 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 Transaction Server. |
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"
}This endpoint is used to create or update the transaction in the coupon provider's system so that Transaction Server can be informed which coupons should be applied to the transaction with the 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 Transaction Server 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 Transaction Server. However, the customer field on the result can still be used to trigger a customer association at the Point of Sale.
Non-transient updates will always be sent when the cashier totals the transaction at Transaction Server 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
}
]
}This endpoint is used to cancel a transaction that 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 Point of Sale (Transaction Server). The transaction ID could be re-used if a cashier later resumes the transaction.
If the server cannot be contacted (i.e., a network outage), and the transaction was completely voided, then the "Cancel" action will be delayed and tried periodically in the background until the action is successful.
| 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."
}
]
}This endpoint is used to 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.
If the server cannot be contacted (i.e., a network outage) during the "Commit" action, the action will be delayed and tried periodically in the background until successful.
| 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 Transaction Server (Point of Sale).
| 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. "
}
]
}