Quote form
Read the fields of your quote form and the key of each field, so you can create quotes through the API.
Questi contenuti non sono ancora disponibili nella tua lingua.
GET /form returns the fields of your quote form. You need it before creating a quote through the API, because POST /quotes identifies each answer by the field’s key.
Permission: form:read (shown as Quote form — View).
curl https://quote.samita.io/api/public/v1/form \ -H "X-SAMITA-API-KEY: sqt_your_key_here"Response
Section titled “Response”The example below is illustrative. Your sections, field keys and labels come from your own form.
{ "form": { "sections": [ { "key": "contact_info", "title": "Contact information", "fields": [ { "key": "contact_info[first_name]", "label": "First name", "type": "text", "required": true }, { "key": "contact_info[email]", "label": "Email address", "type": "text", "required": true }, { "key": "contact_info[phone]", "label": "Phone number", "type": "phone", "required": true } ] }, { "key": "company_info", "title": "Company information", "fields": [ { "key": "company_info[name]", "label": "Company name", "type": "text", "required": true } ] }, { "key": "payment_terms", "title": "Payment terms", "fields": [ { "key": "payment_terms[type]", "label": "Payment terms", "type": "select", "required": false, "options": [ { "label": "Net 30", "value": "net30" }, { "label": "Net 60", "value": "net60" } ] } ] } ] }}A field key can contain square brackets, such as contact_info[email]. Use it exactly as shown, as the name of a property in the fields object.
| Field | Meaning |
|---|---|
sections[].key, title | The section as set up in the form builder. |
fields[].key | The identifier to use in fields when you create a quote. |
label | The text customers see. |
type | The field type, such as text, email, select, textarea or file. |
required | true if the form requires an answer. A required field must be sent when you create a quote. |
options | For choice fields, the allowed values, each with its label. |
Only fields customers fill in are listed. Headings, paragraphs, dividers, HTML blocks and hidden fields are left out.
Next steps
Section titled “Next steps”- Quotes — create a quote using these keys