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
Handling errors
1xx: authentication errors
- 1000: Invalid login credentials
- 101: Account has expired
- 102: You are trying to use subaccount credentials to manage subaccounts
- 103: Your account needs sms integration for this action
- 104: Your account needs email entegration for this action
200: Not all required parameters are provided
300 - 349: parameter has an incorrect value
- 300: Generic incorrect value error
- 301: A numeric value has an incorrect argument. Some ID's like cam_1234 count as numeric arguments.
- 302: A parameter with a predefined list of possible arguments is incorrect.
- 303: A date value is in an incorrect format or is not a valid date.
- 304: A parameter that should be unique is not.
- 305: An e-mail field is not a valid e-mail address
- 306: You are trying to add points to a loyalty stampcard or stamps to a point card
350 - 399: Errors when updating coupon sessions
Could not complete the action because a session is/some sessions are:- 354: expired
- 352: claimed
- 353: not validated
- 354: locked
- 355: voided
- 356: not locked
- 357: not void
- 358: validated
- 359: not claimed
400: unknown parameter
5xx: object not found
We did not find the- 501: template
- 502: campaign
- 503: location
- 504: teammate
- 505: loyalty card
- 506: loyalty user
- 507: directory
- 508: campaign in a directory
- 509: webhook
- 510: subaccount
- 511: kiosk
- 512: search results
- 513: coupon session
- 514: sms group
- 515: folder
6xx: other
- 601: The system detected a lot of duplicates when attempting to generate unique codes
- 602: Sms cloud not be send
- 603: You're trying to send somthing to someone who has already recieved it.
- 604: Email not send
- 605: The sms number you're trying to send to is in the opt-out list
Example succesful response
{ "status": { "status": "OK" (Succesful. There are more details added to the JSON.) } }
Example failed response
{ "status": { "status": "failed", "errors": { "error_message": "HTTP/1.0 422 Unprocessable entity.", (An error occured because of a wrong input) "error_message_description" [ "Campaign already exists in directory.", (Here you will see why an error occurred) "Missing argument: campaign." ], "error_code": [ 304, 200 ] } } }
Example response with failed authentication
{ "status": { "status": "failed", "errors": { "error_code": 1000, "error_message": "HTTP/1.0 401 Unauthorized. Client ID or Secret not correct." } } }