VenVentaDocumentation Back to IntegrationsEspañol
Commercial API · V1

Connect your tools to VenVenta

Set up a connection and build an integration for catalog, stock and sales, with example requests, responses and errors.

Download OpenAPIPostman collection

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.

  1. Sign in as the owner and open Settings → Integrations → VenVenta API.
  2. Enable the API for your business. Only the business owner can enable the API and manage keys.
  3. Create a connection with a recognizable name such as Sales reports. Grant only the permissions it needs.
  4. Choose an expiry date or select No expiry and accept the warning.
  5. 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.

Sales permission grants access to all sales for the business, including those entered manually or through another channel, with line items, payments and balances. Its scope includes sales from other connections.
PermissionUseScope
catalog:readRead catalogActive products and services, base price and unit.
stock:readRead stockRecorded stock for a product at the primary location.
sales:readRead salesSales 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
  1. Download the Postman collection from the header and import it.
  2. The collection includes the VenVenta URL. Set apiKey in your private environment and keep environments containing real keys private.
  3. Run “Listar productos” (List products) or “Listar ventas registradas” (List recorded sales).
  4. Copy an ID from the response to productId or saleId to 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.

FieldTypeDescription
searchstringCase-insensitive partial match on name or internal code.
pageintegerZero-based page index.
sizeintegerItems 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

FieldTypeDescription
idstringStable product or service ID.
internalCodestringInternal catalog code.
barcodestring · nullableBarcode, if recorded.
descriptionstringProduct name or description.
typestringItem type. Values: PRODUCT, SERVICE.
unitstring · nullableUnit of measure name.
quantityDecimalPlacesinteger · nullableConfigured quantity precision for the unit.
pricenumberBase catalog price. Interpret it with pricesIncludeTaxes.
currencystringBusiness currency, such as ARS.
pricesIncludeTaxesbooleanWhether 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"
}
FieldTypeDescription
productIdstringRequested product.
trackedbooleanWhether the business tracks stock for this product.
onHandnumber · nullableRecorded stock at the primary location. Null when stock is untracked.
queriedAtstringQuery timestamp in ISO 8601.
Null and zero have different meanings. 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.

FieldTypeDescription
dateFromstringStarting business date, inclusive.
dateTostringEnding business date, inclusive.
customerIdstringCustomer ID.
statusstringIncludes recorded and canceled sales by default. Drafts are excluded. Values: REGISTERED, CANCELLED.
collectionStatusstringCurrent payment status. Values: PENDING, PARTIAL, PAID.
pageintegerZero-based page index.
sizeintegerItems 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

  • dateFrom and dateTo filter 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, balance and collectionStatus are 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

FieldTypeDescription
idstringStable sale ID.
internalNumberstringInternal sale number. Fiscal invoices have their own number.
customerIdstring · nullableLinked customer, when applicable.
customerDisplayNamestring · nullableCustomer display name stored on the sale.
datestringBusiness date of the sale.
dueDatestring · nullableCommercial due date, if any.
statusstringSale status. Values: REGISTERED, CANCELLED.
currencystringCurrency for this sale.
subtotalnumberSale subtotal calculated by VenVenta.
discountTotalnumberTotal discounts.
taxTotalnumberTotal taxes.
totalnumberCommercial sale total.
collectionStatusstringPayment status. Values: PENDING, PARTIAL, PAID.
collectedTotalnumberCurrent cumulative amount received.
balancenumberCurrent outstanding balance.
pricesIncludeTaxesbooleanHow to interpret the sale's unit prices.
itemsarrayEmpty in the list. The detail response includes line items.

Line item fields

FieldTypeDescription
idstringSale line item ID.
productServiceIdstring · nullableLinked product, if any.
unitOfMeasureIdstring · nullableUnit of the linked product, if any.
unitOfMeasureNamestring · nullableName of that unit.
descriptionstringDescription stored on the sale.
quantitynumberQuantity sold.
unitPricenumberUnit price stored on the sale.
discountRatenumberLine discount percentage.
discountAmountnumberLine discount amount.
taxRateIdstring · nullableLinked tax, if any.
taxLabelSnapshotstring · nullableTax name stored on the sale.
taxRateSnapshotnumber · nullableTax rate stored on the sale.
lineSubtotalnumberLine subtotal calculated by VenVenta.
lineTaxnumberTax amount calculated for the line.
lineTotalnumberLine total calculated by VenVenta.
sortOrderinteger · nullableLine 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.

FieldMeaning
contentItems on this page.
pageCurrent page index.
sizeRequested page size. Fewer items may be returned.
totalElementsTotal items matching the filters.
totalPagesNumber 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.

Results can change during pagination. Sales can move between pages when they are added or updated. Deduplicate by ID and reconcile date ranges for consistent reports. Cancellations and payments may update sales from earlier days. This version has no incremental filter by 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.

HTTPTypical codeWhat to do
400COMMERCIAL_API_INVALID_FILTERCheck ISO dates, UUIDs, valid statuses, date range and pagination. DRAFT is unsupported as a filter.
401COMMERCIAL_API_KEY_INVALIDCheck X-Api-Key and whether the key expired, was replaced or was revoked.
403COMMERCIAL_API_SCOPE_REQUIREDThe key lacks permission for the resource.
403COMMERCIAL_API_NOT_ALLOWED / COMMERCIAL_API_ACCOUNT_UNAVAILABLEAsk the owner to check whether the API is enabled and the account has access.
404COMMERCIAL_API_RESOURCE_NOT_FOUNDCheck the path and ID. Unavailable resources and resources owned by another business are hidden.
405COMMERCIAL_API_READ_ONLYThis version supports GET requests for read access.
429COMMERCIAL_API_RATE_LIMIT / COMMERCIAL_API_AUTH_RATE_LIMITWait for Retry-After and reduce the frequency of requests or failed attempts.
503COMMERCIAL_API_DISABLED / COMMERCIAL_API_STORAGE_UNAVAILABLEThe instance is disabled or temporarily unavailable. For a temporary failure, wait before retrying. Contact VenVenta support if it continues.
500INTERNAL_ERRORKeep 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.