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.
-
Subaccount
- Retrieve a list of subaccounts
- Retrieve info of a subaccount
- Create a subaccount
- Update a subaccount
- Create password reset url for subaccount
- Single sign on for subaccounts
-
Campaign
- Retrieve a list of your campaigns
- Retrieve information from a campaign
- Retrieve all usage data from a campaign
- Retrieve all data from one coupon session
- Update data from a coupon session
- Update data from multiple coupon sessions
- Search coupon session
- Search coupon session from a campaign
- Send single push notification
- Send push notification to all
-
Loyalty Card
- Retrieve a list of your loyalty cards
- Retrieve a list of users from a loyalty card
- Update loyalty card user
- Send single push notification
- Send push notification to all
-
Directory
- Retrieve a list of your directories
- Retrieve information from a directory
- Retrieve all campaigns from a directory
- Retrieve registered users from a directory
- Update directory user payment status
- Retrieve a list of categories
- Retrieve a list of 3rd level categories
-
Single Use
- Create a single use access URL
- Create multiple single use access URLs
- Remove a single use access URL
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" } ] } ] }