Reseller API Documentation

Integrate PikaSim eSIM purchasing into your application. 10% off retail prices — add your own markup when selling to customers.

Reseller Pricing

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
Getting an API Key: Create a reseller wallet at /reseller, then generate your API key from the dashboard. The key is shown only once - save it securely.

Base URL

https://pikasim.com/api/v1/reseller

Account Endpoints

GET /account

Get your account information and current balance.

Response

{
  "success": true,
  "data": {
    "companyName": "Your Company",
    "status": "approved",
    "balance": 10000,
    "balanceFormatted": "$100.00",
    "totalOrders": 42
  }
}
GET /balance

Get your current wallet balance and available credit.

GET /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

GET /packages

List available eSIM packages with full details.

Query Parameters

  • country - Filter by country code (e.g., US, JP, GB)
  • region - Filter by region name
  • duration - Filter by duration in days
  • minData - Minimum data in GB
  • maxData - Maximum data in GB
  • privacy - 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 number
  • limit - 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",
        "region": null,
        "isGlobalPackage": false,
        "locationNetworkList": [
          {
            "locationName": "Japan",
            "operatorList": [
              { "operatorName": "Docomo", "networkType": "4G" }
            ]
          }
        ],
        "volume": 1073741824,
        "volumeGB": 1,
        "dataType": 1,
        "duration": 7,
        "durationUnit": "DAY",
        "speed": "4G/LTE",
        "price": 450,
        "priceFormatted": "$4.50",
        "suggestedRetailPrice": 500,
        "suggestedRetailPriceFormatted": "$5.00",
        "discount": "10%",
        "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

  • price - Your cost in cents (10% off retail)
  • suggestedRetailPrice - Suggested retail price in cents (same as pikasim.com)
  • discount - Your discount percentage
  • volume - Data volume in bytes
  • volumeGB - Data volume in GB
  • dataType - 1 = fixed data, 2 = daily reset unlimited
  • ipExport - Country where traffic exits (null = HK)
  • maxPrivacy - true if non-HK/China IP routing
  • smsStatus - 0 = no SMS, 1 = SMS supported, 2 = API SMS only
  • supportTopUpType - Whether top-ups are available
  • activeType - 1 = first install, 2 = first network connection
GET /packages/:packageCode

Get full details for a specific package (same fields as list response).

Order Endpoints

POST /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."
  }
}
Important: The order is processed asynchronously. You'll receive the eSIM details via webhook once provisioning is complete.
GET /orders

List your orders with pagination.

Query Parameters

  • status - Filter by status: pending, processing, completed, failed
  • page - Page number
  • limit - Items per page
GET /orders/:orderId

Get details for a specific order including eSIM details if completed.

eSIM Endpoints

GET /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"
  }
}
GET /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 installation
  • IN_USE - eSIM is active and in use
  • ENABLED - eSIM is enabled and ready
  • SUSPENDED - eSIM has been suspended
  • USED_UP - All data has been consumed
  • REVOKED - eSIM has been revoked
GET /esims/:iccid/topup-options

Get available top-up packages for an eSIM.

POST /esims/:iccid/topup

Add data to an existing eSIM.

Request Body

{
  "packageCode": "JP_TOPUP_1GB",
  "externalOrderId": "YOUR-REF-456"  // Optional
}
POST /esims/:iccid/cancel

Cancel an unused eSIM and receive a refund. Only works if the eSIM has not been installed yet.

Requirements

  • esimStatus must be GOT_RESOURCE
  • smdpStatus must be RELEASED

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

POST /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/..."
}
POST /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.

PUT /webhook

Update your webhook settings.

Request Body

{
  "webhookUrl": "https://your-server.com/webhook",
  "webhookEvents": ["esim.provisioned", "esim.topup.completed", "order.failed"]
}
POST /webhook/test

Send a test webhook to verify your endpoint.

Webhook Events

  • esim.provisioned - eSIM is ready with QR code
  • esim.topup.completed - Top-up was successful
  • order.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

CodeDescription
200Success
201Created (for new orders)
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
402Payment Required - Insufficient balance
403Forbidden - Account suspended or IP not whitelisted
404Not Found - Resource doesn't exist
429Too Many Requests - Rate limit exceeded
500Internal 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 limit
  • X-RateLimit-Remaining - Remaining requests
  • X-RateLimit-Reset - Reset timestamp

Support

For API support or to become a reseller partner, contact us at [email protected]

Help