Hubby API (1.3.2)

Welcome to the Hubby API documentation. This API enables partners to seamlessly integrate eSIM booking and management capabilities into their applications.

Key Features:

  • Create and manage eSIM bookings for your customers
  • Access our global package catalog with country-specific offerings
  • Track booking statuses and package activations
  • Support for multiple package types (starter, data-limited, unlimited, time-limited)

Package Types

The API supports four types of packages:

  • Starter packages: Hybrid packages that are both data and time limited. They provide a small data allowance within a short time period (default: 2 days). Perfect for first-time users and trials.

  • Data-limited packages: Traditional packages with a specific data allowance that expires after a certain period (default: 365 days). This is the primary package type and the default for most use cases.

  • Unlimited packages: Packages that provide unrestricted data usage for a specified duration. Subject to fair use policy. Ideal for heavy data users and digital nomads.

  • Time-limited packages: Packages that provide a fixed data allowance for a specific duration with full-speed access. These packages expire when either the data limit or time limit is reached.

Note: Top-ups are always data-limited packages, regardless of the original package type.

Authentication: All API requests must include the following headers:

  • x-api-key: Your public API key
  • x-timestamp: Current Unix timestamp in milliseconds
  • x-signature: HMAC-SHA256 signature

The HMAC signature must be generated for each request using:

  1. Concatenate: timestamp + HTTP method + request path Example: "1678901234GET/api/bookings" Note: The request path MUST include the "/api" prefix in the signature calculation. For example, if calling "/bookings", use "/api/bookings" in the signature.
  2. Generate HMAC-SHA256 using your secret key
  3. Convert to hex string

Note: Swagger UI cannot be used to test the API directly as each request requires a unique HMAC signature. Please implement the authentication in your client application.

Example Node.js Implementation:

const cryptoJs = require('crypto-js');

// Configuration values that would normally come from environment
const secretKey = "YOUR_API_SECRET";
const publicKey = "YOUR_API_KEY";
const baseUrl = "YOUR_BASE_URL";

// Function to generate headers for API request
function generateApiHeaders(method, path) {
    //Timestamp is in milliseconds e.g. 1715558400000
    const timestamp = Math.floor(Date.now()).toString();

    // Ensure url is a string
    let path = String(url);

    // Remove baseUrl from the url if present
    path = processedUrl.replace(baseUrl, '');

    // Create query string if needed
    const queryString = new URL(url).search;
    if (queryString) {
        processedUrl += queryString;
    }

    // Validate public key
    if (!publicKey) {
        throw new Error("Public key is required");
    }

    // Create the payload
    // Sample payload: 1715558400000GET/api/bookings?bookingId=1234567890
    const payload = timestamp + method + path;

    // Generate the HMAC signature
    const signature = cryptoJs.HmacSHA256(payload, secretKey).toString(cryptoJs.enc.Hex);

    // Return headers object
    return {
        'x-timestamp': timestamp,
        'x-signature': signature,
        'x-api-key': publicKey,
        'Accept': 'application/json'
    };
}

Need Help?

  • Technical Support: support@hubbyesim.com
Download OpenAPI description
Languages
Servers
Mock server
https://docs.hubbyesim.com/_mock/apis/v1_3_2/openapi/
Production server - Use this for live applications
https://api.hubbyesim.com/api/
Staging server - Use this for testing and development
https://api-staging.hubby.dev/api/

Booking

Operations

Package

Operations

Country

Operations

PromoCode

Operations

Redeem a promo code

Request

Redeem a promo code for a booking or eSIM

Bodyapplication/jsonrequired
promo_codestringrequired

The promo code to redeem.

curl -i -X POST \
  https://docs.hubbyesim.com/_mock/apis/v1_3_2/openapi/api/promoCodes/redeem \
  -H 'Content-Type: application/json' \
  -d '{
    "promo_code": "string"
  }'

Responses

Successful promo code redemption

Bodyapplication/json
successboolean
Example: true
messagestring
Example: "Promo code redeemed successfully"
dataobject
Response
application/json
{ "success": true, "message": "Promo code redeemed successfully", "data": { "iccid": "1234567890", "qr": "https://example.com/qr-code" } }

Get promo code details

Request

Retrieve details of a specific promo code by ID.

Authorization:

  • Admins can access any promo code
  • Partners can only access promo codes belonging to their organization
Path
idstringrequired

The promo code ID

curl -i -X GET \
  'https://docs.hubbyesim.com/_mock/apis/v1_3_2/openapi/api/promo-codes/{id}'

Responses

Promo code details retrieved successfully

Bodyapplication/json
successboolean
Example: true
messagestring
Example: "Promo code fetched successfully!"
dataobject
Response
application/json
{ "success": true, "message": "Promo code fetched successfully!", "data": { "promo_code": "string", "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "claim_url": "http://example.com", "deep_link_url": "http://example.com", "package_id": "string", "package_size": "string", "destination": "string", "iso3": "string", "package_type": "string", "package_duration": 0 } }

Claim a promo code using UUID

Request

Public endpoint (no authentication required) to claim a promo code by providing an email address. The user receives the promo code via email immediately after claiming.

Path
uuidstring(uuid)required

The unique identifier from the claim URL

Bodyapplication/jsonrequired
emailstring(email)required

Email address to receive the promo code

Example: "user@example.com"
curl -i -X POST \
  'https://docs.hubbyesim.com/_mock/apis/v1_3_2/openapi/api/promo-codes/claim/{uuid}' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "user@example.com"
  }'

Responses

Promo code claimed successfully and email sent

Bodyapplication/json
successboolean
Example: true
messagestring
Example: "Promo code claimed and email sent successfully"
dataobject
Example: {}
Response
application/json
{ "success": true, "message": "Promo code claimed and email sent successfully", "data": {} }

eSIM

Operations