Wildfire APIs
Coupon Data JSON Structure
7min
introduction this document provides an overview of the json structure used to store coupon data for various merchant websites the json file contains information about coupon codes and css selectors used for auto applying coupons on specific merchant websites usage the json data is used to facilitate wildfire partners to deliver custom coupon codes to our extensions the extension will retrieve this data on a regular cadence in order to include your custom coupon codes and targets into your extension the codes section provides a list of available coupon codes, while the targets section provides css selectors for automating coupon application on websites that are not yet supported json structure the json file is organized into an object where each key represents a merchant website's domain name the structure consists of two primary sections codes this section contains an array of coupon codes associated with the merchant website targets (optional) this section contains an array of css selectors that are used to automatically apply coupons on the merchant website the targets object is only needed if wildfire doesn’t already support this domain and auto coupon application is desired example below is an example of the json structure { "merchant domain 1 com" { "codes" \[ { "id" 1, "code" "save15" }, { "id" 2, "code" "freeship" }, { "id" 3, "code" "25off" } ], "targets" \[ { "input" "#coupon input", "price" " total price", "submit" " apply button", "remove" " remove button", "error" " error message", "before" " before coupon action" } ] }, "merchant domain 2 com" { "codes" \[ { "id" 4, "code" "discount4" }, { "id" 5, "code" "savings5" } ] }, // additional merchant domains } code section the codes section for each merchant domain contains an array of coupon objects each coupon object consists of id a unique identifier for the coupon code the actual coupon code targets section the targets section for each merchant domain contains an array of target objects each target object consists of css selectors used for specific actions input the selector for the coupon input field (i e a text input element) price the selector for the price or total amount on the webpage note this should be the total including the tax and shipping as some coupons will result in free shipping submit the selector for the submit button to apply the coupon remove the selector for the remove or cancel button to remove the coupon (if present, some merchants don’t include this functionality, in which case this value should remain empty) error the selector for any error messages that may appear (i e to describe a code as invalid for the contents of a specific shopping cart) before this is an optional selector for when the user must interact with an element to make the coupon input field visible note this json structure is adaptable and can be extended to accommodate additional merchant domains as needed it is essential to keep this json file updated with the latest coupon codes and target selectors to ensure proper functionality across various merchant websites