0% found this document useful (0 votes)
483 views2 pages

API - Voucher Codes

This document describes the Webgains API 2.0 method for retrieving voucher codes. It lists the URL, required authentication using an API key, and optional parameters like programs, networks, joined status, and date. It provides example usage and describes the JSON response format including code, program, type, dates, commission, description and more.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
483 views2 pages

API - Voucher Codes

This document describes the Webgains API 2.0 method for retrieving voucher codes. It lists the URL, required authentication using an API key, and optional parameters like programs, networks, joined status, and date. It provides example usage and describes the JSON response format including code, program, type, dates, commission, description and more.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Webgains API 2.

0 - Vouchers
Method: GET
Returns a list of voucher codes for any given network, program, joined combo.

URL
http://api.webgains.com/2.0/vouchers

Authentication
This method is authenticated via an API key. The API Key can be found in the affiliate area.

Parameters

key (Required)

The API Key for the user.

programs (Optional)

A comma separated list of program id's

networks (Optional)

A comma separated list of the networks, possible values are: UK, FR, DE, NL, DK, SE, ES,
US, IE

joined (Optional)

Whether to return programs that the affiliate has joined, not joined or all. 1, 0 or blank
respectively

since (Optional)

This will limit the result set to voucher codes that were create since this date. We use the
php function 'strtotime' so you can use 'last week', 'last month', '4 months ago' etc.

callback (Optional)

For cross domain, cross browser compatibility, we support JSONP. Pass '?' when using
jQuery to ensure this works on all browsers.

Error codes

400 Bad Request

401 Authentication failed.


500 Unknown Error.

Example Usage

http://api.webgains.com/2.0/vouchers?networks=UK&programs=&joined=1&since=&key=8
e5ad0c9c7f9074d14d737ae3bb93a5f
NOTE: A handy utility to use while testing is XHR Poster which is a Chrome extention
https://chrome.google.com/webstore/detail/akdbimilobjkfhgamdhneckaifceicen

Sample Output
[{"code":"GHDPC150","programId":1383,"type":"generic","startDate":"2008-0422T00:00:00+01:00","expiryDate":"2011-1231T23:59:59+00:00","commissionType":"default","description":"The code provides 5% off
all purchases at Gardens and Homes
Direct","destinationUrl":"https:\/\/ptop.only.wip.la:443\/http\/www.gardensandhomesdirect.co.uk\/","discount":"5% off
all purchases","program_name":"Gardens and Homes
Direct","networkId":"UK","currency":"GBP"},{"code":"MowDirect20","programId":573,"type
":"generic","startDate":"2008-05-07T00:00:00+01:00","expiryDate":"2012-1231T23:59:59+00:00","commissionType":"default","description":"\u00a320 off \u00a3300
spend using MowDirect20","destinationUrl":null,"discount":"\u00a320 off \u00a3300
spend","program_name":"MowDirect?","network":"UK","currency":"GBP"}]

You might also like