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 a subaccount

Create a subaccount
Base URL
POST: https://api4coupons.com/v4/subaccount/create
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
7emailEmail address
Required
8passwordPasswordIf not provided, subaccount will get password configuration email.
Optional
9packagePackage IDCan be found on the package page in your dashboard. Example: pac_XXX
Optional
10statusAccount statusDefaults to "trial", other option is "customer"
Optional
11first_nameFirst name
Optional
12last_nameLast name
Optional
13countryCountry codeAlpha-2 country code (f.e. US, FR, MX, ...)
Optional
14company_nameCompany name
Optional
15expiry_dateAccount expiry dateDate format: YYYY-MM-DD
Optional
<?php
	$ch = curl_init();
	$url = "https://api4coupons.com/v4/subaccount/create";
	$client_id = "XXX"; // Your API client ID (required)
	$client_secret = "YYY"; // Your API client secret (required)
	$data = [
		'email' => "john@doe.com",
		'password' => "Abc123"
	];
	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 success response
				{
					"status": {
						"status": "OK"
					},
					"subaccount": {
						"ID": "sub_123456",
						"status": "created",
					}
				}
				
Example error response
				{
					"status": {
						"status": "failed",
						"errors": {
							"error_message": "HTTP/1.0 422 Unprocessable entity.",
							"error_message_description": [
								"Email already exists."
							],
							"error_code": [
								304
							]
						}
					}
				}
				
Possible errors
  • 200: Missing parameter: email
  • 303: Invalid format in parameter: expiry_date. Required format: YYYY-MM-DD
  • 304: Email already exists.
  • 305: Email address is not valid.

  • 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
x