Create Sub-account
This request is used to create a sub-account.
URL
POST https://api.mailpartner.fr/v1/subaccount/create
Required Parameters
apiKey
type
Type of sub-account: this choice is final and cannot be modified later
simple: – The sub-account will not receive any email or SMS. – No phone number is required. – Purchases are not allowed.
advanced: – A valid email is required. – The registration process is the same as for a standard account. – A mobile phone number will be required at signup.
parameters
email(optional): If this field is empty, an email will be generated automatically (e.g. 98755587@smspartner.fr)creditToAttribute(optional): Credit in euros added to the sub-account upon creation. This credit will be deducted from your main account's balance.title(optional): Name of the sub-accountfirstname(optional): First name of the sub-account holderlastname(optional): Last name of the sub-account holder
email: Valid email of the account holderisBuyer:1or0, if isBuyer=1 then the sub-account can purchase its own SMScreditToAttribute(optional): Credit in euros added to the sub-account upon creation. This credit will be deducted from your main account's balance.title(optional): Name of the sub-accountfirstname(optional): First name of the sub-account holderlastname(optional): Last name of the sub-account holder
Requests
<?php
// Prepare data for POST request
$fields = array(
'apiKey'=> 'YOUR API KEY',
'type'=> 'advanced',
'parameters'=>array(
'email':'aaaa@bbb.ccc',
'creditToAttribute':10,
'isBuyer':0,
'firstname':'firstname',
'lastname':'lastname'
));
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL,'https://api.mailpartner.fr/v1/subaccount/create');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS,json_encode($fields));
$result = curl_exec($curl);
curl_close($curl);
// Process your response here
echo $result;
?>Response
Errors
Error Codes
1
The API key is required
2
The phone number is required
3
isBuyer is required
4
The type is required (simple or advanced)
5
The sub-account type does not exist (simple or advanced)
6
The email is required
7
An account already exists with this email
8
creditToAttribute must be greater than 0
9
The balance must be greater than 0
200
Everything went fine!
Last updated