VentasxMayor has a REST API so you can connect your own system and manage products, categories, price lists, customers and orders from outside the panel. This is what you use to load products from another application, sync with in-house software, or automate tasks you do by hand today.
Step by step
- In the side menu, go to Settings → ERP.
- Pick API Token from the available integrations.
- Generate the token from that same card. Save it the moment you see it: it is your business's credential.
- From your system, send every HTTP request with the header
Authorization: Bearer <your-token>. - Point your calls at
/api/v1/on your store's domain.
That same card links to the full technical documentation, with the detail of every field.
What you can do
The API covers five resources. Products are addressed by their code; everything else by its id.
| Resource | You can |
|---|---|
/api/v1/products | list, create, read, update and delete |
/api/v1/products/{code}/images | add and delete images |
/api/v1/products/{code}/prices | read and write per-list prices |
/api/v1/categories | list, create, read, update and delete |
/api/v1/price-lists | list, create, read, update and delete |
/api/v1/customers | list, create, read and update |
/api/v1/orders | list, read and update |
Two design limits worth knowing before you start:
- Orders cannot be created through the API. They are read and updated. An order is born in your store's cart or in the panel, because that is where prices, lists and discounts get resolved.
- Customers cannot be deleted through the API. They are created, read and updated.
Limits and error codes
- 120 calls per minute per token and per method. Go over it and you get a
429. - 5 MB maximum body size. Anything larger returns a
413.
| Code | What happened |
|---|---|
400 | the body is not valid JSON |
401 | the token is missing or invalid |
403 | the API service is not active on your account |
404 | the route does not exist, or the business does not exist |
405 | the route exists but not with that method |
409 | the resource changed while you were editing it: read it again and retry |
413 | the body is over 5 MB |
422 | the data failed validation |
429 | you went over the calls-per-minute limit |
If you cannot find it
- You do not see the API Token option under Settings → ERP. Today the API is offered to businesses in Argentina only. In other countries the option is not shown.
- You have the token but every call returns
403. The API is a separately contracted service. If it was cancelled or never activated, the token exists but unlocks nothing. Write to us to turn it on. - You get a
401with a token that used to work. Check that the header travels asAuthorization: Bearer <token>, with no quotes and no extra spaces.
Tips
- Store the token as an application secret, the same way you would a password. Anyone who has it can read and write your business's catalog and customers.
- Always use the product code as the stable identifier. It is the same one you use in your inventory and in your wholesale orders, and it does not change when you edit the product.
- If you are going to load many products at once, respect the per-minute limit and space the calls out. A tidy batch is faster than retrying after a
429. - For a large initial catalog load, look at the spreadsheet import first: it solves the same problem without writing code.