Loyalty

List loyalty cards

Retrieve a list of all loyalty cards.

POST https://api.coupontools.com/v3/loyalty/list

Authentication:

API Keys

Parameters

Optional only_active true | false
When set to true, only campaigns marked as 'active' will be returned.

Example

Loading...

Response

Loading...

Get loyalty card

Retrieve loyalty card information by ID.

POST https://api.coupontools.com/v3/loyalty/info

Authentication:

API Keys

Parameters

Required loyaltycard Loyalty card ID
Can be found in the list of all loyalty cards

Example

Loading...

Response

Loading...

Possible errors

200: Missing parameter: loyaltycard
507: Loyalty card not found

Loyalty users

Create user

Create a loyalty card user.

POST https://api.coupontools.com/v3/loyaltyusers/create

Authentication:

API Keys

Parameters

Required email Email address
 
Required password Password
 
Optional phone Phone number
 
Optional first_name First name
 
Optional last_name Last name
 
Optional gender male | female | unknown
 
Optional birthday Date (format: yyyy-MM-dd)
 
Optional city City
 

Example

Loading...

Response

Loading...

Possible errors

200: You need to provide an email address.
200: You need to provide a password.

List users

Retrieve a list of all users for a loyalty card.

POST https://api.coupontools.com/v3/loyaltyusers/list

Authentication:

API Keys

Parameters

Required loyaltycard Loyalty card ID
Can be found in the list of all loyalty cards

Example

Loading...

Response

Loading...

Possible errors

301: Invalid character in parameter: loyaltycard
505: Loyalty card ID not found

Search users

Find a user based on first name, last name, email, phone or ID.

POST https://api.coupontools.com/v3/loyaltyusers/search

Authentication:

API Keys

Parameters

Required loyaltycard Loyalty card ID
Can be found in the list of all loyalty cards
Required search String
Minimum 3 characters needed in the search field. (Allowed characters: AZaZ09-_@)

Example

Loading...

Response

Loading...

Possible errors

200: Missing parameter: search
300: Search field needs to be minimum 3 characters
301: Invalid character in parameter: loyaltycard
505: Loyalty card ID not found

Update points

Update the points for a loyalty user

POST https://api.coupontools.com/v3/loyaltyusers/update

Authentication:

API Keys

Parameters

Required loyaltycard Loyalty card ID
Can be found in the list of all loyalty cards
Required user Loyalty card user ID
Can be found in the list of all loyalty cards users or with the search function
Required action add_points | add_stamps | remove_points | remove_stamps
 
Required amount Number
Amount of points/stamps
Optional merchantid Merchant/location ID
Can be found in the list of all loyalty cards.

Example

Loading...

Response

Loading...

Possible errors

200: Missing parameter: loyaltycard
200: Missing parameter: user
200: Missing parameter: action
301: Not a valid value for field amount
301: Invalid character in parameter: loyaltycard
301: Invalid character in parameter: user
306: You cannot add points to a stamp card
505: Loyalty card ID not found
506: Loyalty card user ID not found
606: The amount you're trying to add exceeds the daily limit for this merchant and card

Distribution

Send loyalty card by email

You need to have an email marketing platform connected to be able to send out marketing emails (check out: integrations -> email marketing).

POST https://api.coupontools.com/v3/send/email

Authentication:

API Keys

Parameters

Required campaign Loyalty card ID (loy_XXXXX)
Can be found in the list of all loyalty cards
Required email Email address
Email address receiving loyalty card
Optional subject String
Subject of email

Example

Loading...

Response

Loading...

Possible errors

104: No Email integration has been setup in your Coupontools account. Go to 'integrations' and 'Email marketing' to setup an Email provider
200: Missing parameter: campaign
301: Invalid character in parameter: campaign
305: Email address is not valid
502: Loyalty ID not found
604: Email not sent to 'john@doe.com'. Reason: X

Send loyalty card by text message

You need to have an SMS marketing platform connected to be able to send out SMS messages (check out: integrations -> SMS marketing).

E.164 phone number format:
First of all, in the international E.164 notation, a leading '0' is removed.
The UK mobile phone number '07911 123456' in international format is '+44 7911 123456', so without the leading zero.
Secondly, in the E.164 notation, all spaces, dashes ['-'] and parentheses [ '(' and ')'] are removed, besides the leading '+', all characters should be numeric.
Example: +447911123456

POST https://api.coupontools.com/v3/send/sms

Authentication:

API Keys

Parameters

Required campaign Loyalty ID (loy_XXXXX)
Can be found in the list of all directories
Required phone Phone number
Phone number receiving loyalty. International E.164 notation
Optional body String
SMS body text. The loyalty URL will be added to each message

Example

Loading...

Response

Loading...

Possible errors

103: No SMS integration has been setup in your Coupontools account. Go to 'integrations' and 'SMS marketing' to setup an SMS provider
200: Missing parameter: campaign
301: Invalid character in parameter: campaign
301: Phone number not valid
502: Loyalty ID not found
602: SMS not sent to 'X'. Reason: Y
605: SMS not sent to 'X'. Reason: This number is on the blacklist or opt-out list.

Notification

Send push notification

Send push notification to all users of a loyalty card. This requires the card to be added in the mobile wallet.

POST https://api.coupontools.com/v3/loyalty/pushnotification/list

Authentication:

API Keys

Parameters

Required loyaltycard Loyalty card ID (loy_XXXXXX)
Can be found in the list of all loyalty cards
Required message String
Push notification message

Example

Loading...

Response

Loading...

Possible errors

200: Missing parameter: loyaltycard
200: Missing parameter: message
301: Invalid character in parameter: loyaltycard
505: Loyalty card ID not found
507: Error sending push notification
507: 0 users have saved the Campaign