WeSIMTech Bayi (Reseller) API
Bağlı tüm ağ kaynaklarındaki eSIM ürünlerini kendi markanızla satın: hesabınıza özel fiyat, hesap para biriminde tahsilat, ön ödemeli bakiye ve cari (açık hesap), test/canlı ortam, idempotent sipariş, ücretli yükleme, iptal iadesi ve imzalı webhook. Bu sayfadaki 40 uç, sırayla entegrasyon akışını izler.
Hızlı başlangıç (15 dakika)
- Bayi panelinden test anahtarı üretin (
wsm_test_…). Test siparişleri ücretlendirilmez, anında sahte profillerle teslim edilir. POST /auth/testile anahtarı, yetkileri ve IP allowlist'i doğrulayın.GET /packages?country=DEile katalogdan fiyatınızı görün;POST /quotesile toplamı ve bakiye yeterliliğini alın.- Benzersiz
Idempotency-Keyve teklifteki fiyatımax_unit_priceolarak göndererekPOST /ordersçağırın. order.deliveredwebhook'unu dinleyin ya daGET /orders/{reference}ileprofiles[].activation_code(LPA) alın.- Canlıya geçmek için aynı kodu
wsm_live_…anahtarıyla çalıştırın.
curl -X POST "https://wesim.tech/api/v1/auth/test" \
-H "Authorization: Bearer wsm_test_YOUR_KEY"
curl "https://wesim.tech/api/v1/packages?country=DE&limit=20" \
-H "Authorization: Bearer wsm_test_YOUR_KEY"
curl -X POST "https://wesim.tech/api/v1/orders" \
-H "Authorization: Bearer wsm_test_YOUR_KEY" \
-H "Idempotency-Key: ord-0001" \
-H "Content-Type: application/json" \
-d '{"package_id":"EU-42_3_30","quantity":1,"client_reference":"ERP-1001","max_unit_price":10.55}'
Kimlik doğrulama ve ortamlar
Authorization: Bearer wsm_live_… (ya da X-API-Key). Anahtar yalnız üretildiği an gösterilir; sunucuda karması saklanır.
wsm_test_ sandbox, wsm_live_ gerçek teslimat ve tahsilat. Kayıtlar ortamlar arasında görünmez.
Her uç bir yetki ister (aşağıda her ucun yanında). Eksikse 403 insufficient_scope.
Anahtarda HMAC zorunluysa: X-WSM-Timestamp, X-WSM-Request-Id, X-WSM-Signature: sha256=… = HMAC_SHA256(secret, METHOD\nURI\nTS\nREQUEST_ID\nsha256(gövde)). 5 dk pencere, request ID tekrar kullanılamaz.
Anahtara IP/CIDR listesi tanımlıysa diğer IP'ler 403 access_denied alır.
{"success":true,"data":…,"meta":{"request_id","api_version","environment","timestamp"}}. Destek talebinde X-Request-ID bildirin.
Bakiye ve cari (açık hesap) kuralı
Harcanabilir tutar = cüzdan bakiyesi + kullanılabilir cari. Cari, yalnız hesabınızda cari satış izni açıksa ve cari blokeli değilse kullanılır. Cüzdan bakiyesi negatife inebilir; negatif kısım kullanılan caridir.
- Canlı sipariş ve yükleme tutarı istek anında, hesap kilitlenerek düşülür. Aynı anda gelen istekler bakiyeyi aşamaz.
- Yetmezse 402
insufficient_balancedöner; sipariş/yükleme oluşmaz, tahsilat yapılmaz.error.details:required_amount,available_to_spend,shortfall,Valuta,credit_enabled,credit_status. - Tüm fiyat ve tutarlar hesabınızın para birimindedir. Kur doğrulanamazsa satış yapılmaz (503
fx_unavailable). - Teslim edilemeyen adet, başarısız sipariş, reddedilen yükleme ve kabul edilen iptal otomatik iade edilir. Tüm hareketler
GET /account/ledger'da.
{
"success": false,
"error": {
"code": "insufficient_balance",
"message": "Yetersiz bakiye: bu işlem için 52.40 USD gerekiyor, kullanılabilir tutar 20.00 USD. Hesabınızda cari satış izni yok; bakiye yükleyin.",
"details": {
"context": "Sipariş B2B-…",
"currency": "USD",
"required_amount": 52.4,
"available_to_spend": 20,
"shortfall": 32.4,
"wallet_balance": 20,
"credit_enabled": false,
"credit_status": "active"
},
"documentation_url": "/api-docs#errors"
},
"meta": {
"request_id": "req_…",
"api_version": "v1"
}
}
Idempotency ve fiyat koruması
POST /orders e POST /esims/{iccid}/topups Idempotency-Key başlığı ister. Zaman aşımında aynı anahtarla tekrar deneyin: aynı gövde ilk yanıtı döndürür (çift sipariş/çift tahsilat olmaz); aynı anahtar farklı gövdeyle 409 döner. Anahtarlar 24 saat saklanır.
Fiyat koruması: teklifteki fiyatı max_unit_price / max_total_amount (yüklemede max_price) olarak gönderin. Fiyat arada yükselmişse 409 price_changed döner ve tahsilat yapılmaz.
Sayfalama, senkron ve limitler
- İmleç:
pagination.next_cursordeğerinicursor(katalog) ya dabefore_id(sipariş, defter) olarak gönderin;has_more=falseson sayfadır. - Katalog senkronu: günde bir tam çekim + saatlik
updated_sinceçekimi önerilir. Satıştan kalkan kodlarGET /packages/{id}'dereplaced_package_idile yeni pakete yönlenir. - Hız limiti: plan/anahtar bazında dakikalık ve günlük. Her yanıtta
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset,X-RateLimit-Daily-*; aşımda 429 +Retry-After.
Hata kodları
Hata yanıtı: {"success":false,"error":{"code","message","details?","documentation_url"},"meta":{"request_id"}}. İş akışınızı error.code'a göre kurun; mesaj metni değişebilir.
| Kod | HTTP | Anlamı | Ne yapmalı |
|---|---|---|---|
bad_request | 400 | İstek gövdesi geçersiz JSON. | Gövdeyi geçerli JSON olarak gönderin. |
authentication_failed | 401 | Anahtar yok, biçimi hatalı, iptal edilmiş, süresi dolmuş ya da HMAC imzası geçersiz. | Authorization: Bearer wsm_live_… başlığını ve anahtarın durumunu kontrol edin. |
insufficient_balance | 402 | Bakiye + kullanılabilir cari, işlem tutarını karşılamıyor. Sipariş/yükleme OLUŞMAZ, tahsilat yapılmaz. | error.details.shortfall kadar bakiye yükleyin ya da cari izni/limiti için hesap yöneticinize başvurun. |
insufficient_scope | 403 | Anahtarda gerekli yetki (scope) yok. | Panelden anahtara ilgili yetkiyi verin ya da yeni anahtar üretin. |
access_denied | 403 | Hesap/ortam kapalı ya da IP allowlist dışında. | Ortamın (test/canlı) açık olduğunu ve çıkış IP'nizi kontrol edin. |
resource_not_found | 404 | Kayıt bulunamadı ya da bu hesaba ait değil. | Referansı/ICCID'yi ve ortamı (test/canlı anahtar) kontrol edin. |
package_not_found | 404 | Paket bulunamadı ya da artık satışta değil. | Kataloğu yenileyin (GET /packages?updated_since=…). |
conflict | 409 | Idempotency-Key farklı gövdeyle tekrar kullanıldı, client_reference daha önce kullanıldı ya da işlem durumu buna izin vermiyor. | Yeni bir Idempotency-Key / client_reference kullanın. |
price_changed | 409 | Güncel fiyat, gönderdiğiniz max_unit_price / max_total_amount / max_price değerini aşıyor. Tahsilat yapılmaz. | POST /quotes ile güncel fiyatı alıp yeniden deneyin. |
unsupported_media_type | 415 | Gövdeli istekte Content-Type application/json değil. | Content-Type: application/json gönderin. |
validation_error | 422 | Alan eksik ya da geçersiz. error.details.field hatalı alanı verir. | Alanı düzeltip yeniden gönderin. |
invalid_topup_package | 422 | package_code bu eSIM için geçerli bir yükleme seçeneği değil. | GET /esims/{iccid}/topup-options yanıtından seçin. |
topup_not_supported | 422 | eSIM'in ağ kaynağı yükleme desteklemiyor. | Yeni eSIM siparişi verin. Destek matrisi: GET /meta/capabilities. |
action_not_supported | 422 | eSIM'in ağ kaynağı bu işlemi (iptal/askıya alma/devam) desteklemiyor. Talep kuyruğa ALINMAZ. | GET /meta/capabilities ile desteklenen işlemleri kontrol edin. |
rate_limit_exceeded | 429 | Dakikalık ya da günlük istek limiti aşıldı. | Retry-After başlığındaki saniye kadar bekleyin; X-RateLimit-* başlıklarını izleyin. |
internal_error | 500 | Beklenmeyen hata. Ayrıntı güvenlik için dönmez. | meta.request_id ile destek ekibine başvurun. |
supplier_error | 502 | Ağ sağlayıcısı (tedarikçi) geçici olarak yanıt vermedi. | Üstel geri çekilmeyle (1s, 2s, 4s…) tekrar deneyin. |
service_unavailable | 503 | Hizmet geçici olarak kullanılamıyor. | Kısa süre sonra tekrar deneyin. |
supplier_unavailable | 503 | Paketin tedarikçisi şu an satışa kapalı. Tahsilat yapılmaz. | Aynı ülke için başka bir paket seçin. |
fx_unavailable | 503 | Hesap para birimi için doğrulanmış güncel kur yok; fiyat verilemez, satış yapılmaz. | Birkaç dakika sonra tekrar deneyin. |
Webhook olayları ve imza doğrulama
Gönderim başlıkları: X-WSM-Event, X-WSM-Event-Id, X-WSM-Timestamp, X-WSM-Signature: sha256=<hex>. İmza: HMAC_SHA256(secret, timestamp + "." + ham_gövde). 2xx dışı yanıtlar üstel geri çekilmeyle tekrar denenir; aynı olay birden fazla gelebilir, X-WSM-Event-Id ile tekilleştirin.
<?php // PHP
$raw = file_get_contents('php://input');
$ts = $_SERVER['HTTP_X_WSM_TIMESTAMP'] ?? '';
$sig = substr($_SERVER['HTTP_X_WSM_SIGNATURE'] ?? '', 7); // "sha256=" sonrası
if (abs(time() - (int)$ts) > 300 || !hash_equals(hash_hmac('sha256', $ts . '.' . $raw, $secret), $sig)) {
http_response_code(401); exit;
}
http_response_code(200); // önce yanıtlayın, işi kuyrukta yapın
// Node.js
const ok = crypto.timingSafeEqual(
Buffer.from(crypto.createHmac('sha256', secret).update(ts + '.' + rawBody).digest('hex')),
Buffer.from(sig));
| Olay | Ne zaman |
|---|---|
order.created | Canlı sipariş alındı, tedarikçiye gönderilmek üzere kuyrukta. |
order.delivered | Siparişin tüm eSIM profilleri teslim edildi. |
order.partially_delivered | İstenen adetten az profil teslim edildi; eksik adet bedeli iade edildi. |
order.failed | Sipariş teslim edilemedi; tutarın tamamı iade edildi. |
order.cancelled | Siparişin tüm eSIM profilleri iptal edildi. |
esim.activated | eSIM ağa ilk kez bağlandı (aktive oldu). |
esim.usage.updated | eSIM veri kullanımı değişti. |
esim.suspended | eSIM askıya alındı. |
esim.resumed | Askıdaki eSIM yeniden açıldı. |
esim.cancelled | eSIM iptal edildi; profil bedeli iade edildi. |
esim.action.failed | İptal / askıya alma işlemi tedarikçide başarısız oldu. |
topup.completed | Yükleme eSIM'e uygulandı. |
topup.failed | Yükleme başarısız oldu; tahsil edilen tutar iade edildi. |
api_key.expiring | Bir API anahtarının süresi yakında doluyor (yenileme hatırlatması). |
integration.test | POST /webhooks/{id}/test ile gönderilen deneme olayı. |
1. Bağlantı ve meta
Entegrasyona buradan başlayın: servis sağlığı, anahtar testi, yetki kataloğu, webhook olayları ve ağ kaynaklarının işlem desteği.
GET /api/v1/health Servis canlılığı kimlik gerekmez
Kimlik istemez. Yük dengeleyici ve izleme araçları içindir.
İstek
curl -X GET "https://wesim.tech/api/v1/health"
Yanıt (200)
{
"success": true,
"data": {
"service": "WeSIMTech REST API",
"api_version": "v1",
"status": "healthy",
"time": "2026-10-05T12:00:00+00:00"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
GET /api/v1/health/ready Hazırlık kontrolü health:read
Veritabanı, şema, katalog ve kuyrukların ayrıntılı durumunu döner.
İstek
curl -X GET "https://wesim.tech/api/v1/health/ready" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"status": "healthy",
"checks": {
"database": {
"status": "healthy"
},
"catalog": {
"status": "healthy"
}
},
"duration_ms": 12
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
POST /api/v1/auth/test Anahtar ve bağlantı testi health:test
Anahtarın ortamını, yetkilerini, HMAC ve IP allowlist durumunu doğrular. Entegrasyonun ilk çağrısı.
İstek
curl -X POST "https://wesim.tech/api/v1/auth/test" \
-H "Authorization: Bearer wsm_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{}'
Yanıt (200)
{
"success": true,
"data": {
"status": "healthy",
"authentication": {
"status": "healthy",
"key_prefix": "wsm_live_3f9a1c2b0d",
"environment": "live",
"hmac_required": false,
"scopes": [
"catalog:read",
"orders:create"
],
"ip_allowlist_active": true
}
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/meta/scopes Yetki (scope) kataloğu kimlik gerekmez
Modül bazında tüm yetkiler ve risk seviyeleri. Kimlik istemez.
İstek
curl -X GET "https://wesim.tech/api/v1/meta/scopes"
Yanıt (200)
{
"success": true,
"data": {
"modules": [
{
"code": "orders",
"name": "Siparişler",
"scopes": [
{
"code": "orders:create",
"name": "Sipariş oluştur",
"risk_level": "high"
}
]
}
]
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
GET /api/v1/meta/events Webhook olay kataloğu kimlik gerekmez
Abone olunabilen tüm webhook olayları ve anlamları. Kimlik istemez.
İstek
curl -X GET "https://wesim.tech/api/v1/meta/events"
Yanıt (200)
{
"success": true,
"data": {
"items": [
{
"event": "order.delivered",
"description": "Siparişin tüm eSIM profilleri teslim edildi."
},
{
"event": "topup.failed",
"description": "Yükleme başarısız oldu; tahsil edilen tutar iade edildi."
}
]
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
GET /api/v1/meta/integration Makine okunur entegrasyon sözleşmesi health:read
Ortam, temel URL, imza kuralları ve marka bağlantıları.
İstek
curl -X GET "https://wesim.tech/api/v1/meta/integration" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"environment": "live",
"base_url": "https://your-domain.example/api/v1",
"openapi_url": "/api-docs/openapi.yaml"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/meta/capabilities Ağ kaynağı işlem matrisi catalog:read
Her ağ kaynağı (paketteki `provider`) için sipariş, yükleme, iptal, askıya alma ve devam desteği. Desteklenmeyen işlem talep anında 422 action_not_supported döner.
İstek
curl -X GET "https://wesim.tech/api/v1/meta/capabilities" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"providers": {
"esimaccess": {
"order": true,
"topup": true,
"cancel": true,
"suspend": true,
"resume": false,
"usage": true,
"refund_on_cancel": true
},
"esimgo": {
"order": true,
"topup": true,
"cancel": false,
"suspend": false,
"resume": false,
"usage": false,
"refund_on_cancel": false
}
}
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/providers/esimaccess/capabilities eSIMAccess yetenekleri (eski) eski catalog:read
Geriye dönük uyumluluk içindir; yeni entegrasyonlar GET /meta/capabilities kullanmalıdır. Yanıt aynıdır.
İstek
curl -X GET "https://wesim.tech/api/v1/providers/esimaccess/capabilities" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"provider": "esimaccess",
"topup": true,
"cancel": true,
"suspend": true,
"resume": false
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/usage Anahtar kullanım ve limit durumu usage:read
Anahtarın dakikalık/günlük kullanımı, son 24 saatin hata oranı ve gecikmesi.
İstek
curl -X GET "https://wesim.tech/api/v1/usage" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"minute": {
"used": 4,
"limit": 120
},
"day": {
"used": 311,
"limit": 10000
},
"last_24h": {
"requests": 311,
"errors": 2,
"avg_latency_ms": 84.3
}
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
2. Hesap, bakiye ve cari
Harcanabilir tutar = cüzdan bakiyesi + kullanılabilir cari. Cari yalnız hesabınızda cari satış izni açık ve bloke yoksa kullanılır. Canlı sipariş ve yükleme tutarı bu tutardan kilitli işlemle düşülür; yetmezse 402 insufficient_balance döner ve işlem oluşmaz. Tüm tutarlar hesabınızın para birimindedir.
GET /api/v1/account Hesap profili account:read
Şirket, para birimi, ortamlar ve cari izin durumu. Bakiye için account:balance gerekir.
İstek
curl -X GET "https://wesim.tech/api/v1/account" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"id": 12,
"account_code": "WSM-E033900C",
"company_name": "Travel Co",
"email": "ops@travel.example",
"currency": "USD",
"status": "active",
"test_enabled": 1,
"live_enabled": 1,
"credit_enabled": true,
"credit_status": "active",
"payment_terms_days": 30,
"created_at": "2026-07-20 12:47:22"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/account/balance Bakiye ve cari özeti account:balance
`available_to_spend` alım yapabileceğiniz en yüksek tutardır. `wallet_balance` negatifse fark kullanılan caridir. `credit_limit`, `credit_used`, `available` alanları v1 ilk sürüm uyumluluğu içindir.
İstek
curl -X GET "https://wesim.tech/api/v1/account/balance" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"currency": "USD",
"wallet_balance": -120.5,
"prepaid_balance": 0,
"credit": {
"enabled": true,
"status": "active",
"hold_reason": null,
"limit": 1000,
"used": 120.5,
"available": 879.5,
"payment_terms_days": 30
},
"available_to_spend": 879.5,
"can_purchase": true,
"credit_limit": 1000,
"credit_used": 120.5,
"available": 879.5
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/account/ledger Cüzdan defteri account:balance
Tüm para hareketleri (yükleme, sipariş, iade, cari düzeltmesi), yeniden eskiye. Kayıtlar hash zinciriyle değiştirilemez saklanır.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
limit | sorgu | integer | No | 1–100, varsayılan 25. | 25 |
before_id | sorgu | integer | No | Önceki sayfanın pagination.next_cursor değeri. | 4410 |
İstek
curl -X GET "https://wesim.tech/api/v1/account/ledger?limit=25&before_id=4410" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"items": [
{
"id": 4411,
"reference": "LED-9C1D7E004F2A",
"type": "debit",
"amount": -21.097,
"currency": "USD",
"balance_before": -99.403,
"balance_after": -120.5,
"description": "Sipariş B2B-4F2A9C1D7E00",
"created_at": "2026-10-05 12:00:00"
}
],
"pagination": {
"limit": 25,
"next_cursor": 4411,
"has_more": true
}
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
3. Katalog (tüm ağ kaynakları)
Tüm tedarikçilerden gelen satılabilir ürünler, sizin fiyatınızla. `price` ödeyeceğiniz birim fiyattır (hesap para biriminde); `recommended_retail_price` önerilen son kullanıcı fiyatıdır. Kataloğu `updated_since` ile artımlı senkronlayın. Varyantlar (`is_variant`) aynı ürünün farklı operatör/hız seçenekleridir; `product_key` ile gruplayın.
GET /api/v1/packages Paket listesi catalog:read
İmleçle sayfalı. İlk sayfada `pagination.total` toplam paket sayısını verir. `country` ülkenin yerel paketlerini ve ülkeyi kapsayan bölgesel/küresel paketleri döner.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
Paese | sorgu | string | No | ISO 3166-1 alfa-2 (örn. TR). | DE |
Regione | sorgu | string | No | Bölge kodu ya da adı (GET /regions). | EU |
type | sorgu | string | No | local | regional | global | local |
q | sorgu | string | No | Ad, paket kodu ya da ülke adında arama. | 10GB |
min_data_mb | sorgu | integer | No | En az veri (MB). | 1024 |
max_data_mb | sorgu | integer | No | En çok veri (MB). | 20480 |
min_days | sorgu | integer | No | En az kullanım süresi (gün). | 7 |
max_days | sorgu | integer | No | En çok kullanım süresi (gün). | 30 |
unlimited | sorgu | boolean | No | true: yalnız sınırsız; false: sınırsızlar hariç. | false |
include_variants | sorgu | boolean | No | Varsayılan true. false yalnız ana ürünleri döner. | true |
updated_since | sorgu | string | No | ISO 8601; bu andan sonra değişen paketler (artımlı senkron). | 2026-10-01T00:00:00Z |
limit | sorgu | integer | No | 1–100, varsayılan 50. | 50 |
cursor | sorgu | integer | No | Önceki sayfanın pagination.next_cursor değeri. | 2048 |
İstek
curl -X GET "https://wesim.tech/api/v1/packages?country=DE®ion=EU" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"items": [
{
"id": 3,
"package_id": "EU-42_3_30",
"name": "Avrupa eSIM 3GB - 30 Gün",
"type": "regional",
"country_code": null,
"country_name": "Avrupa",
"region": "Avrupa",
"region_code": "EU",
"coverage": {
"count": 41,
"countries": [
"AT",
"BE",
"DE",
"FR",
"…"
]
},
"data": {
"amount": "3GB",
"mb": 3072,
"unlimited": false,
"per_day": false
},
"duration_days": 30,
"validity_days": 180,
"network": {
"type": "3G/4G/5G",
"speed": "5G",
"operators": [
{
"country": "DE",
"name": "Telekom"
}
],
"hotspot": null
},
"product_key": "M:41:57c443ff8649|3GB|30|total",
"is_variant": false,
"topup_supported": true,
"price": 10.5485,
"currency": "USD",
"recommended_retail_price": 12.41,
"updated_at": "2026-10-02T13:04:40+00:00",
"reseller_price": 10.5485,
"retail_price": 12.41,
"data_amount": "3GB",
"data_amount_mb": 3072,
"network_type": "3G/4G/5G",
"provider": "esimaccess"
}
],
"pagination": {
"limit": 50,
"next_cursor": 3,
"has_more": true,
"total": 2967
},
"currency": "USD"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/packages/{id} Paket ayrıntısı catalog:read
Paket kodu (`package_id`) ya da iç kimlikle. Satıştan kalkmış bir kod yerine geçen pakete yönlenirse yanıtta `replaced_package_id` eski kodu verir; kataloğunuzu güncelleyin.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
id | yol | string | Sì | package_id (önerilen) ya da sayısal id. | EU-42_3_30 |
İstek
curl -X GET "https://wesim.tech/api/v1/packages/EU-42_3_30" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"id": 3,
"package_id": "EU-42_3_30",
"name": "Avrupa eSIM 3GB - 30 Gün",
"type": "regional",
"country_code": null,
"country_name": "Avrupa",
"region": "Avrupa",
"region_code": "EU",
"coverage": {
"count": 41,
"countries": [
"AT",
"BE",
"DE",
"FR",
"…"
]
},
"data": {
"amount": "3GB",
"mb": 3072,
"unlimited": false,
"per_day": false
},
"duration_days": 30,
"validity_days": 180,
"network": {
"type": "3G/4G/5G",
"speed": "5G",
"operators": [
{
"country": "DE",
"name": "Telekom"
}
],
"hotspot": null
},
"product_key": "M:41:57c443ff8649|3GB|30|total",
"is_variant": false,
"topup_supported": true,
"price": 10.5485,
"currency": "USD",
"recommended_retail_price": 12.41,
"updated_at": "2026-10-02T13:04:40+00:00",
"reseller_price": 10.5485,
"retail_price": 12.41,
"data_amount": "3GB",
"data_amount_mb": 3072,
"network_type": "3G/4G/5G",
"provider": "esimaccess"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/countries Ülkeler catalog:read
Yerel paketi olan ülkeler ve paket sayıları.
İstek
curl -X GET "https://wesim.tech/api/v1/countries" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"items": [
{
"code": "DE",
"name": "Germany",
"package_count": 42,
"min_retail_price": "1.28"
}
]
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/regions Bölgeler ve küresel paketler catalog:read
Bölgesel/küresel paket grupları; kodu GET /packages?region=… ile kullanın.
İstek
curl -X GET "https://wesim.tech/api/v1/regions" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"items": [
{
"code": "EU",
"name": "Avrupa",
"type": "regional",
"package_count": 58,
"max_coverage": 42
}
]
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
4. Fiyat teklifi ve sipariş
Önerilen akış: POST /quotes ile fiyatı ve bakiye yeterliliğini görün → aynı fiyatı max_unit_price olarak göndererek POST /orders → webhook (order.delivered) ya da GET /orders/{reference} ile profilleri alın. Canlı sipariş tutarı sipariş anında düşülür; teslim edilemeyen adet otomatik iade edilir. Test anahtarıyla verilen siparişler ücretlendirilmez ve anında sahte profillerle teslim edilir.
POST /api/v1/quotes Fiyat teklifi catalog:read
Bağlayıcı değildir (5 dk). `funds.sufficient` bu siparişin şu anki bakiyenizle verilip verilemeyeceğini gösterir.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
package_id | gövde | string | Sì | Paket kodu ya da id. | EU-42_3_30 |
quantity | gövde | integer | No | 1–50, varsayılan 1. | 2 |
İstek
curl -X POST "https://wesim.tech/api/v1/quotes" \
-H "Authorization: Bearer wsm_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"package_id":"EU-42_3_30","quantity":2}'
Yanıt (200)
{
"success": true,
"data": {
"quote_id": "qte_1a2b3c4d5e6f7a8b",
"environment": "live",
"package": {
"id": 3,
"package_id": "EU-42_3_30",
"name": "Avrupa eSIM 3GB - 30 Gün",
"country_code": "EU",
"data": "3GB",
"validity_days": 180,
"duration_days": 30
},
"quantity": 2,
"unit_price": 10.5485,
"total_amount": 21.097,
"currency": "USD",
"pricing": {
"base_currency": "USD",
"base_unit_price": 10.5485,
"fx_rate": 1,
"recommended_retail_price": 12.41
},
"funds": {
"available_to_spend": 879.5,
"sufficient": true,
"shortfall": 0,
"credit_enabled": true,
"credit_status": "active",
"charged_on_order": true
},
"expires_at": "2026-10-05T12:05:00+00:00"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
POST /api/v1/orders Sipariş oluştur orders:create
Canlıda tutar bakiye + cariden düşülür ve sipariş tedarikçiye kuyruklanır (status=queued). Bakiye yetmezse 402 döner; sipariş oluşmaz. Fiyat değiştiyse ve max_* gönderdiyseniz 409 price_changed döner. Test anahtarında `test_scenario: "insufficient_balance"` 402 yolunu denemenizi sağlar.
Idempotency-Key zorunlu. Tekrar denemede aynı anahtarı kullanın.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
Idempotency-Key | başlık | string | Sì | Tekrar denemede aynı değeri gönderin (en fazla 128 karakter). Aynı anahtar + aynı gövde ilk yanıtı döndürür; aynı anahtar + farklı gövde 409 conflict. | ord-2026-10-05-0001 |
package_id | gövde | string | Sì | Paket kodu ya da id. | EU-42_3_30 |
quantity | gövde | integer | No | 1–50, varsayılan 1. Aralık dışı değer reddedilir (kırpılmaz). | 2 |
client_reference | gövde | string | No | Kendi sipariş numaranız (en fazla 128, hesapta benzersiz). | ERP-1001 |
max_unit_price | gövde | number | No | Birim fiyat bundan yüksekse sipariş verilmez (409). | 10.55 |
max_total_amount | gövde | number | No | Toplam bundan yüksekse sipariş verilmez (409). | 21.1 |
test_scenario | gövde | string | No | Yalnız test: insufficient_balance. | — |
İstek
curl -X POST "https://wesim.tech/api/v1/orders" \
-H "Authorization: Bearer wsm_live_YOUR_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"package_id":"EU-42_3_30","quantity":2,"client_reference":"ERP-1001","max_unit_price":10.55}'
Yanıt (200)
{
"success": true,
"data": {
"id": 182,
"reference": "B2B-4F2A9C1D7E00",
"client_reference": "ERP-1001",
"status": "queued",
"requested_quantity": 2,
"delivered_quantity": 0,
"unit_price": 10.5485,
"total_amount": 21.097,
"currency": "USD",
"package_id": 3,
"package_name": "Avrupa eSIM 3GB - 30 Gün",
"iccid": null,
"activation_code": null,
"profiles": [],
"created_at": "2026-10-05 12:00:00"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/orders Sipariş listesi orders:read
Yeniden eskiye, imleçle sayfalı.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
Stato | sorgu | string | No | created | queued | processing | delivered | partially_delivered | failed | cancelled | refunded | delivered |
limit | sorgu | integer | No | 1–100, varsayılan 25. | 25 |
before_id | sorgu | integer | No | Önceki sayfanın next_cursor değeri. | 180 |
İstek
curl -X GET "https://wesim.tech/api/v1/orders?status=delivered&limit=25" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"items": [
{
"id": 182,
"reference": "B2B-4F2A9C1D7E00",
"client_reference": "ERP-1001",
"status": "queued",
"unit_price": 10.5485,
"total_amount": 21.097,
"currency": "USD",
"package_name": "Avrupa eSIM 3GB - 30 Gün",
"iccid": null,
"created_at": "2026-10-05 12:00:00"
}
],
"pagination": {
"limit": 25,
"next_cursor": 182,
"has_more": false
}
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/orders/{reference} Sipariş ayrıntısı ve profiller orders:read
Teslim edilen HER eSIM `profiles` dizisindedir (aktivasyon kodu/LPA dahil). `iccid` ve `activation_code` yalnız birinci profili gösterir (eski uyumluluk). `partially_delivered`: eksik adet bedeli iade edilmiştir.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
Riferimento ordine | yol | string | Sì | Sipariş referansı (B2B-…). | B2B-4F2A9C1D7E00 |
İstek
curl -X GET "https://wesim.tech/api/v1/orders/B2B-4F2A9C1D7E00" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"status": "delivered",
"delivered_quantity": 2,
"iccid": "8944500000000000001",
"activation_code": "LPA:1$smdp.example$ABCD-1234",
"profiles": [
{
"iccid": "8944500000000000001",
"imsi": null,
"provider": "esimaccess",
"activation_status": "ready",
"installation_status": "not_installed",
"activation_code": "LPA:1$smdp.example$ABCD-1234",
"smdp_address": "smdp.example"
},
{
"iccid": "8944500000000000002",
"imsi": null,
"provider": "esimaccess",
"activation_status": "ready",
"installation_status": "not_installed",
"activation_code": "LPA:1$smdp.example$EFGH-5678",
"smdp_address": "smdp.example"
}
],
"id": 182,
"reference": "B2B-4F2A9C1D7E00",
"client_reference": "ERP-1001",
"requested_quantity": 2,
"unit_price": 10.5485,
"total_amount": 21.097,
"currency": "USD",
"package_id": 3,
"package_name": "Avrupa eSIM 3GB - 30 Gün",
"created_at": "2026-10-05 12:00:00"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
POST /api/v1/orders/{reference}/cancel Siparişi iptal et orders:cancel
Siparişin TÜM profilleri için iptal talebi açar. Tedarikçi iptali kabul ederse her profilin birim bedeli bir kez iade edilir (esim.cancelled webhook'u; tümü iptal olursa order.cancelled). Kullanılmaya başlanmış eSIM'i tedarikçi reddedebilir. Desteklemeyen ağ kaynağında 422 action_not_supported.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
Riferimento ordine | yol | string | Sì | Sipariş referansı. | B2B-4F2A9C1D7E00 |
İstek
curl -X POST "https://wesim.tech/api/v1/orders/B2B-4F2A9C1D7E00/cancel" \
-H "Authorization: Bearer wsm_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{}'
Yanıt (200)
{
"success": true,
"data": {
"action_id": 912,
"action": "cancel",
"status": "queued",
"resource": "8944500000000000001",
"order_reference": "B2B-4F2A9C1D7E00",
"actions": [
{
"action_id": 912,
"iccid": "8944500000000000001",
"status": "queued"
},
{
"action_id": 913,
"iccid": "8944500000000000002",
"status": "queued"
}
],
"refund_on_success": {
"amount_per_esim": 10.5485,
"currency": "USD"
}
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
5. eSIM yaşam döngüsü
Teslim edilen profillerin durumu, kullanımı, cihazı ve olay geçmişi. Durumlar tedarikçi webhook'ları ve periyodik senkronla güncellenir; POST /refresh anlık senkron ister.
GET /api/v1/esims eSIM listesi esims:read
Hesaptaki tüm profiller.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
Stato | sorgu | string | No | provisioning | ready | installed | activated | suspended | exhausted | expired | cancelled | activated |
provider | sorgu | string | No | Ağ kaynağı kodu. | esimaccess |
limit | sorgu | integer | No | 1–200, varsayılan 50. | 50 |
offset | sorgu | integer | No | Atlanacak kayıt. | 0 |
İstek
curl -X GET "https://wesim.tech/api/v1/esims?status=activated&provider=esimaccess" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"items": [
{
"reference": "B2B-4F2A9C1D7E00",
"iccid": "8944500000000000001",
"imsi": "234500000000001",
"provider": "esimaccess",
"provider_order_reference": "B2305161605",
"activation_status": "activated",
"installation_status": "installed",
"provider_status": {
"profile": "IN_USE",
"smdp": "ENABLED"
},
"usage": {
"total_mb": 3072,
"used_mb": 412.5,
"remaining_mb": 2659.5,
"usage_percent": 13.43
},
"device": {
"brand": "Apple",
"model": "iPhone 15",
"eid": null
},
"validity": {
"days": 30,
"activated_at": "2026-10-03 09:12:00",
"installed_at": "2026-10-03 09:10:00",
"expires_at": "2026-11-02 09:12:00"
},
"network": {
"name": "Telekom.de",
"apn": "drei.at"
},
"last_provider_sync_at": "2026-10-05 11:40:00"
}
],
"limit": 50,
"offset": 0
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/esims/{iccid} eSIM ayrıntısı esims:read
Aktivasyon/kurulum durumu, kullanım, geçerlilik ve ağ bilgisi.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
iccid | yol | string | Sì | eSIM ICCID numarası. | 8944500000000000001 |
İstek
curl -X GET "https://wesim.tech/api/v1/esims/8944500000000000001" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"reference": "B2B-4F2A9C1D7E00",
"iccid": "8944500000000000001",
"imsi": "234500000000001",
"provider": "esimaccess",
"provider_order_reference": "B2305161605",
"activation_status": "activated",
"installation_status": "installed",
"provider_status": {
"profile": "IN_USE",
"smdp": "ENABLED"
},
"usage": {
"total_mb": 3072,
"used_mb": 412.5,
"remaining_mb": 2659.5,
"usage_percent": 13.43
},
"device": {
"brand": "Apple",
"model": "iPhone 15",
"eid": null
},
"validity": {
"days": 30,
"activated_at": "2026-10-03 09:12:00",
"installed_at": "2026-10-03 09:10:00",
"expires_at": "2026-11-02 09:12:00"
},
"network": {
"name": "Telekom.de",
"apn": "drei.at"
},
"last_provider_sync_at": "2026-10-05 11:40:00"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
POST /api/v1/esims/{iccid}/refresh Anlık senkron esims:sync
Profili tedarikçiden yeniden çeker ve güncel hâlini döner.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
iccid | yol | string | Sì | eSIM ICCID numarası. | 8944500000000000001 |
İstek
curl -X POST "https://wesim.tech/api/v1/esims/8944500000000000001/refresh" \
-H "Authorization: Bearer wsm_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{}'
Yanıt (200)
{
"success": true,
"data": {
"reference": "B2B-4F2A9C1D7E00",
"iccid": "8944500000000000001",
"imsi": "234500000000001",
"provider": "esimaccess",
"provider_order_reference": "B2305161605",
"activation_status": "activated",
"installation_status": "installed",
"provider_status": {
"profile": "IN_USE",
"smdp": "ENABLED"
},
"usage": {
"total_mb": 3072,
"used_mb": 412.5,
"remaining_mb": 2659.5,
"usage_percent": 13.43
},
"device": {
"brand": "Apple",
"model": "iPhone 15",
"eid": null
},
"validity": {
"days": 30,
"activated_at": "2026-10-03 09:12:00",
"installed_at": "2026-10-03 09:10:00",
"expires_at": "2026-11-02 09:12:00"
},
"network": {
"name": "Telekom.de",
"apn": "drei.at"
},
"last_provider_sync_at": "2026-10-05 11:40:00"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/esims/{iccid}/usage Veri kullanımı esims:usage
Güncel kullanım ve son 100 ölçüm.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
iccid | yol | string | Sì | eSIM ICCID numarası. | 8944500000000000001 |
İstek
curl -X GET "https://wesim.tech/api/v1/esims/8944500000000000001/usage" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"current": {
"total_mb": 3072,
"used_mb": 412.5,
"remaining_mb": 2659.5,
"usage_percent": 13.43
},
"history": [
{
"total_volume_bytes": 3221225472,
"used_volume_bytes": 432537600,
"remaining_volume_bytes": 2788687872,
"usage_percent": 13.43,
"source": "webhook",
"recorded_at": "2026-10-05 11:40:00"
}
]
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/esims/{iccid}/device Cihaz bilgisi esims:device
Tedarikçi bildirdiyse EID/IMEI, marka, model.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
iccid | yol | string | Sì | eSIM ICCID numarası. | 8944500000000000001 |
İstek
curl -X GET "https://wesim.tech/api/v1/esims/8944500000000000001/device" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"eid": null,
"imei": "35000000000000",
"brand": "Apple",
"model": "iPhone 15",
"os": "iOS",
"verified": true
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/esims/{iccid}/installation Kurulum bilgisi esims:installation
Aktivasyon kodu (LPA), SM-DP+ adresi ve kurulum durumu; son kullanıcıya QR/kurulum bağlantısı üretmek içindir.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
iccid | yol | string | Sì | eSIM ICCID numarası. | 8944500000000000001 |
İstek
curl -X GET "https://wesim.tech/api/v1/esims/8944500000000000001/installation" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"iccid": "8944500000000000001",
"activation_code": "LPA:1$smdp.example$ABCD-1234",
"smdp_address": "smdp.example",
"installation_status": "not_installed"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/esims/{iccid}/events Olay geçmişi esims:events
Durum değişiklikleri (status.changed) ve kaynakları.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
iccid | yol | string | Sì | eSIM ICCID numarası. | 8944500000000000001 |
İstek
curl -X GET "https://wesim.tech/api/v1/esims/8944500000000000001/events" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"items": [
{
"event_type": "status.changed",
"previous_status": "ready",
"current_status": "activated",
"source": "webhook",
"created_at": "2026-10-03 09:12:00"
}
]
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
POST /api/v1/esims/{iccid}/suspend Askıya al esims:suspend
Desteklenen ağ kaynaklarında eSIM'i askıya alır (esim.suspended webhook'u). Desteklenmiyorsa 422 action_not_supported; talep kuyruğa alınmaz.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
iccid | yol | string | Sì | eSIM ICCID numarası. | 8944500000000000001 |
İstek
curl -X POST "https://wesim.tech/api/v1/esims/8944500000000000001/suspend" \
-H "Authorization: Bearer wsm_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{}'
Yanıt (200)
{
"success": true,
"data": {
"action_id": 914,
"action": "suspend",
"status": "queued",
"resource": "8944500000000000001",
"actions": [
{
"action_id": 914,
"iccid": "8944500000000000001",
"status": "queued"
}
],
"refund_on_success": null
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
POST /api/v1/esims/{iccid}/resume Askıdan çıkar esims:resume
Desteklenen ağ kaynaklarında askıdaki eSIM'i yeniden açar.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
iccid | yol | string | Sì | eSIM ICCID numarası. | 8944500000000000001 |
İstek
curl -X POST "https://wesim.tech/api/v1/esims/8944500000000000001/resume" \
-H "Authorization: Bearer wsm_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{}'
Yanıt (200)
{
"success": true,
"data": {
"action_id": 915,
"action": "resume",
"status": "queued",
"resource": "8944500000000000001"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
6. Yükleme (top-up) ve işlem durumu
Var olan eSIM'e ek paket. Yükleme ÜCRETLİDİR: tutar talep anında bakiye + cariden düşülür. Tedarikçi reddederse tutar bir kez otomatik iade edilir (topup.failed). Sonuç belirsizse (tedarikçi zaman aşımı) işlem `under_review` olur ve uzlaştırılana kadar iade edilmez; böylece aynı yükleme hem uygulanıp hem iade edilmez.
GET /api/v1/esims/{iccid}/topup-options Yükleme seçenekleri topups:read
Bu eSIM'e uygulanabilen paketler ve sizin fiyatınız (hesap para biriminde).
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
iccid | yol | string | Sì | eSIM ICCID numarası. | 8944500000000000001 |
İstek
curl -X GET "https://wesim.tech/api/v1/esims/8944500000000000001/topup-options" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"iccid": "8944500000000000001",
"provider_supported": true,
"currency": "USD",
"source": "live",
"items": [
{
"package_code": "TOPUP_EU_1GB_7",
"name": "Avrupa 1GB 7 Gün",
"data_mb": 1024,
"duration_days": 7,
"price": 2.35,
"currency": "USD"
}
]
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
POST /api/v1/esims/{iccid}/topups Yükleme yap topups:create
Fiyat sunucuda yeniden hesaplanır (gönderdiğiniz tutara güvenilmez). Bakiye yetmezse 402; işlem oluşmaz. Sonuç webhook (topup.completed / topup.failed) ya da GET /actions/{id} ile izlenir.
Idempotency-Key zorunlu. Tekrar denemede aynı anahtarı kullanın.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
Idempotency-Key | başlık | string | Sì | Tekrar denemede aynı değeri gönderin (en fazla 128 karakter). Aynı anahtar + aynı gövde ilk yanıtı döndürür; aynı anahtar + farklı gövde 409 conflict. | ord-2026-10-05-0001 |
iccid | yol | string | Sì | eSIM ICCID numarası. | 8944500000000000001 |
package_code | gövde | string | Sì | topup-options yanıtındaki kod. | TOPUP_EU_1GB_7 |
max_price | gövde | number | No | Fiyat bundan yüksekse yükleme yapılmaz (409). | 2.4 |
test_scenario | gövde | string | No | Yalnız test: insufficient_balance. | — |
İstek
curl -X POST "https://wesim.tech/api/v1/esims/8944500000000000001/topups" \
-H "Authorization: Bearer wsm_live_YOUR_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"package_code":"TOPUP_EU_1GB_7","max_price":2.4}'
Yanıt (200)
{
"success": true,
"data": {
"action_id": 911,
"action": "topup",
"status": "queued",
"resource": "8944500000000000001",
"package_code": "TOPUP_EU_1GB_7",
"name": "Avrupa 1GB 7 Gün",
"amount": 2.35,
"currency": "USD",
"charged": true,
"ledger_reference": "LED-0A1B2C3D4E5F6071"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/actions/{id} İşlem durumu esims:read
Yükleme, iptal, askıya alma talebinin durumu: queued → processing → succeeded | failed | under_review. `refunded` tahsil edilen ya da iptalde iade edilecek tutarın iade edilip edilmediğini gösterir.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
id | yol | integer | Sì | action_id. | 911 |
İstek
curl -X GET "https://wesim.tech/api/v1/actions/911" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"action_id": 911,
"action": "topup",
"iccid": "8944500000000000001",
"order_reference": "B2B-4F2A9C1D7E00",
"status": "succeeded",
"package_code": "TOPUP_EU_1GB_7",
"amount": 2.35,
"currency": "USD",
"charged": true,
"refunded": false,
"refunded_at": null,
"settled_at": "2026-10-05T12:01:10+00:00",
"created_at": "2026-10-05T12:01:00+00:00"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
7. Webhook
Olaylar HTTPS adresinize POST edilir. Başlıklar: X-WSM-Event, X-WSM-Event-Id, X-WSM-Timestamp, X-WSM-Signature: sha256=HMAC_SHA256(secret, timestamp + "." + ham_gövde). İmzayı sabit zamanlı karşılaştırın, 5 dakikadan eski zaman damgasını reddedin, X-WSM-Event-Id ile tekilleştirin. 2xx dışı yanıt üstel geri çekilmeyle tekrar denenir.
GET /api/v1/webhooks Webhook adresleri webhooks:read
Bu ortamdaki kayıtlı adresler ve sağlık durumları.
İstek
curl -X GET "https://wesim.tech/api/v1/webhooks" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"items": [
{
"id": 7,
"environment": "live",
"url": "https://hooks.travel.example/wesim",
"events_json": "[\"order.delivered\",\"topup.failed\"]",
"status": "active",
"failure_count": 0,
"last_success_at": "2026-10-05 12:00:03",
"created_at": "2026-09-01 10:00:00"
}
]
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
POST /api/v1/webhooks Webhook ekle webhooks:manage
Yalnız herkese açık HTTPS adres (yerel/özel IP reddedilir). `secret` YALNIZ BU YANITTA döner; saklayın.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
url | gövde | string | Sì | HTTPS adresi. | https://hooks.travel.example/wesim |
events | gövde | array | No | GET /meta/events listesinden; varsayılan ["*"]. | ["order.delivered","order.partially_delivered","topup.failed"] |
İstek
curl -X POST "https://wesim.tech/api/v1/webhooks" \
-H "Authorization: Bearer wsm_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://hooks.travel.example/wesim","events":["order.delivered","order.partially_delivered","order.failed","topup.completed","topup.failed","esim.cancelled"]}'
Yanıt (200)
{
"success": true,
"data": {
"id": 7,
"secret": "9f0c…64 karakter…"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
POST /api/v1/webhooks/{id}/disable Webhook kapat webhooks:manage
Adrese gönderimi durdurur.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
id | yol | integer | Sì | Webhook id. | 7 |
İstek
curl -X POST "https://wesim.tech/api/v1/webhooks/7/disable" \
-H "Authorization: Bearer wsm_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{}'
Yanıt (200)
{
"success": true,
"data": {
"id": 7,
"status": "disabled"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
GET /api/v1/webhooks/{id}/deliveries Teslim geçmişi webhooks:read
Son gönderimler, deneme sayısı ve son HTTP durumu.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
id | yol | integer | Sì | Webhook id. | 7 |
limit | sorgu | integer | No | 1–100, varsayılan 25. | 25 |
İstek
curl -X GET "https://wesim.tech/api/v1/webhooks/7/deliveries?limit=25" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"items": [
{
"event_id": "evt_8c1d…",
"event_type": "order.delivered",
"status": "delivered",
"attempt_count": 1,
"last_http_status": 200,
"last_error": null,
"created_at": "2026-10-05 12:00:02",
"delivered_at": "2026-10-05 12:00:03"
}
],
"limit": 25
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
POST /api/v1/webhooks/{id}/test Deneme olayı gönder webhooks:test
integration.test olayını kuyruğa alır; imza doğrulamanızı sınamak içindir.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
id | yol | integer | Sì | Webhook id. | 7 |
İstek
curl -X POST "https://wesim.tech/api/v1/webhooks/7/test" \
-H "Authorization: Bearer wsm_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{}'
Yanıt (200)
{
"success": true,
"data": {
"event_id": "evt_test_1a2b3c4d5e6f7a8b",
"status": "queued"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
8. Marka (white-label)
Son kullanıcıya gösterdiğiniz kurulum sayfaları ve e-postalar için marka manifesti.
GET /api/v1/brand Marka manifesti brand:read
Ad, logo, renkler, destek ve yasal bağlantılar. Uygulamanızda önbelleğe alın.
İstek
curl -X GET "https://wesim.tech/api/v1/brand" \ -H "Authorization: Bearer wsm_live_YOUR_KEY"
Yanıt (200)
{
"success": true,
"data": {
"name": "Travel Co eSIM",
"logo_url": "https://cdn.travel.example/logo.svg",
"favicon_url": null,
"colors": {
"primary": "#0E7490",
"secondary": "#0F172A",
"accent": "#F59E0B"
},
"support": {
"email": "help@travel.example",
"phone": "+44 20 0000 0000"
},
"legal": {
"terms_url": "https://travel.example/terms",
"privacy_url": "https://travel.example/privacy"
},
"custom_domain": "esim.travel.example",
"domain_verified": false,
"locale": "en"
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
POST /api/v1/brand Marka güncelle brand:manage
Gönderilen alanlar güncellenir; renkler #RRGGBB biçimindedir.
Parametreler
| Nome | Konum | Tür | Zorunlu | Nota | Örnek |
|---|---|---|---|---|---|
brand_name | gövde | string | No | Görünen ad. | Travel Co eSIM |
logo_url | gövde | string | No | HTTPS logo adresi. | https://cdn.travel.example/logo.svg |
favicon_url | gövde | string | No | HTTPS ikon adresi. | — |
primary_color | gövde | string | No | #RRGGBB | #0E7490 |
secondary_color | gövde | string | No | #RRGGBB | #0F172A |
accent_color | gövde | string | No | #RRGGBB | #F59E0B |
support_email | gövde | string | No | Destek e-postası. | help@travel.example |
support_phone | gövde | string | No | Destek telefonu. | +44 20 0000 0000 |
terms_url | gövde | string | No | Koşullar. | — |
privacy_url | gövde | string | No | Gizlilik. | — |
company_legal_name | gövde | string | No | Ticari unvan. | Travel Co Ltd |
custom_domain | gövde | string | No | Özel alan adı. | esim.travel.example |
portal_slug | gövde | string | No | Portal kısa adı. | travelco |
locale | gövde | string | No | Varsayılan dil. | en |
İstek
curl -X POST "https://wesim.tech/api/v1/brand" \
-H "Authorization: Bearer wsm_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"brand_name":"Travel Co eSIM","primary_color":"#0E7490","support_email":"help@travel.example"}'
Yanıt (200)
{
"success": true,
"data": {
"name": "Travel Co eSIM",
"colors": {
"primary": "#0E7490"
}
},
"meta": {
"request_id": "req_9f2c1a0b7d3e4f5a6b7c",
"api_version": "v1",
"environment": "live",
"timestamp": "2026-10-05T12:00:00+00:00"
}
}
Olası hatalar
Yetki (scope) kataloğu
health:read
Detaylı readiness ve bağımlılık kontrolü · low
health:test
Anahtar, ortam, HMAC ve limit testini çalıştır · medium
catalog:read
Paket ve ülke listesini oku · low
account:read
Hesap profilini oku · low
account:balance
Cüzdan ve kredi limitini oku · medium
brand:read
White-label marka manifestini oku · low
brand:manage
Logo, renk, destek ve özel alan adı ayarlarını değiştir · high
orders:read
Sipariş listesi ve detayını oku · medium
orders:create
Yeni canlı veya test siparişi oluştur · high
orders:cancel
Sipariş iptal işlemi başlat · critical
esims:read
eSIM durumunu ve kullanımını oku · medium
esims:suspend
eSIM hizmetini askıya al · critical
esims:resume
Askıya alınmış eSIM hizmetini sürdür · high
esims:usage
Kalan, kullanılan ve toplam veri ile geçmiş snapshotları oku · medium
esims:device
Provider tarafından doğrulanan EID, IMEI, marka, model ve işletim sistemini oku · high
esims:installation
Kurulum ve aktivasyon durumunu, SM-DP+ durumunu ve zamanlarını oku · high
esims:events
Aktivasyon, kurulum, kullanım ve durum değişikliklerini oku · medium
esims:sync
eSIMAccess üzerinden anlık profil ve kullanım yenilemesi yap · high
topups:create
eSIM paket yükleme işlemi oluştur · high
topups:read
ICCID için eSIMAccess tarafından sunulan uygun yükleme paketlerini oku · medium
webhooks:read
Uç ve teslimat durumlarını oku · medium
webhooks:manage
Webhook ucu ekle veya devre dışı bırak · critical
webhooks:test
İmzalı test olayı kuyruğa al · high
usage:read
Limit, trafik ve hata özetini oku · medium