Create a quotation

Create a quotation for a customer in the Sales app.

POST https://cotlet.dev/api/v1/odoo/contacts/{contact_id}/sales-orders

write

Creates a quotation and returns its ID and totals. It stays a quotation: it is not sent and not confirmed, so it reaches nobody and does not wait for your OK. Confirming and invoicing it happen in Odoo.

Parameters

Parameters: create_sales_order
NameTypeDescription
contact_id integer required integer Contact ID from list_contacts or create_contact.
lines array required array Order lines: description (string), quantity (number), unit_price (number).
reference string string Customer reference.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/odoo/contacts/1/sales-orders \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lines":"lines"}'
Python
result = client.call("odoo", "create_sales_order", {"contact_id":1,"lines":"lines"})
Node.js
const result = await cotlet.call('odoo', 'create_sales_order', {"contact_id":1,"lines":"lines"});
CLI
cotlet call odoo create_sales_order --data '{"contact_id":1,"lines":"lines"}'

Example response

JSON

{
  "order_id": 2231,
  "number": "S00094",
  "contact": "Harbor Print",
  "status": "quotation",
  "lines": [
    {
      "description": "Consulting, hours",
      "quantity": 10,
      "unit_price": 120,
      "subtotal": 1200
    }
  ],
  "amount_untaxed": 1200,
  "amount_total": 1200,
  "currency": "EUR"
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.