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:

1.png

 Step 2:

2.png

Step 3:

3.png

Step 4:

4.png

 


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

5_-_no_auth.png

Basic Authentication

6_-_Basic_Auth.png

Digest Authentication

7_-_Digest_Auth.png

Query String Authentication

8_-_Query_String.png

Headers Authentication

9_-_Headers.png

OAuth v2 Authentication

10_-_Oauth2.png

 


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

 

Example:

Digest Authentication POST11_-_Disgest_Post.png

Example: 

Query String Authentication - POST

12_-_Query_Post.png

Example: 

Headers Authentication - POST

13_-_Headers_Post.png

 


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: 
      • result.0.data.coupon
    • 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.

14_-_Testing.png

 

 


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

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.