{"openapi":"3.1.0","info":{"title":"Reseller eSIM API","version":"1.0.0","description":"Prepaid USD purchases, one plan per request. Amounts are integer cents. Unknown fields, including caller-supplied prices, are rejected on purchases."},"externalDocs":{"description":"Partner integration guide","url":"https://www.esimrefill.com/developers/reseller"},"servers":[{"url":"https://www.esimrefill.com/api/v1","description":"Production (live prepaid orders)"}],"security":[{"PartnerKey":[]}],"paths":{"/destinations":{"get":{"summary":"List countries and regions","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"required":false},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false},{"name":"type","in":"query","schema":{"enum":["country","region"]},"required":false}],"responses":{"200":{"description":"Paginated resource list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Destination"}},"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["data","page","limit","total"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/packages":{"get":{"summary":"Browse available package offers","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"required":false},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false},{"name":"destination","in":"query","schema":{"type":"string"},"required":false}],"responses":{"200":{"description":"Paginated resource list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Package"}},"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["data","page","limit","total"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/packages/{packageId}":{"get":{"summary":"Read a current offer with network coverage","parameters":[{"name":"packageId","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Resource result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PackageDetail"}},"required":["data"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/balance":{"get":{"summary":"Read available prepaid balance","parameters":[],"responses":{"200":{"description":"Resource result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"currency":{"type":"string","const":"USD"},"balance_cents":{"type":"integer"},"discount_bps":{"type":"integer"}},"required":["currency","balance_cents","discount_bps"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders":{"get":{"summary":"List reseller orders","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"required":false},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false},{"name":"status","in":"query","schema":{"type":"string"},"required":false}],"responses":{"200":{"description":"Paginated resource list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/History"}},"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["data","page","limit","total"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Purchase one eSIM","parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","format":"uuid"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"package_id":{"type":"string"}},"required":["package_id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resource result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"}},"required":["data"],"additionalProperties":false}}}},"202":{"description":"Funds debited, fulfillment pending","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"}},"required":["data"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/esims":{"get":{"summary":"List issued eSIM references","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"required":false},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false},{"name":"status","in":"query","schema":{"type":"string"},"required":false}],"responses":{"200":{"description":"Paginated resource list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/History"}},"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["data","page","limit","total"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{orderId}":{"get":{"summary":"Read order, price snapshot and installation details","parameters":[{"name":"orderId","in":"path","schema":{"type":"string","format":"uuid"},"required":true}],"responses":{"200":{"description":"Resource result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"}},"required":["data"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/esims/{esimId}":{"get":{"summary":"Read owned profile and installation credentials","parameters":[{"name":"esimId","in":"path","schema":{"type":"string","format":"uuid"},"required":true}],"responses":{"200":{"description":"Resource result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Profile"}},"required":["data"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/esims/{esimId}/usage":{"get":{"summary":"Read the latest available usage measurement","parameters":[{"name":"esimId","in":"path","schema":{"type":"string","format":"uuid"},"required":true}],"responses":{"200":{"description":"Resource result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ProfileUsage"}},"required":["data"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/esims/{esimId}/topups":{"get":{"summary":"List eligible refill offers","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"required":false},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false},{"name":"esimId","in":"path","schema":{"type":"string","format":"uuid"},"required":true}],"responses":{"200":{"description":"Paginated resource list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Package"}},"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["data","page","limit","total"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Purchase one eligible refill","parameters":[{"name":"esimId","in":"path","schema":{"type":"string","format":"uuid"},"required":true},{"name":"Idempotency-Key","in":"header","schema":{"type":"string","format":"uuid"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"package_id":{"type":"string"}},"required":["package_id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resource result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"}},"required":["data"],"additionalProperties":false}}}},"202":{"description":"Funds debited, fulfillment pending","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Order"}},"required":["data"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/esims/{esimId}/installation":{"post":{"summary":"Rotate private installation link","parameters":[{"name":"esimId","in":"path","schema":{"type":"string","format":"uuid"},"required":true}],"responses":{"200":{"description":"Resource result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"anonymous_url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["anonymous_url"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Revoke private installation link","parameters":[{"name":"esimId","in":"path","schema":{"type":"string","format":"uuid"},"required":true}],"responses":{"200":{"description":"Resource result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"anonymous_url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["anonymous_url"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhook":{"get":{"summary":"Read endpoint configuration","parameters":[],"responses":{"200":{"description":"Resource result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"configured":{"type":"boolean"}},"required":["url","configured"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"summary":"Set endpoint and rotate signing secret","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}}}},"responses":{"200":{"description":"Resource result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"signing_secret":{"type":"string"}},"required":["url","signing_secret"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Disable webhook endpoint","parameters":[],"responses":{"200":{"description":"Resource result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"null"},"signing_secret":{"type":"null"}},"required":["url","signing_secret"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhook/test":{"post":{"summary":"Queue a signed test event","parameters":[],"responses":{"200":{"description":"Resource result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"queued":{"type":"boolean"}},"required":["queued"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhook/deliveries":{"get":{"summary":"List delivery outcomes","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"required":false},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false}],"responses":{"200":{"description":"Paginated resource list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Delivery"}},"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["data","page","limit","total"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhook/deliveries/{eventId}/attempts":{"get":{"summary":"List individual attempts","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"required":false},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false},{"name":"eventId","in":"path","schema":{"type":"string","format":"uuid"},"required":true}],"responses":{"200":{"description":"Paginated resource list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"state":{"type":"string"},"http_status":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["created_at","state","http_status"],"additionalProperties":false}},"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["data","page","limit","total"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/webhook/deliveries/{eventId}/retry":{"post":{"summary":"Retry a failed delivery","parameters":[{"name":"eventId","in":"path","schema":{"type":"string","format":"uuid"},"required":true}],"responses":{"200":{"description":"Resource result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"queued":{"type":"boolean"}},"required":["queued"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"default":{"description":"Request rejected or temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"PartnerKey":{"type":"http","scheme":"bearer","description":"Server-only partner key issued in the reseller workspace"}},"schemas":{"Pricing":{"type":"object","properties":{"currency":{"type":"string","const":"USD"},"retail_cents":{"type":"integer"},"reseller_cents":{"type":"integer"},"issuance_fee_cents":{"const":0},"discount_bps":{"type":"integer"}},"required":["currency","retail_cents","reseller_cents","issuance_fee_cents","discount_bps"],"additionalProperties":false},"Destination":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"type":{"enum":["country","region"]},"countries":{"type":"array","items":{"type":"string"}}},"required":["code","name","type","countries"],"additionalProperties":false},"Package":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"destination":{"type":"string"},"coverage":{"type":"array","items":{"type":"string"}},"data_bytes":{"type":"integer"},"validity":{"type":"integer"},"validity_unit":{"type":"string"},"activation":{"anyOf":[{"type":"string"},{"type":"null"}]},"supports_topup":{"type":"boolean"},"available":{"type":"boolean"},"pricing":{"$ref":"#/components/schemas/Pricing"}},"required":["id","name","destination","coverage","data_bytes","validity","validity_unit","activation","supports_topup","available","pricing"],"additionalProperties":false},"Network":{"type":"object","properties":{"country":{"type":"string"},"operators":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"network":{"type":"string"}},"required":["name","network"],"additionalProperties":false}}},"required":["country","operators"],"additionalProperties":false},"Usage":{"type":"object","properties":{"total_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}]},"used_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}]},"remaining_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}]},"as_of":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["total_bytes","used_bytes","remaining_bytes","as_of"],"additionalProperties":false},"Install":{"type":"object","properties":{"activation_code":{"type":"string"},"smdp_address":{"anyOf":[{"type":"string"},{"type":"null"}]},"matching_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"qr_data_url":{"type":"string"},"ios_url":{"type":"string"},"android_url":{"type":"string"},"anonymous_url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["activation_code","smdp_address","matching_id","qr_data_url","ios_url","android_url","anonymous_url"],"additionalProperties":false},"Profile":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"order_id":{"type":"string","format":"uuid"},"status":{"type":"string"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"package":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"data_bytes":{"type":"integer"},"validity_days":{"type":"integer"}},"required":["id","name","data_bytes","validity_days"],"additionalProperties":false},"usage":{"$ref":"#/components/schemas/Usage"},"iccid":{"type":"string"},"installation":{"anyOf":[{"$ref":"#/components/schemas/Install"},{"type":"null"}]}},"required":["id","order_id","status","expires_at","package","usage","iccid","installation"],"additionalProperties":false},"Order":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"kind":{"enum":["issue","refill"]},"status":{"type":"string"},"package":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"pricing":{"$ref":"#/components/schemas/Pricing"},"esim":{"anyOf":[{"$ref":"#/components/schemas/Profile"},{"type":"null"}]}},"required":["id","created_at","kind","status","package","pricing","esim"],"additionalProperties":false},"History":{"type":"object","properties":{"order_id":{"type":"string","format":"uuid"},"esim_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"kind":{"type":"string"},"package_id":{"type":"string"},"package_name":{"type":"string"},"status":{"type":"string"},"charge_cents":{"type":"integer"},"currency":{"type":"string","const":"USD"},"created_at":{"type":"string","format":"date-time"}},"required":["order_id","esim_id","kind","package_id","package_name","status","charge_cents","currency","created_at"],"additionalProperties":false},"Delivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"state":{"type":"string"},"attempts":{"type":"integer"},"http_status":{"anyOf":[{"type":"integer"},{"type":"null"}]},"next_at":{"type":"string","format":"date-time"}},"required":["id","type","created_at","state","attempts","http_status","next_at"],"additionalProperties":false},"Event":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"time":{"type":"string","format":"date-time"},"order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"esim_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"data":{"type":"object","additionalProperties":true}},"required":["id","type","time","order_id","esim_id","data"],"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"}},"required":["code"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"PackageDetail":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"destination":{"type":"string"},"coverage":{"type":"array","items":{"type":"string"}},"data_bytes":{"type":"integer"},"validity":{"type":"integer"},"validity_unit":{"type":"string"},"activation":{"anyOf":[{"type":"string"},{"type":"null"}]},"supports_topup":{"type":"boolean"},"available":{"type":"boolean"},"pricing":{"$ref":"#/components/schemas/Pricing"},"networks":{"type":"array","items":{"$ref":"#/components/schemas/Network"}}},"required":["id","name","destination","coverage","data_bytes","validity","validity_unit","activation","supports_topup","available","pricing","networks"],"additionalProperties":false},"ProfileUsage":{"type":"object","properties":{"total_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}]},"used_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}]},"remaining_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}]},"as_of":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"id":{"type":"string","format":"uuid"},"status":{"type":"string"}},"required":["total_bytes","used_bytes","remaining_bytes","as_of","id","status"],"additionalProperties":false}}},"webhooks":{"partnerEvent":{"post":{"security":[],"summary":"Signed, at-least-once notification","parameters":[{"name":"X-Webhook-Timestamp","in":"header","schema":{"type":"string"},"required":true},{"name":"X-Webhook-Signature","in":"header","schema":{"type":"string"},"required":true},{"name":"X-Event-ID","in":"header","schema":{"type":"string","format":"uuid"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Event durably accepted"}}}}}}