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 loyalty cards

Returns a list of all your loyalty cards.
Base URL
POST: https://api4coupons.com/v3/loyalty/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 sorting asc/desc Default is sorted by createdate ascending.
Optional
<?php
	$ch = curl_init();
	$url = "https://api4coupons.com/v3/loyalty/list";
	$client_id = "XXX"; // Your API client ID (required)
	$client_secret = "YYY"; // Your API client secret (required)
	$data = [
		
	];
	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_loyaltycards": "1",
			"loyaltycards": [
				{
					"ID": "loy_123456",
					"code": "abc123",
					"url": "https://loyaltycard.mobi/ac/abc123",
					"status": "active",
					"name": "Your loyalty card",
					"type": "stampcard",
					"amount_of_stamps": "8",
					"title": "Title here",
					"description": "Description text",
					"terms_title": "Terms & Conditions",
					"terms_text": "Terms here",
					"logo": "https://hosting4images.com/upload/logo/2283_logo_180320121519.png",
					"front_image": "https://hosting4images.com/upload/loyalty/cardimages/2283_frontimage_180319103309.jpg",
					"back_image": "https://hosting4images.com/upload/loyalty/cardimages/2283_backimage_180319103317.jpg",
					"previewimage": "https://www.hosting4images.com/loyaltypreview/123456_preview.jpg",
					"last_updated": "2018-06-20 14:43:16 UTC",
					"has_locations": "true",
					"amount_of_locations": "1",
					"locations": [
						{
							"ID": "lloc_123456",
							"company_name": "Test location",
							"company_street": "Wall street 1",
							"company_zip": "10000",
							"company_city": "New York",
							"company_state": "New York",
							"company_country": "United States",
							"company_email": "info@companyname.com",
							"company_phone": "+123456789",
							"company_website": "http://www.companyname.com",
							"company_hours": "24/7",
							"company_lat": "31.072166",
							"company_long": "25.752893",
							"online": "1",
							"company_password": "1234"
						}
					]
				}
			]
		}
		

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