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, and to create or update sales from external systems. All requests use standard HTTPS and return JSON responses.

What the API provides

The API gives you access to three core data domains: sales, inventory, and returns. Read endpoints expose list, detail, and summary views so you can fetch exactly the level of detail your integration needs. Write endpoints on sales let external systems (POS, e-commerce, marketplaces) push transactions into SmartPyme and update pending sales or quotations. The API is purpose-built for scenarios such as supplier sell-through reporting, external analytics dashboards, automated inventory reconciliation, and bidirectional sales sync.

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
POST /salesCreate and process a sale (or quotation)
GET /sales/{id}Get a specific sale
PUT /sales/{id}Update a pending sale or quotation
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. Write operations are limited to POST /sales and PUT /sales/{id} (create and update sales or quotations) and POST /packages/import (bulk-import package data from external systems).