Coupontools Logo

API & Webhooks

Connect the Coupontools platform with your apps or web projects. The Coupontools REST API allows you to query meta-data about your account, campaigns, distribution, validations, and usage data.

Retrieve a list of your campaigns

Returns a list of all your campaigns.
Base URL
POST: https://api4coupons.com/v3/coupon/list
Parameters
# Parameter Input Description
1 client_id API client ID Can be found in your API documentation
Required
2 client_secret API client secret Can be found in your API documentation
Required
3 only_active true/false When set to true, only campaigns marked as 'active' will be returned.
Optional
4 show_deleted true/false Default does not show deleted coupons (deleted coupons are permanently deleted once a week).
Optional
5 sorting asc/desc Default is sorted by createdate ascending.
Optional
6 tags The coupon tags If given, the api will only return coupons of that tag
Optional
7 category The coupon_category number If given, the api will only return coupons of that category
Optional
8 country The company_country of a location If given, the api will only return coupons and locations in the specified country
Optional
9 folder Folder ID If given, the api will only return coupons in the specified folder
Optional
10 directory directory ID or code If given, the api will only return coupons associated with the specified directory
Optional
<?php
	$ch = curl_init();
	$url = "https://api4coupons.com/v3/coupon/list";
	$client_id = "XXX"; // Your API client ID (required)
	$client_secret = "YYY"; // Your API client secret (required)
	$data = [
		'only_active' => true
	];
	curl_setopt($ch, CURLOPT_URL, "$url");
	curl_setopt($ch, CURLOPT_POST, true);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_VERBOSE, true);
	curl_setopt($ch, CURLOPT_HTTPHEADER, [
		"X-Client-Id: $client_id",
		"X-Client-Secret: $client_secret",
		"Content-Type: application/json",
	]);
	curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
	$response = curl_exec($ch);
?>
Example response
				{
					"status": {
						"status": "OK"
					},
					"amount_of_campaigns": "1",
					"coupon_info": [
						{
							"ID": "cam_123456",
							"code": "tn91r7",
							"url": "https://digicpn.com/p/tn91r7",
							"status": "active", (example | active | archived | template | deleted)
							"subaccount": "sub_12345",
							"timezone": "America/New_York",
							"expirydate": "2018-01-01 04:59:00", (UTC)
							"name": "API EXAMPLE CAMPAIGN",
							"title": "Coupon title",
							"subtitle": "Coupon subtitle",
							"description": "Coupon description content goes here",
							"terms": "Coupon full terms and conditions goes here",
							"terms_short": "Coupon short terms and conditions goes here",
							"poweredby": "MyName",
							"poweredbylink": "http://www.mywebsite.com",
							"coupon_tags": "Coupon,tags,here",
							"coupon_category": "1",
							"coupon_category_name": "Other",
							"logo_url": "http://hosting4images.com/logohere.png",
							"coupon_image": "https://hosting4images.com/upload/basic_couponphoto.jpg",
							"banner1": "https://www.hosting4images.com/preview/tn91r7_120-600.jpg",
							"banner2": "https://www.hosting4images.com/preview/tn91r7_140-112_20170729113501.jpg",
							"banner3": "https://www.hosting4images.com/preview/tn91r7_180-270_20170729113501.jpg",
							"banner4": "https://www.hosting4images.com/preview/tn91r7_200-150.jpg",
							"banner5": "https://www.hosting4images.com/preview/tn91r7_200-600.jpg",
							"locations": [
								{
									"ID": "loc_12345",
									"company_name": "Redeem location 1",
									"company_email": "info@redeemlocation.com",
									"company_phone": "+1234567890",
									"company_password": "328644",
									"company_street": "Street",
									"company_zip": "Zip",
									"company_city": "City",
									"company_state": "State",
									"company_country": "Country",
									"company_lat": "38.716574",
									"company_long": "-90.307032",
									"company_hours": "9AM - 22PM"
								},
								{
									"ID": "loc_7890"
									"company_name": "Redeem location 2"
									"company_email": "info@redeemlocation.com"
									"company_phone": "+1234567890"
									"company_password": "302230"
									"company_street": "Another Street"
									"company_zip": "Zip"
									"company_city": "Another City"
									"company_state": "State"
									"company_country": "Country"
									"company_lat": "41.162125"
									"company_long": "-81.544573"
									"company_hours": "10AM-23PM"
								}
							],
							(following three are only shown when the campaign is configured to generate codes)
							"code_prefix": "pf_",
							"code_length": "20",
							"code_type": "alphanumeric"
						}
					]
				}
				
Possible errors
  • 507: Directory not found
  • 515: Folder not found

  • Regístrate ahora para una cuenta de prueba por 7 días

    ¡Empieza a usar Coupontools hoy!

¡Genial, estás aquí! ¿Cookies? Lee nuestrasPolíticas de Privacidad. Yo acepto
x