SHOPHIVE DATA API · VERSION 1

Build data sales into your app.

Retrieve API buying prices, pay from your ShopHive wallet and track delivery through one API.

Create a seller account

Get started

  1. Create a seller account and wait for approval.
  2. Enable your data-agent store under Seller dashboard → Data agent.
  3. Fund your ShopHive wallet under Developer API or Payments & payouts. Paystack verifies the deposit before crediting your wallet.
  4. Open Seller dashboard → Developer API and create a key. Copy it immediately; it is shown once.
  5. Call this API from your server using Authorization: Bearer YOUR_API_KEY.

Base URL: https://shophivegh.com/api/v1. Keys expire after 90 days; up to five active keys per seller. Each key allows 60 requests per minute. Revoke a key to stop its access.

Keep keys server-side. A key can spend its owner’s wallet balance. Never expose it in frontend JavaScript, mobile apps, public repositories or URLs. This is a live API: successful order requests deduct real wallet funds. Version 1 has no sandbox.

Endpoints

MethodPathPurpose
GET/data/packages?network=MTNAvailable packages and API buying prices. Networks: MTN, Telecel, AT.
GET/walletYour wallet balance and status.
POST/data/ordersPurchase a package from your wallet.
GET/data/orders?reference=YOUR_REFERENCERetrieve and refresh your API order.

Amounts are integer Ghana pesewas: 500 means GH₵5.00. Currency is GHS. API prices use ShopHive’s separate API buying-price list, before your own markup. No additional API checkout fee applies.

Special bundles & MashUp

Request /data/packages?network=MTN&category=mtn_special, /data/packages?network=Telecel&category=telecel_special or /data/packages?network=MTN&category=mashup. Each package includes its exact label, packageKey, capacityGb and API pricePesewas. An empty list means no offers are currently available.

Submit to the existing order endpoint with the matching network, capacityGb, phone and expectedPricePesewas, plus specialPackageKey copied exactly from the package response. Do not identify these offers by GB alone: packages can include minutes. Keep the same Idempotency-Key when retrying the same order. Tracking includes the offer category and package label.

1. Read package prices

curl "https://shophivegh.com/api/v1/data/packages?network=MTN" -H "Authorization: Bearer YOUR_API_KEY"
{
  "network": "MTN",
  "currency": "GHS",
  "packages": [
    {
      "capacityGb": 2,
      "pricePesewas": 500
    }
  ]
}

The example price is illustrative. Use the actual API response. Availability and prices may change; removed agent offers cannot be purchased.

2. Create an order

Send POST /data/orders with these headers:

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Idempotency-Key: my-order-00001
{
  "network": "MTN",
  "capacityGb": 2,
  "phone": "0240000000",
  "expectedPricePesewas": 500
}

All four body fields are required. Use the exact current catalogue price. Ghanaian local and +233 phone formats are accepted; the number must match the network. JSON bodies are limited to 4,096 characters.

Use one unique Idempotency-Key per intended purchase. References must contain 8–80 letters, digits, dots, hyphens, colons or underscores. On a timeout or uncertain response, resend the identical body with the same key. Replays return the existing order without another debit. Reusing a reference with different details returns 409. References are shared across all API keys belonging to the same seller.

{
  "replayed": false,
  "order": {
    "id": "order-uuid",
    "reference": "my-order-00001",
    "network": "MTN",
    "capacityGb": 2,
    "phone": "0240000000",
    "currency": "GHS",
    "amountPesewas": 500,
    "paymentStatus": "paid",
    "deliveryStatus": "processing",
    "createdAt": "...",
    "updatedAt": "..."
  }
}

New orders return 201; replays return 200. Wallet debits and order records are atomic. Insufficient funds or a price mismatch creates no order and deducts no funds. Payment confirmation does not mean delivery is complete.

3. Track delivery

curl "https://shophivegh.com/api/v1/data/orders?reference=my-order-00001" -H "Authorization: Bearer YOUR_API_KEY"

Poll every 30–60 seconds with backoff. Delivery states include queued, created, processing, waiting, completed, failed, refunded and cancelled. Stop on a terminal state. Do not create a second order to chase delayed delivery. A failed order may be refunded to your ShopHive wallet; inspect paymentStatus and balance before deciding whether to purchase again.

Version 1 uses polling. Outbound developer webhooks are not included. You can retrieve only orders your account created through this API.

Errors and retries

{
  "error": {
    "code": "PRICE_CHANGED",
    "message": "Refresh package prices and submit the current expected price."
  }
}

For support, provide your order reference. Never send API keys, MoMo PINs or one-time codes.

Contact ShopHive support
Join ShopHive WhatsApp Channel