Create new Records in Products throuth api

Hello i would like to add new Records of Products into my Tryton over a API.
I have read the Articel in the Manual “User Application — trytond latest documentation” and had build successful interfaces.

Now i am trying to add an Api to the Products Module, so i can add new Records by an interface. But i cant find the Function i need to manipulate to achieve it.
When i look into the file i found some Functions but the don t make sense to me.
Did some tried something like this? How do modules write Information into the Database?

Thank you to all Answers

There is some code in the timesheet module that creates / updates timesheet lines using an API defined for use by User Applications: modules/timesheet: d5bd5090b474

You should be able to do something similar, but for products instead of timesheet lines.

User aplications are for token based autentication APIs.

It is also possible to use the plain JSON-RPC API with standar authentication (user/password+session). This way you can directly call the create method of the product model without requiring to develop any custom code on server side.

thank you all for your answers. I try the option with JSON-RPC and will post my results.

The only think i dont unterstand is how to create the payload for the JSON_RPC. The documentation is a bit empty.
Here is an example of my python code :

   url = ""

    payload = {
        "jsonrpc": "2.0",
        "method": "common.db.login",
        "params": { 'kiri': 'kiri', 'password':'password'}, "id":3}

    response =, json=payload)


i get 500 oder 401

Tryton is using version 1.0 from the JSON-RPC spec.
Take a look at Log in with external script fails You have there two examples:

  1. complete external script where you need to make your JSON-RPC request yourself
  2. use Proteus

Thank you. I could get it running now with Proteus. Thank you vor the Link.
Here is my solution:

from decimal import Decimal
from proteus import Model, config

Party = Model.get('')
Product = Model.get('product.product')
Uom= Model.get('product.uom')
Template = Model.get('product.template')
#PriceList = Model.get('product.price_list')

hektar= allUom[5]

template = Template(

product = Product(template=template)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.