ShopVista API Documentation

Integrate ShopVista's powerful e-commerce infrastructure into your application. Our RESTful API provides secure, scalable access to products, orders, customers, and analytics with comprehensive webhook support.

https://api.shopvista.com/v1
â„šī¸
All API requests require HTTPS and must include a valid authentication token. Rate limits apply to prevent abuse.

Authentication

ShopVista uses API keys for authentication. Include your secret key in the request header.

HTTP Header
Authorization: Bearer sv_live_sk_8x9y2z3a4b5c6d7e8f9g0h1i2j3k4l5m
âš ī¸
Never expose your secret key in client-side code or public repositories. Use publishable keys for frontend integrations.

Key Types

TypePrefixUsage
Live Secretsv_live_sk_Server-side production requests
Test Secretsv_test_sk_Server-side sandbox requests
Publishablesv_pub_sk_Client-side embedding & checkout

Rate Limiting

Requests are limited to 1,000 requests per minute per API key. Rate limit information is included in response headers:

Response Headers
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 942
X-RateLimit-Reset: 1718902345
💡
Implement exponential backoff for `429 Too Many Requests` responses. Contact support for enterprise rate limit increases.

Products

Manage product catalog, inventory, pricing, and metadata.

GET /products

Retrieve a paginated list of products with optional filtering.

Query Parameters

ParameterTypeDescription
pageoptionalintegerPage number (default: 1)
limitoptionalintegerItems per page (max: 100, default: 20)
categoryoptionalstringFilter by category slug
min_priceoptionalnumberMinimum price filter

Response Example

JSON (200 OK)
{
  "data": [
    {
      "id": "prod_8x7y6z5a4b",
      "name": "Wireless Pro Headphones",
      "sku": "WPH-001",
      "price": 89.99,
      "currency": "USD",
      "inventory": 142,
      "status": "active",
      "created_at": "2025-01-15T08:30:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 1584
  }
}
POST /products

Create a new product in the catalog.

Request Body

FieldTypeDescription
namerequiredstringProduct title (max 120 chars)
skurequiredstringUnique stock keeping unit
pricerequirednumberBase price in minor units (cents)
inventoryoptionalintegerInitial stock count (default: 0)
cURL
curl -X POST https://api.shopvista.com/v1/products \
  -H "Authorization: Bearer sv_live_sk_..." \
  -H "Content-Type: application/json" \
  -d '{"name":"Smart Watch","sku":"SW-100","price":29900}'

Orders

Process transactions, track fulfillment, and manage refunds.

POST /orders

Create a new order and initiate payment processing.

Request Body

FieldTypeDescription
customer_idrequiredstringExisting customer ID
itemsrequiredarrayArray of {product_id, quantity}
shipping_addressrequiredobjectAddress object with line1, city, state, zip, country
payment_methodoptionalstring"card", "paypal", or "crypto"
JSON Response (201 Created)
{
  "id": "ord_9z8y7x6w5v",
  "status": "pending_payment",
  "total": 89.99,
  "currency": "USD",
  "created_at": "2025-03-10T14:22:00Z",
  "payment_url": "https://checkout.shopvista.com/pay/ord_9z8y7x6w5v"
}

Customers

Manage buyer profiles, addresses, and purchase history.

GET /customers/:id

Retrieve detailed customer information.

Response (200 OK)
{
  "id": "cus_1a2b3c4d5e",
  "email": "alex.developer@example.com",
  "name": "Alex Chen",
  "phone": "+1-555-0198",
  "total_orders": 14,
  "lifetime_value": 1240.50,
  "metadata": {
    "loyalty_tier": "gold",
    "preferred_payment": "credit_card"
  }
}

Webhooks

Subscribe to real-time events for order updates, inventory changes, and payment confirmations.

✅
Webhook payloads are signed using HMAC-SHA256. Verify signatures using your webhook secret before processing.

Available Events

EventDescription
order.createdNew order placed
order.paidPayment successfully captured
order.shippedOrder dispatched with tracking
product.low_stockInventory drops below threshold
refund.processedRefund issued to customer

Webhook Payload Structure

JSON
{
  "id": "evt_8x7y6z5a4b3c",
  "type": "order.paid",
  "created": 1710000000,
  "data": {
    "object": {
      "id": "ord_9z8y7x6w5v",
      "status": "paid",
      "amount": 8999
    }
  }
}

Error Handling

ShopVista uses standard HTTP status codes and returns structured error objects.

200 / 201
Success / Created
400
Invalid request parameters
401
Missing or invalid auth token
404
Resource not found
429
Rate limit exceeded
500
Internal server error

Error Response Format

JSON
{
  "error": {
    "code": "invalid_request_error",
    "message": "Missing required field: customer_id",
    "param": "customer_id",
    "doc_url": "https://docs.shopvista.com/errors#invalid_request"
  }
}

SDKs & Libraries

Official client libraries for rapid integration:

LanguagePackageRepository
JavaScript/Nodenpm install shopvista-jsGitHub
Pythonpip install shopvistaGitHub
PHPcomposer require shopvista/SDKGitHub
Gogo get github.com/shopvista/go-sdkGitHub

Changelog

📅
We maintain strict backwards compatibility. Breaking changes require a major version bump.
VersionDateChanges
v1.0.02025-01-01Initial public release
v1.0.12025-02-15Fixed pagination edge cases, added bulk update endpoint
v1.0.22025-03-01Webhook signature verification improvements, new `order.shipped` event