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
| Name | Type | Description |
|---|---|---|
| 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 -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"}' result = client.call("odoo", "create_sales_order", {"contact_id":1,"lines":"lines"}) const result = await cotlet.call('odoo', 'create_sales_order', {"contact_id":1,"lines":"lines"}); cotlet call odoo create_sales_order --data '{"contact_id":1,"lines":"lines"}' Example response
{
"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"
}