Back to API docs

apicreateproposal JSON request body proposal + entries contact/product objects supported

POST /api/createproposal creates a proposal, its proposal entries, optional contact, and optional embedded products.

Complete field reference — full maximal JSON schema with every accepted attribute, enum values, defaults, and explanations.

Scope

This endpoint creates the same core records used by the editor: one row in proposals and one or more rows in entries. After entries are created, the proposal totals are recalculated.

Top-level JSON fields

key
string, required

Your API key.

proposal
object, optional

Proposal fields can be sent inside proposal, or directly at top level. If both are used, proposal is used for proposal fields.

contact
int|string/object, optional

Contact linked to the proposal. Supported formats:

entries
array, required unless groups is provided

Flat list of proposal lines.

groups
array, optional

Grouped proposal lines. Each group creates a group_sep entry and then creates the group's entries.

settings
object, optional

Proposal-specific settings saved in the settings table using the proposal id. Examples: advanceper, showgroup, selectoff, textcolor. showgroup is returned by getproposals. selectoff: 1 hides parent SELECT! buttons. There is no showvat/showtax key; 0% VAT hides the VAT row automatically. Do not send tunc — that is a company setting, not a proposal setting.

Proposal Fields

You can send any standard proposal field such as:

Entry Fields

Each entry can contain direct entries table fields:

Select controls (selectable, selectoff, tunc)

These three names are easy to mix up:

Product Reference Formats

Entries can link to existing products or create products inline.

Existing product by id

{
  "product_ref": 15,
  "ammount": 2
}

Existing product by SKU

{
  "product_ref": "SKU-001",
  "ammount": 2
}

Create product inline

The object uses the same product payload as /api/createproduct, without the API key.

{
  "product_ref": {
    "name": "Created inline product",
    "sku": "INLINE-001",
    "category": "API products",
    "price": {
      "Supplier A": {
        "1": [50, 75, 0]
      }
    }
  },
  "ammount": 1
}

Feature Values on Entries

You can save entry-level feature selections using feature ids:

{
  "product_ref": "SKU-001",
  "feature_values": {
    "12": [44, 45],
    "15": "custom text"
  },
  "feature_custom_text": {
    "15": "custom text"
  },
  "feature_custom_number": {
    "20": "5"
  }
}

Minimal Example

{
  "key": "YOUR_API_KEY",
  "name": "API proposal",
  "author": 3,
  "owner": 3,
  "contact": {
    "name": "Example Company UAB",
    "code": "123456789",
    "email": "info@example.com"
  },
  "entries": [
    {
      "product_ref": "SKU-001",
      "ammount": 2,
      "children": [
        {
          "product_ref": "INCLUDED-SKU-001",
          "ammount": 1,
          "selectable": 1,
          "accepted": 1
        }
      ]
    }
  ]
}

Grouped Full Example

{
  "key": "YOUR_API_KEY",
  "proposal": {
    "name": "Website project",
    "currency": "EUR",
    "discount": 5,
    "comment": "Created through API"
  },
  "contact": {
    "name": "Client Company",
    "code": "300000001",
    "phone": "+37060000000",
    "meta": {
      "city": "Vilnius",
      "website": "https://client.example"
    }
  },
  "settings": {
    "advanceper": 30,
    "showgroup": 1
  },
  "groups": [
    {
      "name": "Main work",
      "advance": 30,
      "entries": [
        {
          "product_ref": {
            "name": "Design work",
            "sku": "DESIGN-API-001",
            "category": "Services",
            "price": {
              "Supplier A": {
                "1": [0, 500, 0]
              }
            }
          },
          "ammount": 1,
          "comment": "Design stage"
        },
        {
          "product": "Project note",
          "attribute": "text_sep",
          "comment": "<p>This is an informational row.</p>"
        }
      ]
    },
    {
      "name": "Recurring",
      "entries": [
        {
          "product_ref": "HOSTING-001",
          "ammount": 12,
          "unit": "mėn",
          "periodical": 1
        }
      ]
    }
  ]
}

Success Response

{
  "status": "ok",
  "data": {
    "proposal": { "id": 123, "name": "Website project", "url": "abc123..." },
    "entries": [ /* created entries */ ],
    "url": "https://your-domain/offer/abc123..."
  }
}

Error Responses