airalo-sdk 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of airalo-sdk might be problematic. Click here for more details.

@@ -0,0 +1,939 @@
1
+ Metadata-Version: 2.4
2
+ Name: airalo-sdk
3
+ Version: 1.0.0
4
+ Summary: Official Airalo Python SDK for Airalo's REST API
5
+ Home-page: https://github.com/Airalo/airalo-python-sdk
6
+ Author: Airalo
7
+ Author-email: Airalo <partner.integration@airalo.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2025 Airalo
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+
30
+ Classifier: Programming Language :: Python :: 3
31
+ Classifier: License :: OSI Approved :: MIT License
32
+ Requires-Python: >=3.1
33
+ Description-Content-Type: text/markdown
34
+ License-File: LICENSE
35
+ Requires-Dist: requests
36
+ Requires-Dist: cryptography
37
+ Dynamic: author
38
+ Dynamic: home-page
39
+ Dynamic: license-file
40
+ Dynamic: requires-python
41
+
42
+ # Airalo Python SDK
43
+ Airalo's Python SDK provides simple integration with the REST API and an extra layer of convenience on top.
44
+ The SDK supports:
45
+ - automatic authentication
46
+ - optional caching and rate‑limit handling
47
+ - fetching packages: local, global, country, and all combined
48
+ - auto‑pagination on package endpoints
49
+ - ordering packages
50
+ - bulk ordering different packages and quantities at once
51
+ - top‑up ordering
52
+ - unified JSON responses as standard Python dicts
53
+ - works on Linux, macOS, and Windows
54
+
55
+ # Requisites
56
+ - Python >= `3.11`
57
+ - `requests` installed (the SDK depends on it)
58
+
59
+ # Installation
60
+ Install via pip:
61
+ ```bash
62
+ pip install airalo-sdk
63
+ ```
64
+
65
+ # Initialization
66
+ Object usage:
67
+ ```python
68
+ from airalo import Airalo
69
+
70
+ alo = Airalo({
71
+ "client_id": "<YOUR_API_CLIENT_ID>", # mandatory
72
+ "client_secret": "<YOUR_API_CLIENT_SECRET>", # mandatory
73
+ })
74
+
75
+ all_packages = alo.get_all_packages(flat=True)
76
+ ```
77
+
78
+ # Responses
79
+ The SDK returns standard Python dicts. You can access keys directly or convert to strings with `json.dumps` if needed.
80
+
81
+ # Methods Interface
82
+ <h2> Packages </h2>
83
+
84
+ >**_NOTE:_**
85
+ >Passing `True` to the `flat` parameter makes the response significantly more compact and easy to handle. However it differs from the main one returned from the endpoints. Be mindful when you need the original vs the compact version.
86
+
87
+ `def get_all_packages(flat: bool = False, limit: int | None = None, page: int | None = None) -> dict | None`
88
+ Fetching all Airalo packages. By default the response mirrors the packages REST endpoint (more here: https://developers.partners.airalo.com/get-packages-11883036e0). Passing `flat=True` returns package objects in a single data object, example:
89
+ ```json
90
+ {
91
+ "data": [
92
+ {
93
+ "package_id": "meraki-mobile-7days-1gb",
94
+ "slug": "greece",
95
+ "type": "sim",
96
+ "price": 5,
97
+ "net_price": 4,
98
+ "amount": 1024,
99
+ "day": 7,
100
+ "is_unlimited": false,
101
+ "title": "1 GB - 7 Days",
102
+ "data": "1 GB",
103
+ "short_info": "This eSIM doesn't come with a phone number.",
104
+ "voice": null,
105
+ "text": null,
106
+ "plan_type": "data",
107
+ "activation_policy": "first-usage",
108
+ "operator": {
109
+ "title": "Meraki Mobile",
110
+ "is_roaming": true,
111
+ "info": [
112
+ "LTE Data-only eSIM.",
113
+ "Rechargeable online with no expiry.",
114
+ "Operates on the Wind network in Greece."
115
+ ]
116
+ },
117
+ "countries": [
118
+ "GR"
119
+ ],
120
+ "prices": {
121
+ "net_price": {
122
+ "AUD": 6.44,
123
+ "BRL": 23.52,
124
+ "GBP": 3.2,
125
+ "AED": 14.68,
126
+ "EUR": 3.84,
127
+ "ILS": 14.32,
128
+ "JPY": 616.67,
129
+ "MXN": 82.72,
130
+ "USD": 4.0,
131
+ "VND": 100330.0
132
+ },
133
+ "recommended_retail_price": {
134
+ "AUD": 10.07,
135
+ "BRL": 36.75,
136
+ "GBP": 5.0,
137
+ "AED": 22.93,
138
+ "EUR": 6.01,
139
+ "ILS": 22.38,
140
+ "JPY": 963.54,
141
+ "MXN": 129.25,
142
+ "USD": 6.25,
143
+ "VND": 156765.62
144
+ }
145
+ }
146
+ },
147
+ {
148
+ "package_id": "meraki-mobile-7days-1gb-topup",
149
+ "slug": "greece",
150
+ "type": "topup",
151
+ "price": 5,
152
+ "net_price": 4,
153
+ "amount": 1024,
154
+ "day": 7,
155
+ "is_unlimited": false,
156
+ "title": "1 GB - 7 Days",
157
+ "data": "1 GB",
158
+ "short_info": null,
159
+ "voice": null,
160
+ "text": null,
161
+ "plan_type": "data",
162
+ "activation_policy": "first-usage",
163
+ "operator": {
164
+ "title": "Meraki Mobile",
165
+ "is_roaming": true,
166
+ "info": [
167
+ "LTE Data-only eSIM.",
168
+ "Rechargeable online with no expiry.",
169
+ "Operates on the Wind network in Greece."
170
+ ]
171
+ },
172
+ "countries": [
173
+ "GR"
174
+ ],
175
+ "prices": {
176
+ "net_price": {
177
+ "AUD": 6.44,
178
+ "BRL": 23.52,
179
+ "GBP": 3.2,
180
+ "AED": 14.68,
181
+ "EUR": 3.84,
182
+ "ILS": 14.32,
183
+ "JPY": 616.67,
184
+ "MXN": 82.72,
185
+ "USD": 4.0,
186
+ "VND": 100330.0
187
+ },
188
+ "recommended_retail_price": {
189
+ "AUD": 10.07,
190
+ "BRL": 36.75,
191
+ "GBP": 5.0,
192
+ "AED": 22.93,
193
+ "EUR": 6.01,
194
+ "ILS": 22.38,
195
+ "JPY": 963.54,
196
+ "MXN": 129.25,
197
+ "USD": 6.25,
198
+ "VND": 156765.62
199
+ }
200
+ }
201
+ }
202
+ ]
203
+ }
204
+ ```
205
+ By default no limit is applied if `limit` is empty.
206
+ By default it auto‑paginates all pages (multiple calls) or if `page` is provided it will be the starting index.
207
+
208
+ `def get_local_packages(flat: bool = False, limit: int | None = None, page: int | None = None) -> dict | None`
209
+ Fetching local packages. Same behavior as above.
210
+
211
+ `def get_global_packages(flat: bool = False, limit: int | None = None, page: int | None = None) -> dict | None`
212
+ Fetching global packages. Same behavior as above.
213
+
214
+ `def get_country_packages(country_code: str, flat: bool = False, limit: int | None = None) -> dict | None`
215
+ Fetching country‑specific packages. Same behavior as above.
216
+
217
+ `def get_sim_packages(flat: bool = False, limit: int | None = None, page: int | None = None) -> dict | None`
218
+ Fetching SIM‑only packages without top‑ups. Same behavior as above.
219
+
220
+ <h2> Orders </h2>
221
+
222
+ `def order(package_id: str, quantity: int, description: str | None = None) -> dict | None`
223
+ Places an order for a given package id and calls the `order` endpoint.
224
+ Full response example: https://developers.partners.airalo.com/submit-order-11883024e0
225
+ ```python
226
+ order = alo.order(package_id, 1)
227
+ ```
228
+
229
+ `def order_async(package_id: str, quantity: int, webhook_url: str | None = None, description: str | None = None) -> dict | None`
230
+ Places an async order for a given package id and calls the `order-async` endpoint.
231
+ Docs: https://developers.partners.airalo.com/submit-order-async-11883025e0
232
+ ```python
233
+ order_async = alo.order_async(package_id, 1, "https://your-webhook.com")
234
+ ```
235
+
236
+ `def order_with_email_sim_share(package_id: str, quantity: int, esim_cloud: dict, description: str | None = None) -> dict | None`
237
+ Places an order and emails the end user with an eSIMs Cloud sharing link (and optional PDF). `esim_cloud` must include `to_email` and `sharing_option` of `["link"]`, `["pdf"]`, or both. Optional `copy_address` list.
238
+ ```python
239
+ order = alo.order_with_email_sim_share(
240
+ package_id, 1,
241
+ {
242
+ "to_email": "end.user.email@domain.com", # mandatory
243
+ "sharing_option": ["link", "pdf"], # mandatory
244
+ "copy_address": ["other.user.email@domain.com"] # optional
245
+ }
246
+ )
247
+ ```
248
+
249
+ `def order_bulk(packages: dict[str, int], description: str | None = None) -> dict | None`
250
+ Parameters: `packages` mapping where the key is the package id and the value is the desired quantity.
251
+ Parallel ordering for multiple packages (up to 50 different package ids) within the same call. Example:
252
+ ```python
253
+ all_packages = alo.get_all_packages(True)
254
+ first_package = all_packages["data"][0]["package_id"]
255
+ second_package = all_packages["data"][1]["package_id"]
256
+
257
+ orders = alo.order_bulk({
258
+ first_package: 2,
259
+ second_package: 1,
260
+ })
261
+ ```
262
+ Example response:
263
+ ```json
264
+ {
265
+ "change-7days-1gb": {
266
+ "data": {
267
+ "id": 77670,
268
+ "code": "20240514-077670",
269
+ "currency": "USD",
270
+ "package_id": "change-7days-1gb",
271
+ "quantity": 1,
272
+ "type": "sim",
273
+ "description": "Bulk order placed via Airalo Python SDK",
274
+ "esim_type": "Prepaid",
275
+ "validity": 7,
276
+ "package": "Change-1 GB - 7 Days",
277
+ "data": "1 GB",
278
+ "price": 4.5,
279
+ "created_at": "2024-05-14 11:48:47",
280
+ "manual_installation": "<p><b>eSIM name:</b> Change</p><p><b>Coverage: </b>United States</p><p><b>To manually activate the eSIM on your eSIM capable device:</b></p><ol><li>Settings > Cellular/Mobile > Add Cellular/Mobile Plan.</li><li>Manually enter the SM-DP+ Address and activation code.</li><li>Confirm eSIM plan details.</li><li>Label the eSIM.</li></ol><p><b>To access Data:</b></p><ol><li>Enable data roaming.</li></ol>",
281
+ "qrcode_installation": "<p><b>eSIM name:</b> Change</p><p><b>Coverage: </b>United States</p><p><b>To activate the eSIM by scanning the QR code on your eSIM capable device you need to print or display this QR code on other device:</b></p><ol><li>Settings > Cellular/Mobile > Add Cellular/Mobile Plan.</li><li>Scan QR code.</li><li>Confirm eSIM plan details.</li><li>Label the eSIM.</li></ol><p><b>To access Data:</b></p><ol><li>Enable data roaming.</li></ol>",
282
+ "installation_guides": {
283
+ "en": "https://www.airalo.com/help/getting-started-with-airalo"
284
+ },
285
+ "text": null,
286
+ "voice": null,
287
+ "net_price": 3.6,
288
+ "sims": [
289
+ {
290
+ "id": 102795,
291
+ "created_at": "2024-05-14 11:48:47",
292
+ "iccid": "893000000000034143",
293
+ "lpa": "lpa.airalo.com",
294
+ "imsis": null,
295
+ "matching_id": "TEST",
296
+ "qrcode": "LPA:1$lpa.airalo.com$TEST",
297
+ "qrcode_url": "https://airalo.com/qr?expires=1802000927&id=137975&signature=b4e731d218fdc707b677c89d54d41773d250a38c160cf7d97f6e9493b5fec0ee",
298
+ "airalo_code": null,
299
+ "apn_type": "automatic",
300
+ "apn_value": null,
301
+ "is_roaming": true,
302
+ "confirmation_code": null,
303
+ "apn": {
304
+ "ios": {
305
+ "apn_type": "automatic",
306
+ "apn_value": null
307
+ },
308
+ "android": {
309
+ "apn_type": "automatic",
310
+ "apn_value": null
311
+ }
312
+ },
313
+ "msisdn": null
314
+ },
315
+ {
316
+ "id": 102795,
317
+ "created_at": "2024-05-14 11:48:47",
318
+ "iccid": "893000000000034143",
319
+ "lpa": "lpa.airalo.com",
320
+ "imsis": null,
321
+ "matching_id": "TEST",
322
+ "qrcode": "LPA:1$lpa.airalo.com$TEST",
323
+ "qrcode_url": "https://airalo.com/qr?expires=1802000927&id=137975&signature=b4e731d218fdc707b677c89d54d41773d250a38c160cf7d97f6e9493b5fec0ee",
324
+ "airalo_code": null,
325
+ "apn_type": "automatic",
326
+ "apn_value": null,
327
+ "is_roaming": true,
328
+ "confirmation_code": null,
329
+ "apn": {
330
+ "ios": {
331
+ "apn_type": "automatic",
332
+ "apn_value": null
333
+ },
334
+ "android": {
335
+ "apn_type": "automatic",
336
+ "apn_value": null
337
+ }
338
+ },
339
+ "msisdn": null
340
+ }
341
+ ]
342
+ },
343
+ "meta": {
344
+ "message": "success"
345
+ }
346
+ },
347
+ "change-7days-1gb-topup": {
348
+ "data": {
349
+ "id": 77671,
350
+ "code": "20240514-077671",
351
+ "currency": "USD",
352
+ "package_id": "change-7days-1gb-topup",
353
+ "quantity": 1,
354
+ "type": "sim",
355
+ "description": "Bulk order placed via Airalo Python SDK",
356
+ "esim_type": "Prepaid",
357
+ "validity": 7,
358
+ "package": "Change-1 GB - 7 Days",
359
+ "data": "1 GB",
360
+ "price": 4.5,
361
+ "created_at": "2024-05-14 11:48:47",
362
+ "manual_installation": "<p><b>eSIM name:</b> Change</p><p><b>Coverage: </b>United States</p><p><b>To manually activate the eSIM on your eSIM capable device:</b></p><ol><li>Settings > Cellular/Mobile > Add Cellular/Mobile Plan.</li><li>Manually enter the SM-DP+ Address and activation code.</li><li>Confirm eSIM plan details.</li><li>Label the eSIM.</li></ol><p><b>To access Data:</b></p><ol><li>Enable data roaming.</li></ol>",
363
+ "qrcode_installation": "<p><b>eSIM name:</b> Change</p><p><b>Coverage: </b>United States</p><p><b>To activate the eSIM by scanning the QR code on your eSIM capable device you need to print or display this QR code on other device:</b></p><ol><li>Settings > Cellular/Mobile > Add Cellular/Mobile Plan.</li><li>Scan QR code.</li><li>Confirm eSIM plan details.</li><li>Label the eSIM.</li></ol><p><b>To access Data:</b></p><ol><li>Enable data roaming.</li></ol>",
364
+ "installation_guides": {
365
+ "en": "https://www.airalo.com/help/getting-started-with-airalo"
366
+ },
367
+ "text": null,
368
+ "voice": null,
369
+ "net_price": 3.6,
370
+ "sims": [
371
+ {
372
+ "id": 102796,
373
+ "created_at": "2024-05-14 11:48:47",
374
+ "iccid": "893000000000034144",
375
+ "lpa": "lpa.airalo.com",
376
+ "imsis": null,
377
+ "matching_id": "TEST",
378
+ "qrcode": "LPA:1$lpa.airalo.com$TEST",
379
+ "qrcode_url": "https://airalo.com/qr?expires=1802000927&id=137976&signature=978adede2174b6de7d2502841d6d901d417d643570dd6172c71733cde5f72503",
380
+ "airalo_code": null,
381
+ "apn_type": "automatic",
382
+ "apn_value": null,
383
+ "is_roaming": true,
384
+ "confirmation_code": null,
385
+ "apn": {
386
+ "ios": {
387
+ "apn_type": "automatic",
388
+ "apn_value": null
389
+ },
390
+ "android": {
391
+ "apn_type": "automatic",
392
+ "apn_value": null
393
+ }
394
+ },
395
+ "msisdn": null
396
+ }
397
+ ]
398
+ },
399
+ "meta": {
400
+ "message": "success"
401
+ }
402
+ }
403
+ }
404
+ ```
405
+ >**_NOTE:_**
406
+ >Each package id is a key in the returned response. The quantity of `sims` represents the ordered quantity.
407
+ ><b>If an error occurs in a parallel order, the error response is assigned to that package id key. Validate each item.</b>
408
+
409
+ Example error:
410
+ ```json
411
+ {
412
+ "change-7days-1gb": {"data":{"quantity":"The quantity may not be greater than 50."},"meta":{"message":"the parameter is invalid"}},
413
+ "change-7days-1gb-topup": {
414
+ "data": {
415
+ "id": 77671,
416
+ "code": "20240514-077671",
417
+ "currency": "USD",
418
+ "package_id": "change-7days-1gb-topup",
419
+ "quantity": 1,
420
+ "type": "sim",
421
+ "description": "Bulk order placed via Airalo Python SDK",
422
+ "esim_type": "Prepaid",
423
+ "validity": 7,
424
+ "package": "Change-1 GB - 7 Days",
425
+ "data": "1 GB",
426
+ "price": 4.5,
427
+ "created_at": "2024-05-14 11:48:47",
428
+ "manual_installation": "<p><b>eSIM name:</b> Change</p><p><b>Coverage: </b>United States</p><p><b>To manually activate the eSIM on your eSIM capable device:</b></p><ol><li>Settings > Cellular/Mobile > Add Cellular/Mobile Plan.</li><li>Manually enter the SM-DP+ Address and activation code.</li><li>Confirm eSIM plan details.</li><li>Label the eSIM.</li></ol><p><b>To access Data:</b></p><ol><li>Enable data roaming.</li></ol>",
429
+ "qrcode_installation": "<p><b>eSIM name:</b> Change</p><p><b>Coverage: </b>United States</p><p><b>To activate the eSIM by scanning the QR code on your eSIM capable device you need to print or display this QR code on other device:</b></p><ol><li>Settings > Cellular/Mobile > Add Cellular/Mobile Plan.</li><li>Scan QR code.</li><li>Confirm eSIM plan details.</li><li>Label the eSIM.</li></ol><p><b>To access Data:</b></p><ol><li>Enable data roaming.</li></ol>",
430
+ "installation_guides": {
431
+ "en": "https://www.airalo.com/help/getting-started-with-airalo"
432
+ },
433
+ "text": null,
434
+ "voice": null,
435
+ "net_price": 3.6,
436
+ "sims": [
437
+ {
438
+ "id": 102796,
439
+ "created_at": "2024-05-14 11:48:47",
440
+ "iccid": "893000000000034144",
441
+ "lpa": "lpa.airalo.com",
442
+ "imsis": null,
443
+ "matching_id": "TEST",
444
+ "qrcode": "LPA:1$lpa.airalo.com$TEST",
445
+ "qrcode_url": "https://airalo.com/qr?expires=1802000927&id=137976&signature=978adede2174b6de7d2502841d6d901d417d643570dd6172c71733cde5f72503",
446
+ "airalo_code": null,
447
+ "apn_type": "automatic",
448
+ "apn_value": null,
449
+ "is_roaming": true,
450
+ "confirmation_code": null,
451
+ "apn": {
452
+ "ios": {
453
+ "apn_type": "automatic",
454
+ "apn_value": null
455
+ },
456
+ "android": {
457
+ "apn_type": "automatic",
458
+ "apn_value": null
459
+ }
460
+ },
461
+ "msisdn": null
462
+ }
463
+ ]
464
+ },
465
+ "meta": {
466
+ "message": "success"
467
+ }
468
+ }
469
+ }
470
+ ```
471
+
472
+ `def order_async_bulk(packages: dict[str, int], webhook_url: str | None = None, description: str | None = None) -> dict | None`
473
+ Parallel async ordering for multiple packages (up to 50 different ids) within the same call.
474
+ ```python
475
+ orders = alo.order_async_bulk({ first_package: 2, second_package: 1 }, "https://your-webhook.com")
476
+ ```
477
+ Example response:
478
+ ```json
479
+ {
480
+ "change-7days-1gb": {
481
+ "data": {
482
+ "request_id": "PWhB8cr-QXPssdA2O2RRvzaeT",
483
+ "accepted_at": "2024-07-17 10:10:31"
484
+ },
485
+ "meta": {
486
+ "message": "success"
487
+ }
488
+ },
489
+ "change-30days-10gb": {
490
+ "data": {
491
+ "request_id": "nYcMsdlgtCsE_sXFAE0vdikSd",
492
+ "accepted_at": "2024-07-17 10:10:31"
493
+ },
494
+ "meta": {
495
+ "message": "success"
496
+ }
497
+ }
498
+ }
499
+ ```
500
+
501
+ `def order_bulk_with_email_sim_share(packages: dict[str, int], esim_cloud: dict, description: str | None = None) -> dict | None`
502
+ Parallel ordering for multiple packages with eSIMs Cloud email share.
503
+ ```python
504
+ orders = alo.order_bulk_with_email_sim_share(
505
+ { first_package: 2, second_package: 1 },
506
+ {
507
+ "to_email": "end.user.email@domain.com", # mandatory
508
+ "sharing_option": ["link", "pdf"], # mandatory
509
+ "copy_address": ["another.user.email@domain.com"], # optional
510
+ }
511
+ )
512
+ ```
513
+
514
+ <h2> Vouchers </h2>
515
+
516
+ `def voucher(usage_limit: int, amount: int, quantity: int, is_paid: bool | None = False, voucher_code: str | None = None) -> dict | None`
517
+ Calls the `voucher` endpoint.
518
+ ```python
519
+ vouchers = alo.voucher(40, 22, 1, False, "ABC111")
520
+ ```
521
+ Example response:
522
+ ```json
523
+ {
524
+ "data": {
525
+ "id": 8,
526
+ "code": "ABC111",
527
+ "usage_limit": 40,
528
+ "amount": 22,
529
+ "is_paid": false,
530
+ "created_at": "2024-06-10 07:23:24"
531
+ },
532
+ "meta": { "message": "success" }
533
+ }
534
+ ```
535
+
536
+ <h2> Esim Vouchers </h2>
537
+
538
+ `def esim_vouchers(vouchers: list[dict]) -> dict | None`
539
+ Calls `voucher/esim`. Full response: https://developers.partners.airalo.com/esim-voucher-11883065e0
540
+ ```python
541
+ vouchers = alo.esim_vouchers([{ "package_id": "package_slug", "quantity": 2 }])
542
+ ```
543
+ Example response:
544
+ ```json
545
+ {
546
+ "data": [
547
+ {
548
+ "package_id": "package_slug",
549
+ "codes": [
550
+ "BIXLAAAA",
551
+ "BSXLAAAA"
552
+ ]
553
+ }
554
+ ],
555
+ "meta": {
556
+ "message": "success"
557
+ }
558
+ }
559
+ ```
560
+
561
+ <h2> Topups </h2>
562
+
563
+ `def topup(package_id: str, iccid: str, description: str | None = None) -> dict | None`
564
+ Places a top‑up for a given `package_id` and `iccid`. Full response: https://developers.partners.airalo.com/submit-top-up-order-11883026e0
565
+ ```python
566
+ order = alo.order(package_id, 1)
567
+ iccid = order["data"]["sims"][0]["iccid"]
568
+ topup = alo.topup(package_id, iccid)
569
+ ```
570
+
571
+ <h2> Sim Usage </h2>
572
+
573
+ `def sim_usage(iccid: str) -> dict | None`
574
+ Calls `simUsage`. Full response: https://developers.partners.airalo.com/get-usage-data-text-voice-11883030e0
575
+ ```python
576
+ usage = alo.sim_usage(iccid)
577
+ ```
578
+
579
+ `def sim_usage_bulk(iccids: list[str]) -> dict | None`
580
+ Parallel usage calls for multiple ICCIDs.
581
+ ```python
582
+ usage = alo.sim_usage_bulk(["870000000001", "870000000002", "870000000003", "870000000004"])
583
+ ```
584
+ >**_NOTE:_**
585
+ >Each ICCID is a key in the returned response.
586
+ ><b>If an error occurs in a parallel usage call, the error response is assigned to that ICCID key.</b>
587
+
588
+ <h2> Sim Topups </h2>
589
+
590
+ `def get_sim_topups(iccid: str) -> dict | None`
591
+ Fetches available top‑ups for an `iccid`. Full response: https://developers.partners.airalo.com/get-top-up-package-list-11883031e0
592
+ ```python
593
+ available_topups = alo.get_sim_topups(iccid)
594
+ ```
595
+
596
+ <h2> Sim Package History </h2>
597
+
598
+ `def get_sim_package_history(iccid: str) -> dict | None`
599
+ Fetches package history for an `iccid`. Full response: https://developers.partners.airalo.com/get-esim-package-history-11883032e0
600
+ ```python
601
+ sim_package_history = alo.get_sim_package_history(iccid)
602
+ ```
603
+
604
+ <h2> Exchange Rates </h2>
605
+
606
+ `def get_exchange_rates(date: str | None = None, source: str | None = None, from_currency: str | None = None, to: str | None = None) -> dict | None`
607
+ Fetches exchange rates.
608
+ `date` - `YYYY-MM-DD` format. If not provided, current date is used.
609
+ `source` - keep `None`.
610
+ `from_currency` - usually `USD`.
611
+ `to` - comma‑separated list of currency codes, e.g. `"AUD,GBP,EUR"`.
612
+ ```python
613
+ exchange_rates = alo.get_exchange_rates()
614
+ ```
615
+ Example:
616
+ ```python
617
+ exchange_rates = alo.get_exchange_rates("2025-01-30", None, None, "AUD,GBP,EUR")
618
+ ```
619
+ ```json
620
+ {
621
+ "data": {
622
+ "date": "2025-01-30",
623
+ "rates": [
624
+ {
625
+ "from": "USD",
626
+ "mid": "1.6059162",
627
+ "to": "AUD"
628
+ },
629
+ {
630
+ "from": "USD",
631
+ "mid": "0.80433592",
632
+ "to": "GBP"
633
+ },
634
+ {
635
+ "from": "USD",
636
+ "mid": "0.96191527",
637
+ "to": "EUR"
638
+ }
639
+ ]
640
+ },
641
+ "meta": {
642
+ "message": "success"
643
+ }
644
+ }
645
+ ```
646
+
647
+ <h2> Sim Instructions </h2>
648
+
649
+ `def get_installation_instructions(params: dict) -> dict | None`
650
+ Provide `{"iccid": "<ICCID>", "language": "en"}`. Full response: https://developers.partners.airalo.com/get-installation-instructions-11883029e0
651
+ ```python
652
+ instructions = alo.get_installation_instructions({"iccid": "893000000000002115", "language": "en"})
653
+ ```
654
+ Example response:
655
+ ```json
656
+ {
657
+ "data": {
658
+ "instructions": {
659
+ "language": "EN",
660
+ "ios": [
661
+ {
662
+ "model": null,
663
+ "version": "15.0,14.0.,13.0,12.0",
664
+ "installation_via_qr_code": {
665
+ "steps": {
666
+ "1": "Go to Settings > Cellular/Mobile > Add Cellular/Mobile Plan.",
667
+ "2": "Scan the QR Code.",
668
+ "3": "Tap on 'Add Cellular Plan'.",
669
+ "4": "Label the eSIM.",
670
+ "5": "Choose preferred default line to call or send messages.",
671
+ "6": "Choose the preferred line to use with iMessage, FaceTime, and Apple ID.",
672
+ "7": "Choose the eSIM plan as your default line for Cellular Data and do not turn on 'Allow Cellular Data Switching' to prevent charges on your other line.",
673
+ "8": "Your eSIM has been installed successfully, please scroll down to see the settings for accessing data."
674
+ },
675
+ "qr_code_data": "5a30d830-cfa9-4353-8d76-f103351d53b6",
676
+ "qr_code_url": "https://www.conroy.biz/earum-dolor-qui-molestiae-at"
677
+ },
678
+ "installation_manual": {
679
+ "steps": {
680
+ "1": "Go to Settings > Cellular/Mobile > Add Cellular/Mobile Plan.",
681
+ "2": "Tap on 'Enter Details Manually'.",
682
+ "3": "Enter your SM-DP+ Address and Activation Code.",
683
+ "4": "Tap on 'Add Cellular Plan'.",
684
+ "5": "Label the eSIM.",
685
+ "6": "Choose preferred default line to call or send messages.",
686
+ "7": "Choose the preferred line to use with iMessage, FaceTime, and Apple ID.",
687
+ "8": "Choose the eSIM plan as your default line for Cellular Data and do not turn on 'Allow Cellular Data Switching' to prevent charges on your other line.",
688
+ "9": "Your eSIM has been installed successfully, please scroll down to see the settings for accessing data."
689
+ },
690
+ "smdp_address_and_activation_code": "6a7f7ab6-6469-461d-8b17-2ee5c0207d22"
691
+ },
692
+ "network_setup": {
693
+ "steps": {
694
+ "1": "Select your eSIM under 'Cellular Plans'.",
695
+ "2": "Ensure that 'Turn On This Line' is toggled on.",
696
+ "3": "Go to 'Network Selection' and select the supported network.",
697
+ "4": "Need help? Chat with us."
698
+ },
699
+ "apn_type": "manual",
700
+ "apn_value": "globaldata",
701
+ "is_roaming": null
702
+ }
703
+ },
704
+ {
705
+ "model": null,
706
+ "version": null,
707
+ "installation_via_qr_code": {
708
+ "steps": {
709
+ "1": "Go to Settings > Cellular/Mobile Data > Add eSIM or Set up Cellular/Mobile Service > Use QR Code on your device. ",
710
+ "2": "Scan the QR code available on the app, then tap “Continue” twice and wait for a while. Your eSIM will connect to the network, this may take a few minutes, then tap “Done”.",
711
+ "3": "Choose a label for your new eSIM plan.",
712
+ "4": "Choose “Primary” for your default line, then tap “Continue”.",
713
+ "5": "Choose “Primary” you want to use with iMessage and FaceTime for your Apple ID, then tap “Continue”.",
714
+ "6": "Choose your new eSIM plan for cellular/mobile data, then tap “Continue”."
715
+ },
716
+ "qr_code_data": "5a30d830-cfa9-4353-8d76-f103351d53b6",
717
+ "qr_code_url": "https://www.conroy.biz/earum-dolor-qui-molestiae-at"
718
+ },
719
+ "installation_manual": {
720
+ "steps": {
721
+ "1": "Go to Settings > Cellular/Mobile Data > Add eSIM or Set up Cellular/Mobile Service > Use QR Code on your device.",
722
+ "2": "Tap “Enter Details Manually” and enter the SM-DP+ Address and Activation Code available on the app by copying them, tap “Next”, then tap “Continue” twice and wait for a while. Your eSIM will connect to the network, this may take a few minutes, then tap “Done”.",
723
+ "3": "Choose a label for your new eSIM plan.",
724
+ "4": "Choose “Primary” for your default line, then tap “Continue”.",
725
+ "5": "Choose “Primary” you want to use with iMessage and FaceTime for your Apple ID, then tap “Continue”.",
726
+ "6": "Choose your new eSIM plan for cellular/mobile data, then tap “Continue”."
727
+ },
728
+ "smdp_address_and_activation_code": "6a7f7ab6-6469-461d-8b17-2ee5c0207d22"
729
+ },
730
+ "network_setup": {
731
+ "steps": {
732
+ "1": "Go to “Cellular/Mobile Data”, then select the recently downloaded eSIM on your device. Enable the “Turn On This Line” toggle, then select your new eSIM plan for cellular/mobile data. ",
733
+ "2": "Tap “Network Selection”, disable the “Automatic” toggle, then select the supported network available on the app manually if your eSIM has connected to the wrong network."
734
+ },
735
+ "apn_type": "manual",
736
+ "apn_value": "globaldata",
737
+ "is_roaming": null
738
+ }
739
+ }
740
+ ],
741
+ "android": [
742
+ {
743
+ "model": null,
744
+ "version": null,
745
+ "installation_via_qr_code": {
746
+ "steps": {
747
+ "1": "Go to Settings > Connections > SIM Card Manager.",
748
+ "2": "Tap on 'Add Mobile Plan'.",
749
+ "3": "Tap on 'Scan Carrier QR Code' and tap on 'Add'.",
750
+ "4": "When the plan has been registered, tap 'Ok' to turn on a new mobile plan.",
751
+ "5": "Your eSIM has been installed successfully, please scroll down to see the settings for accessing data."
752
+ },
753
+ "qr_code_data": "5a30d830-cfa9-4353-8d76-f103351d53b6",
754
+ "qr_code_url": "https://www.conroy.biz/earum-dolor-qui-molestiae-at"
755
+ },
756
+ "installation_manual": {
757
+ "steps": {
758
+ "1": "Go to Settings > Connections > SIM Card Manager.",
759
+ "2": "Tap on 'Add Mobile Plan'.",
760
+ "3": "Tap on 'Scan Carrier QR Code' and tap on 'Enter code instead'.",
761
+ "4": "Enter the Activation Code (SM-DP+ Address & Activation Code).",
762
+ "5": "When the plan has been registered, tap 'Ok' to turn on a new mobile plan.",
763
+ "6": "Your eSIM has been installed successfully, please scroll down to see the settings for accessing data."
764
+ },
765
+ "smdp_address_and_activation_code": "6a7f7ab6-6469-461d-8b17-2ee5c0207d22"
766
+ },
767
+ "network_setup": {
768
+ "steps": {
769
+ "1": "In the 'SIM Card Manager' select your eSIM.",
770
+ "2": "Ensure that your eSIM is turned on under 'Mobile Networks'.",
771
+ "3": "Enable the Mobile Data.",
772
+ "4": "Go to Settings > Connections > Mobile networks > Network Operators.",
773
+ "5": "Ensure that the supported network is selected.",
774
+ "6": "Need help? Chat with us."
775
+ },
776
+ "apn_type": "automatic",
777
+ "apn_value": "globaldata",
778
+ "is_roaming": null
779
+ }
780
+ },
781
+ {
782
+ "model": null,
783
+ "version": null,
784
+ "installation_via_qr_code": {
785
+ "steps": {
786
+ "1": "Go to Settings > Network & internet.",
787
+ "2": "Tap on the '+' (Add) icon next to the Mobile network.",
788
+ "3": "Tap 'Next' when asked, “Don’t have a SIM card?”.",
789
+ "4": "Scan the QR Code.",
790
+ "5": "Your eSIM has been installed successfully, please scroll down to see the settings for accessing data."
791
+ },
792
+ "qr_code_data": "5a30d830-cfa9-4353-8d76-f103351d53b6",
793
+ "qr_code_url": "https://www.conroy.biz/earum-dolor-qui-molestiae-at"
794
+ },
795
+ "installation_manual": {
796
+ "steps": {
797
+ "1": "Go to Settings > Network & internet.",
798
+ "2": "Tap on the '+' (Add) icon next to the Mobile network.",
799
+ "3": "Tap on 'Next' when asked, “Don’t have a SIM card?”.",
800
+ "4": "Tap 'Enter Code Manually'. You will be asked to enter your Activation Code (SM-DP+ Adress & Activation Code).",
801
+ "5": "Your eSIM has been installed successfully, please scroll down to see the settings for accessing data."
802
+ },
803
+ "smdp_address_and_activation_code": "6a7f7ab6-6469-461d-8b17-2ee5c0207d22"
804
+ },
805
+ "network_setup": {
806
+ "steps": {
807
+ "1": "Go to Network & internet and tap on 'Mobile network'.",
808
+ "2": "Connect manually to the supported network.",
809
+ "3": "Turn on eSIM under 'Mobile network'.",
810
+ "4": "Enable the Mobile Data.",
811
+ "5": "Need help? Chat with us."
812
+ },
813
+ "apn_type": "automatic",
814
+ "apn_value": "globaldata",
815
+ "is_roaming": null
816
+ }
817
+ },
818
+ {
819
+ "model": "Galaxy",
820
+ "version": "1",
821
+ "installation_via_qr_code": {
822
+ "steps": {
823
+ "1": "Go to “Settings”, tap “Connections”, then tap “SIM card manager” on your device.",
824
+ "2": "Tap “Add mobile plan”, then tap “Scan carrier QR code”.",
825
+ "3": "Tap “Enter activation code”.",
826
+ "4": "Enter the SM-DP+ Address & Activation Code by copying it, tap “Connect”, then tap “Confirm”."
827
+ },
828
+ "qr_code_data": "5a30d830-cfa9-4353-8d76-f103351d53b6",
829
+ "qr_code_url": "https://www.conroy.biz/earum-dolor-qui-molestiae-at"
830
+ },
831
+ "installation_manual": {
832
+ "steps": {
833
+ "1": "Go to “Settings”, tap “Connections”, then tap “SIM card manager” on your device.",
834
+ "2": "Tap “Add mobile plan”, then tap “Scan carrier QR code”.",
835
+ "3": "Tap “Enter activation code”.",
836
+ "4": "Enter the SM-DP+ Address & Activation Code by copying it, tap “Connect”, then tap “Confirm”."
837
+ },
838
+ "smdp_address_and_activation_code": "6a7f7ab6-6469-461d-8b17-2ee5c0207d22"
839
+ },
840
+ "network_setup": {
841
+ "steps": {
842
+ "1": "Go to “Settings”, tap “Connections”, then tap “SIM card manager” on your device.",
843
+ "2": "Tap “Add mobile plan”, then tap “Scan carrier QR code”.",
844
+ "3": "Tap “Enter activation code”.",
845
+ "4": "Enter the SM-DP+ Address & Activation Code by copying it, tap “Connect”, then tap “Confirm”."
846
+ },
847
+ "apn_type": "automatic",
848
+ "apn_value": "globaldata",
849
+ "is_roaming": null
850
+ }
851
+ }
852
+ ]
853
+ }
854
+ },
855
+ "meta": {
856
+ "message": "success"
857
+ }
858
+ }
859
+ ```
860
+
861
+ <h2> Future Orders </h2>
862
+
863
+ `def create_future_order(package_id: str, quantity: int, due_date: str, webhook_url: str | None = None, description: str | None = None, brand_settings_name: str | None = None, to_email: str | None = None, sharing_option: list[str] | None = None, copy_address: list[str] | None = None) -> dict | None`
864
+ Places a future order via `future-orders`.
865
+ >**_NOTE:_**
866
+ >`due_date` must be in UTC and format `YYYY-MM-DD HH:MM`.
867
+ ```python
868
+ future_order = alo.create_future_order(
869
+ "package_id", 1, "2025-03-10 10:00",
870
+ "https://your-webhook.com",
871
+ "Test description from Python SDK",
872
+ None,
873
+ "end.user.email@domain.com",
874
+ ["link", "pdf"],
875
+ ["other.user.email@domain.com"]
876
+ )
877
+ ```
878
+ Example response:
879
+ ```json
880
+ {
881
+ "data": {
882
+ "request_id": "bUKdUc0sVB_nXJvlz0l8rTqYR",
883
+ "due_date": "2025-03-10 10:00",
884
+ "latest_cancellation_date": "2025-03-09 10:00"
885
+ },
886
+ "meta": { "message": "success" }
887
+ }
888
+ ```
889
+
890
+ <h2> Cancel Future Orders </h2>
891
+
892
+ `def cancel_future_order(request_ids: list[str]) -> dict | None`
893
+ Cancels future orders via `cancel-future-orders`.
894
+ ```python
895
+ cancel_future = alo.cancel_future_order(["request_id_1", "request_id_2", "request_id_3"])
896
+ ```
897
+ Example response:
898
+ ```json
899
+ { "data": {}, "meta": { "message": "Future orders cancelled successfully" } }
900
+ ```
901
+
902
+ <h2> Get Compatible Devices </h2>
903
+
904
+ `def get_compatible_devices() -> dict | None`
905
+ Calls the compatible eSIM devices endpoint.
906
+ ```python
907
+ devices = alo.get_compatible_devices()
908
+ ```
909
+ Example response:
910
+ ```json
911
+ {
912
+ "data": [
913
+ {
914
+ "os": "android",
915
+ "brand": "ABCTECH",
916
+ "name": "X20"
917
+ },
918
+ {
919
+ "os": "android",
920
+ "brand": "Asus",
921
+ "name": "ZenFone Max Pro M1 (ZB602KL) (WW) / Max Pro M1 (ZB601KL) (IN)"
922
+ },
923
+ {
924
+ "os": "android",
925
+ "brand": "Asus",
926
+ "name": "ZenFone Max Pro M1 (ZB602KL) (WW) / Max Pro M1 (ZB601KL) (IN)"
927
+ },
928
+ ...
929
+ ...
930
+ ...
931
+ ]
932
+ }
933
+ ```
934
+
935
+ # Technical notes
936
+ - Auth tokens are cached by the SDK for performance.
937
+ - Package responses are cached for a 1h period.
938
+ - The SDK raises exceptions on non‑2xx responses.
939
+ - Validate each item when using bulk or parallel calls.