Custom Coupon Fetching (Developer Guide)

This article covers the following material:

  1. Navigating The Coupon Fetch User Interface
  2. Choosing The Server Authentication Method
  3. Choosing The Request Type
  4. Details on Miscellaneous Options
  5. Testing API Responses

Navigating The Coupon Fetch User Interface

Start at the promotion management view, select a promotion that has a unique coupon box layer, and proceed to click through the options menu to the coupon settings.

Step 1:

Step 2:

Step 3:

Step 4:

Choosing The Server Authentication Method

Authentication types include:

  • No Auth - No authentication required for your coupon endpoint/API
  • Basic Auth - Username and Password are required for coupon endpoint/API
  • Digest Auth - Identical from UI standpoint to the Basic Authentication option.
  • Query String - Appends anything from authentication option to the query string
  • Headers - This appends anything from the authentication options to the headers of the request made to the endpoint.
  • OAuth v2 - Client ID, client secret. authorization url, and access token url are all required for this option. Once given you can 'fetch tokens' so that you can start the OAuth process to retrieve the tokens.
    • Refresh token is an optional feature.

No Authentication

Basic Authentication

Digest Authentication

Query String Authentication

Headers Authentication

OAuth v2 Authentication

Choosing The Request Type

There are 3 available request types accessible within the Custom Coupon UI interface:

  1. GET - Makes a simple GET request at your set endpoint URI
  2. POST (JSON or FORM) - With both of these post options you have the ability to send a payload, that is anything your endpoint might need in the data body to process the request.
    1. POST (JSON) - Makes a POST request with the header: content-type: application/json
    2. POST (FORM) - Makes a POST request with the header: content-type: application/x-www-form-urlendoded


Digest Authentication POST


Query String Authentication - POST


Headers Authentication - POST

Details on Miscellaneous Options

  • Single Coupon vs Bulk Coupon Type
    • This indicates whether your API/Endpoint response will be one coupon or a multitude of coupon codes

  • Code/Expire JSON mapping
    • If your response is JSON, this will be required to extract the appropriate keys from the JSON, for example: If the response result is:
      • [data: { coupon: ‘coupon_code’ }]
        Your JSON mapping would look like:

    • The same logic applies for extracting 'expiration dates'

Testing API Response

The configuration you set can be quickly tested using the 'Test Configuration' button at the bottom of the interface window. The success message reads "Configuration Works!" followed by the response from the API/Endpoint.

Tags: Auto Fetch, Bulk Coupon, Coupon, Custom Coupon, Dynamic Coupons, Fetch