Skip to main content
The SmartPyme External API is a REST API designed for B2B integrations — enabling suppliers, analytics platforms, and other third-party providers to programmatically access sales, inventory, and returns data from SmartPyme-powered businesses. All requests use standard HTTPS and return JSON responses.

What the API provides

The API gives you read-only access to three core data domains: sales, inventory, and returns. Each domain exposes list, detail, and summary endpoints so you can fetch exactly the level of detail your integration needs. The API is purpose-built for scenarios such as supplier sell-through reporting, external analytics dashboards, and automated inventory reconciliation.

Base URL

Every request goes to the following base URL:
https://api.smartpyme.site/api/external/v1/

Available endpoints

EndpointDescription
GET /salesList sales with filters
GET /sales/{id}Get a specific sale
GET /sales/summarySales summary statistics
GET /inventoryList products with stock
GET /inventory/{id}Get a specific product
GET /inventory/summaryInventory summary statistics
GET /returnsList returns
GET /returns/{id}Get a specific return
GET /returns/summaryReturns summary statistics
GET /system/rate-limitCheck your current rate limit status
POST /packages/importImport package data from an external system

Standard response envelope

Every successful response from the API wraps its payload in a consistent envelope. The data field holds the records you requested, pagination describes the current page of results, and meta provides context about the company and the filters that were applied.
{
  "success": true,
  "data": [...],
  "pagination": {
    "current_page": 1,
    "per_page": 100,
    "total": 1250,
    "total_pages": 13,
    "has_next": true,
    "has_prev": false,
    "from": 1,
    "to": 100
  },
  "meta": {
    "empresa": "Mi Empresa S.A.",
    "timestamp": "2025-01-15T10:30:00Z",
    "filters_applied": {}
  }
}

Error response format

When a request fails, the API returns a success: false envelope with a human-readable error message and the corresponding HTTP status code.
{
  "success": false,
  "error": "API key inválido o empresa inactiva",
  "code": 401
}

HTTP status codes

CodeMeaning
200Success
400Bad Request — invalid parameters
401Unauthorized — invalid or missing API Key
403Forbidden — company inactive
404Not Found
429Too Many Requests — rate limit exceeded
500Internal Server Error
Most endpoints are read-only. The exception is POST /packages/import, which allows bulk-importing package data from external systems.