1. Set up the connection
The API lets reporting tools, internal systems and integrations read your business data. Send requests from your server. The key identifies the business. Requests don't need a username, password or business ID.
- Sign in as the owner and open Settings → Integrations → VenVenta API.
- Enable the API for your business. Only the business owner can enable the API and manage keys.
- Create a connection with a recognizable name such as Sales reports. Grant only the permissions it needs.
- Choose an expiry date or select No expiry and accept the warning.
- Copy the key to your server's private configuration. It is displayed once, when issued.
Replacing a key invalidates the old one. Revoking a connection or disabling the API removes its access. A key without an expiry still depends on account status, permissions and API availability.
| Permission | Use | Scope |
|---|---|---|
catalog:read | Read catalog | Active products and services, base price and unit. |
stock:read | Read stock | Recorded stock for a product at the primary location. |
sales:read | Read sales | Sales list and commercial details. |
2. Make your first request
The API base URL is https://app.venventa.com/api/integrations/commercial/v1. Use this address in requests and integration tools.
Authentication uses the header X-Api-Key. Avoid using Authorization: Bearer or putting the key in the URL.
PowerShell · Windows
$env:VENVENTA_API_BASE_URL = "https://app.venventa.com/api/integrations/commercial/v1"
$env:VENVENTA_API_KEY = "TU_CLAVE"
Invoke-RestMethod -Uri "$env:VENVENTA_API_BASE_URL/sales?size=1" -Headers @{ "X-Api-Key" = $env:VENVENTA_API_KEY }
Terminal · curl
export VENVENTA_API_BASE_URL="https://app.venventa.com/api/integrations/commercial/v1"
export VENVENTA_API_KEY="TU_CLAVE"
curl --get "$VENVENTA_API_BASE_URL/sales" --data-urlencode "size=1" -H "X-Api-Key: $VENVENTA_API_KEY"
A connection with sales:read should return 200 OK and a paginated object. content: [] means no sales matched your request. Authentication succeeded. Replace the sample UUIDs below with IDs from your business.
Try Postman or import the API contract
- Download the Postman collection from the header and import it.
- The collection includes the VenVenta URL. Set
apiKeyin your private environment and keep environments containing real keys private. - Run “Listar productos” (List products) or “Listar ventas registradas” (List recorded sales).
- Copy an ID from the response to
productIdorsaleIdto request stock or sale details.
You can also import the OpenAPI file into compatible tools. It includes the public VenVenta URL.
3. Get products
GET /products · Permission catalog:read
Returns active products and services that haven't been deleted. Your catalog can be private. Ordered by internal code ascending, then by ID.
| Field | Type | Description |
|---|---|---|
search | string | Case-insensitive partial match on name or internal code. |
page | integer | Zero-based page index. |
size | integer | Items per page. |
curl --get "$VENVENTA_API_BASE_URL/products" --data-urlencode "search=resma" --data-urlencode "page=0" --data-urlencode "size=50" -H "X-Api-Key: $VENVENTA_API_KEY"{
"content": [
{
"id": "11111111-1111-4111-8111-111111111111",
"internalCode": "RESMA-A4",
"barcode": null,
"description": "Resma A4",
"type": "PRODUCT",
"unit": "Unidad",
"quantityDecimalPlaces": 0,
"price": 7800.0,
"currency": "ARS",
"pricesIncludeTaxes": true
}
],
"page": 0,
"size": 50,
"totalElements": 1,
"totalPages": 1
}Products with sizes and colors
Each variant is a product with its own id, price and code. It also includes variant, with groupId (style), name (style name), size (size) and color. Size or color can be null when unused. Simple products omit the object. Look up stock by variant ID. The style has no separate stock record.
Product fields
| Field | Type | Description |
|---|---|---|
id | string | Stable product or service ID. |
internalCode | string | Internal catalog code. |
barcode | string · nullable | Barcode, if recorded. |
description | string | Product name or description. |
type | string | Item type. Values: PRODUCT, SERVICE. |
unit | string · nullable | Unit of measure name. |
quantityDecimalPlaces | integer · nullable | Configured quantity precision for the unit. |
price | number | Base catalog price. Interpret it with pricesIncludeTaxes. |
currency | string | Business currency, such as ARS. |
pricesIncludeTaxes | boolean | Whether the configured price includes tax. |
Prices come from the base price list. Special price lists, purchase costs, suppliers, margins and internal notes are excluded. Stock is a separate resource with its own permission.
4. Get stock
GET /products/{id}/stock · Permission stock:read
Replace {id} with an active product ID for your business. Inactive or deleted items and items from other businesses are unavailable.
curl "$VENVENTA_API_BASE_URL/products/11111111-1111-4111-8111-111111111111/stock" -H "X-Api-Key: $VENVENTA_API_KEY"{
"productId": "11111111-1111-4111-8111-111111111111",
"tracked": true,
"onHand": 28,
"queriedAt": "2026-11-04T18:00:00Z"
}| Field | Type | Description |
|---|---|---|
productId | string | Requested product. |
tracked | boolean | Whether the business tracks stock for this product. |
onHand | number · nullable | Recorded stock at the primary location. Null when stock is untracked. |
queriedAt | string | Query timestamp in ISO 8601. |
tracked: false and onHand: null mean stock is untracked. tracked: true and onHand: 0 means recorded stock is zero. The request leaves stock unreserved and availability can change.5. List sales
GET /sales · Permission sales:read
Without a status filter, results include recorded and canceled sales. Drafts and deleted sales are excluded. Omit dates to query all dates. Ordered by business date descending, then by ID.
| Field | Type | Description |
|---|---|---|
dateFrom | string | Starting business date, inclusive. |
dateTo | string | Ending business date, inclusive. |
customerId | string | Customer ID. |
status | string | Includes recorded and canceled sales by default. Drafts are excluded. Values: REGISTERED, CANCELLED. |
collectionStatus | string | Current payment status. Values: PENDING, PARTIAL, PAID. |
page | integer | Zero-based page index. |
size | integer | Items per page. |
curl --get "$VENVENTA_API_BASE_URL/sales" --data-urlencode "dateFrom=2026-11-01" --data-urlencode "dateTo=2026-11-30" --data-urlencode "status=REGISTERED" --data-urlencode "collectionStatus=PENDING" --data-urlencode "page=0" --data-urlencode "size=50" -H "X-Api-Key: $VENVENTA_API_KEY"{
"content": [
{
"id": "22222222-2222-4222-8222-222222222222",
"internalNumber": "V-000001",
"customerId": null,
"customerDisplayName": "Consumidor final",
"date": "2026-11-04",
"dueDate": null,
"status": "REGISTERED",
"currency": "ARS",
"subtotal": 15600,
"discountTotal": 0,
"taxTotal": 0,
"total": 15600,
"collectionStatus": "PENDING",
"collectedTotal": 0,
"balance": 15600,
"pricesIncludeTaxes": true,
"items": []
}
],
"page": 0,
"size": 50,
"totalElements": 1,
"totalPages": 1
}Reporting notes
dateFromanddateTofilter by the business date of the sale. Both endpoints are included. Creation and payment dates are independent.- To analyze recorded sales, use
status=REGISTERED. Exclude canceled sales from revenue. collectedTotal,balanceandcollectionStatusare current values for each sale. They can include payments outside the requested period.- Keep the currency of each record and use decimal arithmetic. Use amounts and taxes calculated by VenVenta and avoid adding tax again when it is already included.
- The list returns
items: []. Request sale details when you need line items.
6. Get sale details
GET /sales/{id} · Permission sales:read
Use an ID from the sales list. Sales belonging to another business, missing sales, deleted sales and drafts return 404.
curl "$VENVENTA_API_BASE_URL/sales/22222222-2222-4222-8222-222222222222" -H "X-Api-Key: $VENVENTA_API_KEY"{
"id": "22222222-2222-4222-8222-222222222222",
"internalNumber": "V-000001",
"customerId": null,
"customerDisplayName": "Consumidor final",
"date": "2026-11-04",
"dueDate": null,
"status": "REGISTERED",
"currency": "ARS",
"subtotal": 15600,
"discountTotal": 0,
"taxTotal": 0,
"total": 15600,
"collectionStatus": "PENDING",
"collectedTotal": 0,
"balance": 15600,
"pricesIncludeTaxes": true,
"items": [
{
"id": "33333333-3333-4333-8333-333333333333",
"productServiceId": "11111111-1111-4111-8111-111111111111",
"unitOfMeasureId": null,
"unitOfMeasureName": null,
"description": "Resma A4",
"quantity": 2,
"unitPrice": 7800,
"discountRate": 0,
"discountAmount": 0,
"taxRateId": null,
"taxLabelSnapshot": null,
"taxRateSnapshot": null,
"lineSubtotal": 15600,
"lineTax": 0,
"lineTotal": 15600,
"sortOrder": 1
}
]
}Sale fields
| Field | Type | Description |
|---|---|---|
id | string | Stable sale ID. |
internalNumber | string | Internal sale number. Fiscal invoices have their own number. |
customerId | string · nullable | Linked customer, when applicable. |
customerDisplayName | string · nullable | Customer display name stored on the sale. |
date | string | Business date of the sale. |
dueDate | string · nullable | Commercial due date, if any. |
status | string | Sale status. Values: REGISTERED, CANCELLED. |
currency | string | Currency for this sale. |
subtotal | number | Sale subtotal calculated by VenVenta. |
discountTotal | number | Total discounts. |
taxTotal | number | Total taxes. |
total | number | Commercial sale total. |
collectionStatus | string | Payment status. Values: PENDING, PARTIAL, PAID. |
collectedTotal | number | Current cumulative amount received. |
balance | number | Current outstanding balance. |
pricesIncludeTaxes | boolean | How to interpret the sale's unit prices. |
items | array | Empty in the list. The detail response includes line items. |
Line item fields
| Field | Type | Description |
|---|---|---|
id | string | Sale line item ID. |
productServiceId | string · nullable | Linked product, if any. |
unitOfMeasureId | string · nullable | Unit of the linked product, if any. |
unitOfMeasureName | string · nullable | Name of that unit. |
description | string | Description stored on the sale. |
quantity | number | Quantity sold. |
unitPrice | number | Unit price stored on the sale. |
discountRate | number | Line discount percentage. |
discountAmount | number | Line discount amount. |
taxRateId | string · nullable | Linked tax, if any. |
taxLabelSnapshot | string · nullable | Tax name stored on the sale. |
taxRateSnapshot | number · nullable | Tax rate stored on the sale. |
lineSubtotal | number | Line subtotal calculated by VenVenta. |
lineTax | number | Tax amount calculated for the line. |
lineTotal | number | Line total calculated by VenVenta. |
sortOrder | integer · nullable | Line item position. |
The response excludes internal notes, the full customer identity snapshot, costs, margins, PDFs and tax provider details. Use the fiscal invoice number for fiscal purposes.
7. Read all pages
Product and sales listings use the same structure. page starts at 0 and has a maximum of 100000. size accepts 1 through 100, with a default of 50. Keep filters unchanged across pages and increment page until you reach totalPages.
| Field | Meaning |
|---|---|
content | Items on this page. |
page | Current page index. |
size | Requested page size. Fewer items may be returned. |
totalElements | Total items matching the filters. |
totalPages | Number of pages, or zero if no results match. |
Complete example for Node.js 22
Set the same environment variables as in the first example and run this on your server. It requests recorded sales and waits after a rate limit or temporary outage, with at most four attempts per page.
const base = process.env.VENVENTA_API_BASE_URL;
const apiKey = process.env.VENVENTA_API_KEY;
if (!base || !apiKey) throw new Error("Set the VenVenta base URL and API key.");
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
async function readPage(page) {
const url = new URL(`${base.replace(/\/$/, "")}/sales`);
url.search = new URLSearchParams({ status: "REGISTERED", page: String(page), size: "50" });
for (let attempt = 0; attempt < 4; attempt++) {
const response = await fetch(url, {
headers: { "X-Api-Key": apiKey, Accept: "application/json" },
signal: AbortSignal.timeout(15000)
});
if ((response.status === 429 || response.status === 503) && attempt < 3) {
const seconds = Math.max(1, Number(response.headers.get("Retry-After")) || 2 ** attempt);
await sleep(seconds * 1000);
continue;
}
const body = await response.json();
if (!response.ok) {
throw new Error(`VenVenta ${response.status}: ${body.code}; referencia ${body.correlationId ?? "sin referencia"}`);
}
return body;
}
}
try {
const seen = new Set();
for (let page = 0; ; page++) {
const result = await readPage(page);
for (const sale of result.content) {
if (seen.has(sale.id)) continue;
seen.add(sale.id);
console.log(sale.id, sale.internalNumber, sale.currency, sale.total);
}
if (page + 1 >= result.totalPages) break;
}
} catch (error) {
console.error(error.message);
process.exitCode = 1;
}A network error or timeout ends the example so the calling process can handle it. Avoid repeated retries for invalid credentials or insufficient permissions.
updatedAt or change events.8. Handle errors and rate limits
The limit is 60 requests per minute per connection, shared by its keys. Key rotation leaves the quota in place. On 429, the Retry-After header tells you how many seconds to wait. Repeated attempts with invalid credentials are also limited.
Send Accept-Language: en for error messages in English. Spanish is the default.
{
"code": "COMMERCIAL_API_SCOPE_REQUIRED",
"message": "The key does not have this permission.",
"correlationId": "example-correlation"
}Use code to decide how to proceed and keep correlationId for support. Some errors also include status, timestamp, path or fieldErrors. Those fields are optional.
| HTTP | Typical code | What to do |
|---|---|---|
400 | COMMERCIAL_API_INVALID_FILTER | Check ISO dates, UUIDs, valid statuses, date range and pagination. DRAFT is unsupported as a filter. |
401 | COMMERCIAL_API_KEY_INVALID | Check X-Api-Key and whether the key expired, was replaced or was revoked. |
403 | COMMERCIAL_API_SCOPE_REQUIRED | The key lacks permission for the resource. |
403 | COMMERCIAL_API_NOT_ALLOWED / COMMERCIAL_API_ACCOUNT_UNAVAILABLE | Ask the owner to check whether the API is enabled and the account has access. |
404 | COMMERCIAL_API_RESOURCE_NOT_FOUND | Check the path and ID. Unavailable resources and resources owned by another business are hidden. |
405 | COMMERCIAL_API_READ_ONLY | This version supports GET requests for read access. |
429 | COMMERCIAL_API_RATE_LIMIT / COMMERCIAL_API_AUTH_RATE_LIMIT | Wait for Retry-After and reduce the frequency of requests or failed attempts. |
503 | COMMERCIAL_API_DISABLED / COMMERCIAL_API_STORAGE_UNAVAILABLE | The instance is disabled or temporarily unavailable. For a temporary failure, wait before retrying. Contact VenVenta support if it continues. |
500 | INTERNAL_ERROR | Keep correlationId and contact VenVenta support. |
9. Scope and maintenance
- Store the key on the server or in a secrets manager. Keep it out of public code, repositories, URLs, screenshots and application logs.
- Send requests from your backend. The API does not support direct browser access through CORS.
- When replacing a key, update the tool configuration because the previous key stops working. Revoke connections that no longer need access.
- The sample IDs are fictional. Replace them with IDs returned for your business.
- A key expires at the end of the selected date in the business time zone. Keys without an expiry date do not expire automatically.
This version includes the four documented GET resources. Creating orders, issuing or updating sales, recording payments, adjusting stock, invoicing, PDF downloads, webhooks and incremental sync are outside the scope of these read permissions.
When reporting an issue, include the operation, path without the key, HTTP status, error code and correlationId. Keep credentials and customers' personal data out of the report.