---
title: "Purchase a physical eSIM"
method: POST
path: "/numbers/esims"
tags: ["Esims"]
---

# Purchase a physical eSIM

`POST /numbers/esims`

Purchases a physical eSIM from available inventory for the authenticated owner. Returns 409 when no stock is available, or 402 with a billing checkout URL when billing capacity is exhausted.

## Request body

- PurchaseEsimInput
  - `idempotencyKey` string — Client-supplied key; replaying the same key returns the original purchase instead of buying again

## Response `201`

eSIM purchased

- object
  - `data` PublicEsim, required
    - `id` string, uuid, required
    - `status` 'in_stock' | 'owned' | 'installing' | 'installed' | 'install_failed' | 'retired', required
    - `source` 'stocked' | 'byo', required
    - `carrierName` string, nullable, required
    - `countryCode` string, nullable, required
    - `iccid` string, nullable, required
    - `subscriptionId` integer, nullable, required
    - `deviceId` string, uuid, nullable, required
    - `deviceUuid` string, nullable, required
    - `msisdn` string, nullable, required
    - `name` string, nullable, required
    - `createdBy` string, nullable, required
    - `networkStatus` 'degraded' | 'null', nullable, required
    - `rentStatus` 'not_applicable' | 'exempt' | 'inactive' | 'awaiting_payment' | 'active' | 'cancel_pending' | 'refund_pending' | 'retiring' | 'billing_error'
    - `checkoutUrl` string, nullable
    - `currentPeriodEnd` string, date-time, nullable
    - `cancellationScheduled` boolean
    - `exempt` boolean
    - `createdAt` string, date-time, nullable, required
    - `updatedAt` string, date-time, nullable, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `402` — Payment required — billing capacity exhausted for this owner
- `409` — Conflict — see `reason` for the stable, machine-readable cause
- `500` — Internal Server Error
- `503` — Service Unavailable — esims are disabled for this deployment (see `reason`)

---

[API](https://skmtc.dev/droidrun/apis/droidrun-cloud.md) · [All operations](https://skmtc.dev/droidrun/apis/droidrun-cloud/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/droidrun/droidrun-cloud/revisions/a1453ac769d4/schema)
