Reseller API Documentation
Integrate PikaSim eSIM purchasing into your application. 10% off retail prices — add your own markup when selling to customers.
All prices returned by the API are 10% below retail. For example, a package that sells for $10.00 on pikasim.com costs you $9.00 via the API. You can resell at any price you choose.
Authentication
All API requests require authentication via API key. Include your API key in the X-API-Key header:
X-API-Key: pk_live_your_api_key_here
Base URL
https://pikasim.com/api/v1/reseller
Account Endpoints
/account
Get your account information and current balance.
Response
{
"success": true,
"data": {
"companyName": "Your Company",
"status": "approved",
"balance": 10000,
"balanceFormatted": "$100.00",
"totalOrders": 42
}
}
/balance
Get your current wallet balance and available credit.
/transactions
List your transaction history with pagination.
Query Parameters
page- Page number (default: 1)limit- Items per page (default: 20, max: 100)type- Filter by type: deposit, order, topup, refund, adjustment
Package Endpoints
Daily packages (marketed as "Unlimited" plans with daily data reset) are currently not available through the reseller API. The API returns fixed data packages only. Daily packages are available on the website and mobile app.
/packages
List available eSIM packages with full details.
Query Parameters
country- Filter by country code (e.g., US, JP, GB)region- Filter by region nameduration- Filter by duration in daysminData- Minimum data in GBmaxData- Maximum data in GBprivacy- Filter by privacy level:max- Only max privacy packages (non-HK/China IP routing)standard- Only standard packages (HK/China IP routing)all- All packages (default)
page- Page numberlimit- Items per page (max: 200)
Response
{
"success": true,
"data": {
"packages": [
{
"packageCode": "JP_7D_1GB",
"name": "Japan 7 Days 1GB",
"slug": "japan-7-days-1gb",
"location": "JP",
"locationCode": "JP",
"region": null,
"isGlobalPackage": false,
"locationNetworkList": [
{
"locationName": "Japan",
"operatorList": [
{ "operatorName": "Docomo", "networkType": "4G" }
]
}
],
"volume": 1073741824,
"volumeGB": 1,
"dataType": 1,
"isUnlimited": false,
"validityDays": 7,
"dailyDataGB": null,
"fupMbps": null,
"duration": 7,
"durationUnit": "DAY",
"speed": "4G/LTE",
"pricingType": "fixed",
"price": 450,
"priceFormatted": "$4.50",
"suggestedRetailPrice": 500,
"suggestedRetailPriceFormatted": "$5.00",
"discount": "10%",
"durationDiscounts": null,
"ipExport": "US",
"maxPrivacy": true,
"smsStatus": 0,
"supportTopUpType": true,
"activeType": 1,
"description": "7-day Japan eSIM with 1GB data"
}
],
"pagination": { "page": 1, "limit": 50, "total": 150, "pages": 3 }
}
}
Field Descriptions
pricingType- IMPORTANT: Either"fixed"or"per_day":"fixed"- Price is total for the package (standard data plans)"per_day"- Price is per day, customer selects duration at checkout (Unlimited Daily plans)
price- Your cost in cents (10% off retail). Forper_dayplans, this is the daily rate.suggestedRetailPrice- Suggested retail price in cents. Forper_dayplans, this is the daily rate.discount- Your discount percentagedurationDiscounts- Forper_dayplans only: object with discount percentages by duration tier. Null for fixed plans.volume- Data volume in bytesvolumeGB- Data volume in GBdataType- 1 = fixed data, 2 = Unlimited DailyisUnlimited- true for Unlimited Daily plans (dataType=2). Use this instead of checking dataType.validityDays- Maximum validity period. For Unlimited plans, this is how long the eSIM remains valid if unused (e.g., 180 days), not the purchased duration.dailyDataGB- For Unlimited plans: daily high-speed data in GB. Null for fixed plans.fupMbps- Fair Usage Policy speed limit in Mbps after daily data exhausted. Parsed from name (e.g., "FUP1Mbps" → 1). Null if not specified.locationCode- ISO country code for single-country packages (e.g., "MA" for Morocco). Null for regional/global.ipExport- Country where traffic exits (null = HK)maxPrivacy- true if non-HK/China IP routingsmsStatus- 0 = no SMS, 1 = SMS supported, 2 = API SMS onlysupportTopUpType- Whether top-ups are availableactiveType- 1 = first install, 2 = first network connection
/packages/:packageCode
Get full details for a specific package (same fields as list response).
Order Endpoints
/orders
Create a new eSIM order. The eSIM details will be delivered via webhook when ready.
Request Body
{
"packageCode": "JP_7D_1GB",
"externalOrderId": "YOUR-REF-123" // Optional: your reference ID
}
Response
{
"success": true,
"data": {
"orderId": "65a4f8c9...",
"externalOrderId": "YOUR-REF-123",
"status": "processing",
"packageCode": "JP_7D_1GB",
"price": 518,
"priceFormatted": "$5.18",
"message": "Order created. eSIM details will be sent via webhook."
}
}
/orders
List your orders with pagination.
Query Parameters
status- Filter by status: pending, processing, completed, failedpage- Page numberlimit- Items per page
/orders/:orderId
Get details for a specific order including eSIM details if completed.
eSIM Endpoints
/esims/:iccid
Get full eSIM details including live status from the network.
Response
{
"success": true,
"data": {
"iccid": "8901234567890123456",
"orderId": "65a4f8c9...",
"externalOrderId": "YOUR-REF-123",
"packageCode": "JP_7D_1GB",
"packageName": "Japan 7 Days 1GB",
"qrCodeUrl": "https://...",
"activationCode": "LPA:1$...",
"lpaUrl": "https://...",
"shortUrl": "https://...",
"status": "IN_USE",
"smdpStatus": "ENABLED",
"totalData": 1073741824,
"usedData": 536870912,
"remainingData": 536870912,
"expireTime": "2024-01-22T00:00:00Z",
"apn": "internet",
"imsi": "...",
"msisdn": "+1234567890",
"packageList": [...],
"purchasedAt": "2024-01-15T10:30:00Z",
"createdAt": "2024-01-15T10:30:05Z"
}
}
/esims/:iccid/usage
Get detailed data usage statistics for an eSIM.
Response
{
"success": true,
"data": {
"iccid": "8901234567890123456",
"status": "IN_USE",
"smdpStatus": "ENABLED",
"statusDescription": "eSIM is active and in use",
"totalData": 1073741824,
"usedData": 536870912,
"remainingData": 536870912,
"totalDataGB": 1,
"usedDataGB": 0.5,
"remainingDataGB": 0.5,
"totalDataMB": 1024,
"usedDataMB": 512,
"remainingDataMB": 512,
"usagePercent": 50,
"expireTime": "2024-01-22T00:00:00Z",
"createTime": "2024-01-15T10:30:00Z",
"packageList": [
{
"packageCode": "JP_7D_1GB",
"packageName": "Japan 7 Days 1GB",
"volume": 1073741824,
"volumeGB": 1,
"duration": 7,
"createTime": "2024-01-15T10:30:00Z"
}
]
}
}
eSIM Status Values
GOT_RESOURCE- eSIM ready for installationIN_USE- eSIM is active and in useENABLED- eSIM is enabled and readySUSPENDED- eSIM has been suspendedUSED_UP- All data has been consumedREVOKED- eSIM has been revoked
/esims/:iccid/topup-options
Get available top-up packages for an eSIM.
/esims/:iccid/topup
Add data to an existing eSIM.
Request Body
{
"packageCode": "JP_TOPUP_1GB",
"externalOrderId": "YOUR-REF-456" // Optional
}
/esims/:iccid/cancel
Cancel an unused eSIM and receive a refund. Only works if the eSIM has not been installed yet.
Requirements
esimStatusmust beGOT_RESOURCEsmdpStatusmust beRELEASED
Response
{
"success": true,
"data": {
"iccid": "89852240810732443908",
"orderId": "65a4f8c9...",
"refundAmount": 500,
"refundFormatted": "$5.00",
"newBalance": 1500,
"newBalanceFormatted": "$15.00",
"message": "eSIM cancelled successfully. Refund added to your balance."
}
}
Error Response (eSIM already in use)
{
"success": false,
"error": "eSIM cannot be cancelled - already installed or in use",
"currentStatus": {
"esimStatus": "IN_USE",
"smdpStatus": "ENABLED"
},
"message": "Only unused eSIMs that have not been installed can be cancelled for a refund."
}
Deposit Endpoints
/deposit/stripe
Create a Stripe checkout session to add funds to your wallet.
Request Body
{
"amount": 10000 // Amount in cents ($100.00)
}
Response
{
"success": true,
"sessionId": "cs_live_...",
"checkoutUrl": "https://checkout.stripe.com/..."
}
/deposit/btcpay
Create a BTCPay invoice to add funds via cryptocurrency.
Request Body
{
"amount": 10000 // Amount in cents ($100.00)
}
Webhooks
Configure a webhook URL to receive real-time notifications when orders are completed.
/webhook
Update your webhook settings.
Request Body
{
"webhookUrl": "https://your-server.com/webhook",
"webhookEvents": ["esim.provisioned", "esim.topup.completed", "order.failed"]
}
/webhook/test
Send a test webhook to verify your endpoint.
Webhook Events
esim.provisioned- eSIM is ready with QR codeesim.topup.completed- Top-up was successfulorder.failed- Order failed (automatic refund issued)
Webhook Payload
{
"event": "esim.provisioned",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"orderId": "65a4f8c9...",
"externalOrderId": "YOUR-REF-123",
"packageCode": "JP_7D_1GB",
"esim": {
"iccid": "8901234567890123456",
"qrCodeUrl": "https://...",
"activationCode": "LPA:1$...",
"shortUrl": "https://..."
}
}
}
Webhook Security
All webhooks include an HMAC-SHA256 signature in the X-Webhook-Signature header. Verify the signature using your webhook secret:
const crypto = require('crypto');
function verifySignature(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(JSON.stringify(payload))
.digest('hex');
return signature === expected;
}
Error Handling
All errors return a consistent format:
{
"success": false,
"error": "Error message here"
}
HTTP Status Codes
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created (for new orders) |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 402 | Payment Required - Insufficient balance |
| 403 | Forbidden - Account suspended or IP not whitelisted |
| 404 | Not Found - Resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
Rate Limiting
Default rate limit is 60 requests per minute. Rate limit headers are included in all responses:
X-RateLimit-Limit- Your rate limitX-RateLimit-Remaining- Remaining requestsX-RateLimit-Reset- Reset timestamp
Support
For API support or to become a reseller partner, contact us at [email protected]