API Reference

REST API Reference

Interact with SaleviaCon programmatically. Our RESTful API gives you full access to orders, customers, catalogs, broadcasts, analytics, and messaging — all over HTTPS with JSON responses.

API Key Authentication

All API requests require an API key sent via the X-API-Key header. You can generate and manage API keys from yourdashboard settings.

Request example
X-API-Key: sk_live_abc123def456

Keep your API keys secure. Never share them in client-side code or public repositories. Rotate keys regularly from the dashboard.

Base URL

All endpoints are relative to the following base URL:

https://api.saleviacon.com/v1

All requests must use HTTPS. HTTP requests will be rejected.

Available Endpoints

The following endpoints are available in the current API version:

MethodEndpointDescription
GET/ordersList all orders
GET/orders/:idGet order details
POST/ordersCreate order
GET/customersList customers
GET/productsList catalog products
POST/broadcastsSend broadcast
GET/analyticsGet analytics
POST/messages/sendSend message

Quick Start Example

Fetch all orders using cURL:

Shell
curl https://api.saleviacon.com/v1/orders \
  -H "X-API-Key: sk_live_abc123def456"

Expected response (JSON):

Response
{
  "data": [
    {
      "id": "ord_2aK3bL8mN",
      "customer": "cus_5xR7tP2qW",
      "status": "completed",
      "total": 4500,
      "currency": "PKR",
      "items": [
        { "product": "prod_9yU1iK4jH", "qty": 2, "price": 2250 }
      ],
      "created_at": "2026-07-22T10:30:00Z"
    }
  ],
  "meta": { "total": 42, "page": 1, "per_page": 20 }
}

Rate Limits

API requests are rate-limited to 100 requests per minute per API key. Exceeding this limit returns a 429 Too Many Requests response.

Rate limit headers are included in every response:

Response headers
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1712345678

Error Responses

The API uses conventional HTTP status codes to indicate success or failure. Errors return a JSON body with a message field.

CodeStatusDescription
400Bad RequestInvalid request body or parameters.
401UnauthorizedMissing or invalid API key.
404Not FoundThe requested resource does not exist.
429Rate LimitedToo many requests. Slow down.
500Server ErrorSomething went wrong on our end.
Example error response
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or expired API key. Check the X-API-Key header."
  }
}
🔑

Get Your API Key

Ready to integrate? Generate your API key from the dashboard and start building.

Get Your API Key →