curl --request POST \
--url https://api.withallo.com/v2/api/partner/accounts \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"name": "Jane Doe",
"interval": "MONTHLY",
"personal_mobile": "+33612345678",
"partner_client_ref": "crm-12345",
"number_preference": {
"country": "FR",
"prefix": "+337"
}
}
'import requests
url = "https://api.withallo.com/v2/api/partner/accounts"
payload = {
"email": "[email protected]",
"name": "Jane Doe",
"interval": "MONTHLY",
"personal_mobile": "+33612345678",
"partner_client_ref": "crm-12345",
"number_preference": {
"country": "FR",
"prefix": "+337"
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
name: 'Jane Doe',
interval: 'MONTHLY',
personal_mobile: '+33612345678',
partner_client_ref: 'crm-12345',
number_preference: {country: 'FR', prefix: '+337'}
})
};
fetch('https://api.withallo.com/v2/api/partner/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withallo.com/v2/api/partner/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => '[email protected]',
'name' => 'Jane Doe',
'interval' => 'MONTHLY',
'personal_mobile' => '+33612345678',
'partner_client_ref' => 'crm-12345',
'number_preference' => [
'country' => 'FR',
'prefix' => '+337'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.withallo.com/v2/api/partner/accounts"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"name\": \"Jane Doe\",\n \"interval\": \"MONTHLY\",\n \"personal_mobile\": \"+33612345678\",\n \"partner_client_ref\": \"crm-12345\",\n \"number_preference\": {\n \"country\": \"FR\",\n \"prefix\": \"+337\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.withallo.com/v2/api/partner/accounts")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"name\": \"Jane Doe\",\n \"interval\": \"MONTHLY\",\n \"personal_mobile\": \"+33612345678\",\n \"partner_client_ref\": \"crm-12345\",\n \"number_preference\": {\n \"country\": \"FR\",\n \"prefix\": \"+337\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/partner/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"name\": \"Jane Doe\",\n \"interval\": \"MONTHLY\",\n \"personal_mobile\": \"+33612345678\",\n \"partner_client_ref\": \"crm-12345\",\n \"number_preference\": {\n \"country\": \"FR\",\n \"prefix\": \"+337\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "usr-575966AF3661061265263C58882BC409D2A427B8",
"api_key": "b1c2...",
"phone_numbers": [
"+33712345678"
],
"status": "ACTIVE",
"activated": false,
"partner_client_ref": "crm-12345"
}
}{
"error": {}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {}
}{
"error": {}
}{
"error": {}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}Créer un compte
Creates an Allo account for one of your customers, provisions a phone number, and returns a scoped API key for the account. Requires the PARTNER scope and a Discounted licence (reseller) partner contract. The account gets its own Business plan subscription, billed to your payment method at the chosen interval with your partner discount applied. The full period is charged when the account is created, with no proration. Allo never charges your customer. This endpoint is optional: the partner portal (web.withallo.com/partner) creates accounts without code.
curl --request POST \
--url https://api.withallo.com/v2/api/partner/accounts \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"name": "Jane Doe",
"interval": "MONTHLY",
"personal_mobile": "+33612345678",
"partner_client_ref": "crm-12345",
"number_preference": {
"country": "FR",
"prefix": "+337"
}
}
'import requests
url = "https://api.withallo.com/v2/api/partner/accounts"
payload = {
"email": "[email protected]",
"name": "Jane Doe",
"interval": "MONTHLY",
"personal_mobile": "+33612345678",
"partner_client_ref": "crm-12345",
"number_preference": {
"country": "FR",
"prefix": "+337"
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
name: 'Jane Doe',
interval: 'MONTHLY',
personal_mobile: '+33612345678',
partner_client_ref: 'crm-12345',
number_preference: {country: 'FR', prefix: '+337'}
})
};
fetch('https://api.withallo.com/v2/api/partner/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withallo.com/v2/api/partner/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => '[email protected]',
'name' => 'Jane Doe',
'interval' => 'MONTHLY',
'personal_mobile' => '+33612345678',
'partner_client_ref' => 'crm-12345',
'number_preference' => [
'country' => 'FR',
'prefix' => '+337'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.withallo.com/v2/api/partner/accounts"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"name\": \"Jane Doe\",\n \"interval\": \"MONTHLY\",\n \"personal_mobile\": \"+33612345678\",\n \"partner_client_ref\": \"crm-12345\",\n \"number_preference\": {\n \"country\": \"FR\",\n \"prefix\": \"+337\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.withallo.com/v2/api/partner/accounts")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"name\": \"Jane Doe\",\n \"interval\": \"MONTHLY\",\n \"personal_mobile\": \"+33612345678\",\n \"partner_client_ref\": \"crm-12345\",\n \"number_preference\": {\n \"country\": \"FR\",\n \"prefix\": \"+337\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/partner/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"name\": \"Jane Doe\",\n \"interval\": \"MONTHLY\",\n \"personal_mobile\": \"+33612345678\",\n \"partner_client_ref\": \"crm-12345\",\n \"number_preference\": {\n \"country\": \"FR\",\n \"prefix\": \"+337\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "usr-575966AF3661061265263C58882BC409D2A427B8",
"api_key": "b1c2...",
"phone_numbers": [
"+33712345678"
],
"status": "ACTIVE",
"activated": false,
"partner_client_ref": "crm-12345"
}
}{
"error": {}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {}
}{
"error": {}
}{
"error": {}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}PARTNERintervalest requis :MONTHLYouYEARLY. Il fixe la périodicité de facturation de l’abonnement du compte.number_preference.countryest requis (code pays ISO, ex.FR) ;number_preference.prefixest optionnel (ex.+337).number_preference.esimest optionnel,falsepar défaut. Passez-le àtruepour obtenir un numéro mobile français qui peut porter une eSIM, à commander ensuite avec Commander une eSIM. Les numéros eSIM ne sont disponibles qu’en France : avec uncountryautre queFR, la requête échoue avecESIM_NOT_AVAILABLE_IN_COUNTRY.prefixs’applique toujours, par exemple7ou+337.- Un numéro est réservé avant la création du compte. Si aucun ne peut être attribué ou acheté, la requête échoue avec
NO_NUMBER_AVAILABLEet rien n’est créé. - Le compte a son propre abonnement au plan Business, facturé sur votre moyen de paiement avec votre remise partenaire appliquée. La période complète est débitée à la création du compte. Aucun débit n’est effectué sur votre client. Appelez d’abord Obtenir le prix d’un compte pour connaître le montant.
- Si votre moyen de paiement est absent ou refusé, la requête échoue avec
PARTNER_BILLING_FAILEDet rien n’est créé. - Si l’email ou le mobile personnel appartient déjà à un compte Allo, la requête échoue avec
PARTNER_ACCOUNT_ALREADY_EXISTS. - Si votre compte n’est pas un partenaire activé, la requête échoue avec
PARTNER_ACCESS_REQUIRED. Si votre contrat partenaire ne permet pas de créer des comptes, elle échoue avecPARTNER_CONTRACT_CANNOT_PROVISION. Seuls les partenaires Licence à prix réduit (revendeurs) peuvent créer des comptes.
Autorisations
Corps
Becomes the account's login.
"Jane Doe"
Billing interval of the account's own subscription, billed to your payment method.
MONTHLY, YEARLY "MONTHLY"
Show child attributes
Show child attributes
Optional. An existing mobile the new number can attach to.
"+33612345678"
Your own reference for this customer. Echoed back and on the activation webhook.
"crm-12345"
Réponse
Account created
Show child attributes
Show child attributes
Cette page vous a-t-elle été utile ?