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.

Create multiple single use access URLs

Create multiple single use URL for a campaign.
Base URL
# Parameter Input Description
1 client_id API client ID Can be found in your API documentation
2 client_secret API client secret Can be found in your API documentation
3 campaign The unique ID from the campaign Can be found in the list of all campaigns.
4 amount The amount of single use codes to generate Default=10. Maximum=100000. Only digits allowed.
5 status normal, voided or activated Defaults to normal.
6 automated_codes true or false If custom validation codes should be generated, defaults to false, requires the following parameters
6.1 code_prefix the prefix of the custom validation code
6.2 code_length a number between 10 and 25 inclusive The length of the custom validation code after the prefix
6.3 code_type numeric or alphanumeric The type of the custom validation code
	$ch = curl_init();
	$url = "";
	$client_id = "XXX"; // Your API client ID (required)
	$client_secret = "YYY"; // Your API client secret (required)
	$data = [
		'campaign' => "cam_123456"
	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"
			"campaign": "cam_15111",
			"action":" multiple_single_use_codes_created",
			"data": [
					"single_use_code": "5f3jupt49d27udvwpnsar",
					"sequence_id": 18001837,
					"single_use_url": "",
					"widget_validation_code": "5f3jup",
					"custom_validation_code": "test_MPwV4DdaE",
					"expirydate": "2019-04-02 11:51:41", (only generated and shown when the status is activated)
					"create_date": "2019-04-01 11:51:41",
					"voided": "0"
					"single_use_code": "15rvagf7en5vc8nqbjqgv",
					"sequence_id": 18001838,
					"single_use_url": "",
					"widget_validation_code": "15rvag",
					"custom_validation_code": "test_AtaYhJs5p5",
					"expirydate": "2019-04-02 11:51:41",
					"create_date": "2019-04-01 11:51:41",
					"voided": "0"
					"single_use_code": "95z0iap4a4mj5q3uqfus9",
					"sequence_id": 18001839,
					"single_use_url": "",
					"widget_validation_code": "95z0ia",
					"custom_validation_code": "test_6kp0vstrgn",
					"expirydate": "2019-04-02 11:51:41",
					"create_date": "2019-04-01 11:51:41",
					"voided": "0"
Possible errors
  • 200: Missing parameter: campaign
  • 301: Invalid character in parameter: amount.
  • 301: code length must be between 3 and 30 inclusive
  • 301: Invalid character in parameter: campaign.
  • 302: code_type must be "numeric" or "alphanumeric"
  • 302: Parameter "status" has invalid value. Possible values are "normal", "voided" and "active".
  • 502: Campaign ID not found.
  • 601: low on unique generated validation codes

  • Inscrivez-vous pour un compte d'essai de 7 jours

    Commencez à utiliser Coupontools dès aujourd'hui !

C'est bien que vous soyez ici ! Des cookies ? Lisez notre déclaration de confidentialité. J'accepte