curl --request POST \
--url https://api.withallo.com/v2/api/partner/accounts/{account_id}/esims \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_number": "+33745805999",
"tier": "ESIM_20GB",
"identity": {
"corporate_name": "Plomberie Martin",
"postal_address": "12 rue de la Paix",
"postal_code": "75001",
"city": "Paris",
"first_name": "Jean",
"last_name": "Martin",
"email": "[email protected]"
}
}
'import requests
url = "https://api.withallo.com/v2/api/partner/accounts/{account_id}/esims"
payload = {
"phone_number": "+33745805999",
"tier": "ESIM_20GB",
"identity": {
"corporate_name": "Plomberie Martin",
"postal_address": "12 rue de la Paix",
"postal_code": "75001",
"city": "Paris",
"first_name": "Jean",
"last_name": "Martin",
"email": "[email protected]"
}
}
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({
phone_number: '+33745805999',
tier: 'ESIM_20GB',
identity: {
corporate_name: 'Plomberie Martin',
postal_address: '12 rue de la Paix',
postal_code: '75001',
city: 'Paris',
first_name: 'Jean',
last_name: 'Martin',
email: '[email protected]'
}
})
};
fetch('https://api.withallo.com/v2/api/partner/accounts/{account_id}/esims', 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/{account_id}/esims",
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([
'phone_number' => '+33745805999',
'tier' => 'ESIM_20GB',
'identity' => [
'corporate_name' => 'Plomberie Martin',
'postal_address' => '12 rue de la Paix',
'postal_code' => '75001',
'city' => 'Paris',
'first_name' => 'Jean',
'last_name' => 'Martin',
'email' => '[email protected]'
]
]),
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/{account_id}/esims"
payload := strings.NewReader("{\n \"phone_number\": \"+33745805999\",\n \"tier\": \"ESIM_20GB\",\n \"identity\": {\n \"corporate_name\": \"Plomberie Martin\",\n \"postal_address\": \"12 rue de la Paix\",\n \"postal_code\": \"75001\",\n \"city\": \"Paris\",\n \"first_name\": \"Jean\",\n \"last_name\": \"Martin\",\n \"email\": \"[email protected]\"\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/{account_id}/esims")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"+33745805999\",\n \"tier\": \"ESIM_20GB\",\n \"identity\": {\n \"corporate_name\": \"Plomberie Martin\",\n \"postal_address\": \"12 rue de la Paix\",\n \"postal_code\": \"75001\",\n \"city\": \"Paris\",\n \"first_name\": \"Jean\",\n \"last_name\": \"Martin\",\n \"email\": \"[email protected]\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/partner/accounts/{account_id}/esims")
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 \"phone_number\": \"+33745805999\",\n \"tier\": \"ESIM_20GB\",\n \"identity\": {\n \"corporate_name\": \"Plomberie Martin\",\n \"postal_address\": \"12 rue de la Paix\",\n \"postal_code\": \"75001\",\n \"city\": \"Paris\",\n \"first_name\": \"Jean\",\n \"last_name\": \"Martin\",\n \"email\": \"[email protected]\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "eso-2F6A1C9D4B7E8A0F3D5C6B9A1E2F4D7C8B0A3E61",
"account_id": "usr-575966AF3661061265263C58882BC409D2A427B8",
"partner_client_ref": "crm-12345",
"phone_number": "+33745805999",
"tier": "ESIM_20GB",
"status": "PROVISIONING",
"failure_code": null,
"created_at": "2026-10-14T10:05:00"
}
}{
"error": {}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {}
}{
"error": {}
}{
"error": {}
}{
"error": {}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {}
}Commander une eSIM
Orders an eSIM for one of the account’s numbers. The setup fee and the first period of the tier are charged to your payment method on file, on the subscription you pay for the account. The eSIM is returned with status PROVISIONING and is usually ready 5 to 15 minutes later: Allo then sends the partner.esim.ready webhook. A card that requires 3D Secure is refused with ESIM_PAYMENT_FAILED. Requires the PARTNER scope.
curl --request POST \
--url https://api.withallo.com/v2/api/partner/accounts/{account_id}/esims \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_number": "+33745805999",
"tier": "ESIM_20GB",
"identity": {
"corporate_name": "Plomberie Martin",
"postal_address": "12 rue de la Paix",
"postal_code": "75001",
"city": "Paris",
"first_name": "Jean",
"last_name": "Martin",
"email": "[email protected]"
}
}
'import requests
url = "https://api.withallo.com/v2/api/partner/accounts/{account_id}/esims"
payload = {
"phone_number": "+33745805999",
"tier": "ESIM_20GB",
"identity": {
"corporate_name": "Plomberie Martin",
"postal_address": "12 rue de la Paix",
"postal_code": "75001",
"city": "Paris",
"first_name": "Jean",
"last_name": "Martin",
"email": "[email protected]"
}
}
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({
phone_number: '+33745805999',
tier: 'ESIM_20GB',
identity: {
corporate_name: 'Plomberie Martin',
postal_address: '12 rue de la Paix',
postal_code: '75001',
city: 'Paris',
first_name: 'Jean',
last_name: 'Martin',
email: '[email protected]'
}
})
};
fetch('https://api.withallo.com/v2/api/partner/accounts/{account_id}/esims', 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/{account_id}/esims",
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([
'phone_number' => '+33745805999',
'tier' => 'ESIM_20GB',
'identity' => [
'corporate_name' => 'Plomberie Martin',
'postal_address' => '12 rue de la Paix',
'postal_code' => '75001',
'city' => 'Paris',
'first_name' => 'Jean',
'last_name' => 'Martin',
'email' => '[email protected]'
]
]),
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/{account_id}/esims"
payload := strings.NewReader("{\n \"phone_number\": \"+33745805999\",\n \"tier\": \"ESIM_20GB\",\n \"identity\": {\n \"corporate_name\": \"Plomberie Martin\",\n \"postal_address\": \"12 rue de la Paix\",\n \"postal_code\": \"75001\",\n \"city\": \"Paris\",\n \"first_name\": \"Jean\",\n \"last_name\": \"Martin\",\n \"email\": \"[email protected]\"\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/{account_id}/esims")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"+33745805999\",\n \"tier\": \"ESIM_20GB\",\n \"identity\": {\n \"corporate_name\": \"Plomberie Martin\",\n \"postal_address\": \"12 rue de la Paix\",\n \"postal_code\": \"75001\",\n \"city\": \"Paris\",\n \"first_name\": \"Jean\",\n \"last_name\": \"Martin\",\n \"email\": \"[email protected]\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/partner/accounts/{account_id}/esims")
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 \"phone_number\": \"+33745805999\",\n \"tier\": \"ESIM_20GB\",\n \"identity\": {\n \"corporate_name\": \"Plomberie Martin\",\n \"postal_address\": \"12 rue de la Paix\",\n \"postal_code\": \"75001\",\n \"city\": \"Paris\",\n \"first_name\": \"Jean\",\n \"last_name\": \"Martin\",\n \"email\": \"[email protected]\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "eso-2F6A1C9D4B7E8A0F3D5C6B9A1E2F4D7C8B0A3E61",
"account_id": "usr-575966AF3661061265263C58882BC409D2A427B8",
"partner_client_ref": "crm-12345",
"phone_number": "+33745805999",
"tier": "ESIM_20GB",
"status": "PROVISIONING",
"failure_code": null,
"created_at": "2026-10-14T10:05:00"
}
}{
"error": {}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {}
}{
"error": {}
}{
"error": {}
}{
"error": {}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {}
}PARTNERPROVISIONING. L’eSIM est en général prête 5 à 15 minutes plus tard, et Allo vous envoie alors le webhook partner.esim.ready.
Requête
phone_numberest requis. Ce doit être l’un des numéros du compte, créé avecnumber_preference.esimàtrue(voir Créer un compte). Tout autre numéro échoue avecPARTNER_ESIM_NUMBER_NOT_FOUNDouESIM_NOT_ELIGIBLE.tierest requis : uncoderenvoyé par Obtenir l’offre eSIM, par exempleESIM_20GB. Un code inconnu échoue avecINVALID_ESIM_TIER.holder_idest optionnel : l’utilisateur Allo auquel l’eSIM est rattachée. Omettez-le pour que le compte lui-même en soit le titulaire.identityest requis : l’entreprise à laquelle la ligne est enregistrée.corporate_name,postal_address,postal_code(5 chiffres) etcitysont requis.first_name,last_name,company_name,siret,nafetemailsont optionnels. Un champ requis manquant échoue avecESIM_IDENTITY_INCOMPLETE.
Facturation
- Les frais de mise en service et la première période du palier sont débités sur votre moyen de paiement, sur l’abonnement que vous payez pour le compte, avec votre remise partenaire appliquée. Allo ne facture jamais votre client.
- Une carte qui exige 3D Secure est refusée avec
402 ESIM_PAYMENT_FAILED, comme sur Créer un compte. Un moyen de paiement absent ou refusé échoue de la même façon. Rien ne reste en attente : mettez à jour votre moyen de paiement dans le portail partenaire, puis réessayez. - Si l’abonnement que vous payez pour le compte ne peut pas recevoir d’eSIM pour le moment, la requête échoue avec
ESIM_SUBSCRIPTION_CONFLICT. Si l’erreur indiqueretryable: true, réessayez dans quelques minutes.
Nouvelles tentatives
Envoyez un en-têteIdempotency-Key (8 à 100 lettres, chiffres, - ou _, par exemple un UUID) et réutilisez-le pour réessayer la même commande. Une nouvelle tentative avec la même clé ne vous débite pas deux fois. Une clé dans un autre format échoue avec INVALID_IDEMPOTENCY_KEY.
Erreurs propres au numéro
| Code | Signification |
|---|---|
ESIM_ALREADY_EXISTS | Le numéro a déjà une eSIM. Consultez-la avec Obtenir une eSIM. |
ESIM_ORDER_IN_PROGRESS | Une commande pour ce numéro est encore en cours de provisionnement. Attendez partner.esim.ready ou partner.esim.failed. |
ESIM_ORDER_NEEDS_SUPPORT | Une précédente commande a été débitée sans aboutir, et le support Allo la traite. Écrivez à [email protected] avant de commander à nouveau. |
PARTNER_ESIM_HOLDER_NOT_FOUND | holder_id ne peut pas détenir d’eSIM pour ce numéro. Omettez-le pour utiliser le compte. |
Autorisations
En-têtes
Optional. 8 to 100 letters, digits, - or _, for example a UUID. Retrying with the same key does not charge you twice.
^[A-Za-z0-9_-]{8,100}$Paramètres de chemin
The account id returned by Create account (usr-*).
Corps
One of the account's numbers, created with number_preference.esim set to true.
"+33745805999"
A tier code from Get eSIM offer.
"ESIM_20GB"
The business the line is registered to.
Show child attributes
Show child attributes
Optional. The Allo user the eSIM is registered to. Defaults to the account itself.
null
Réponse
eSIM ordered
Show child attributes
Show child attributes
Cette page vous a-t-elle été utile ?