# Quotes

The quotes endpoint url is:

https://skhokho.io/api/v1.0/quotes

# Quote GET Request

Quotes GET request will fetch a list of quotes associated with the company of the user who is currently authenticated. The structure of the list will be:

[
  {
   "id": 273,
   "title": "New Quote",
   "description": "A cool description about the quote you are creating.",
   "notes": null,
   "status": "CREATED",
   "taxPercentage": "15%",
   "totalBeforeTax": "33402.00",
   "taxAmount": "5010.30",
   "totalAfterTax": "38412.30",
   "client": {
       "id": 339,
       "companyName": "New Postman Client",
       "companyEmail": "digital@gmail.com",
       "companyPhone": "011 432 5543",
       "companyTaxNumber": "554764576578",
       "companyWebsite": "https://skhokho.io",
       "companySize": "Medium Sized",
       "companyIndustry": "Construction",
       "addressLine1": "12 Church Streeet",
       "city": "Sandton",
       "state": "Gauteng",
       "country": "South Africa",
       "postalCode": "2196",
       "twitter": "https://twitter.com",
       "facebook": "",
       "linkedIn": "",
       "uniqueId": "xxxxxxxxx"
      },
  "items": [
    {
        "id": 1048,
        "title": "Weekly Meeting Costs",
        "price": "3567",
        "quantity": 4,
        "total": "14268.00",
        "uniqueId": "xxxxxxxxxx"
    },
    {
        "id": 1049,
        "title": "Monthly Meeting Costs",
        "price": "9567",
        "quantity": 2,
        "total": "19134.00",
        "uniqueId": "xxxxxxxxx"
    }
        ],
  "uniqueId": "xxxxxxxxxx"
        },
    . . . . . // Other Results
]

When you request quote records, you also get the client record associated with that quote and the line items which build up the quote.

# Quotes POST Request

When you want to create a new quote record, you can send a POST request to the quotes end-point.

When creating a quote, you will also need to specify the client associated with that quote. There are two options for adding a client to the quote:

  1. Specify a name of an existing client
  2. Supply enough information to create a new client record

# Quote Payload Example with existing Client Record:

{
  "title": "New Quote",
  "description": "A cool description about the quote you are creating.",
  "notes": null,
  "status": "CREATED",
  "taxPercentage": "15%",
  "client": {
      "companyName": "Existing Client Name",
    }
}
Field Required/Optional Json Key Data Type Format
Tile of Quote Required title string
Description of Quote Optional description string
Quote Notes Optional notes string
Tax Percentage Required taxPercentage string 10%
Status Required type string/**fixed_options
Client Required client json object See Client API

** Quote type fixed options

[
  'CREATED',
  'EMAILED',
  'DECLINED',
  'ACCEPTED',
]

# Quote Payload Example with New Client Record:

{
  "title": "New Quote",
  "description": "A cool description about the quote you are creating.",
  "notes": null,
  "status": "CREATED",
  "taxPercentage": "15%",
  "client": {
    "companyName": "Construction Lorem",
    "companyEmail": "aryastark70@gmail.com",
    "companyPhone": "+27 67 221 8834",
    "companyTaxNumber": "128373747",
    "companyWebsite": "https://skhokho.io",
    "companySize": "Medium Sized",
    "companyIndustry": "Construction",
    "addressLine1": "1 Church Streeet",
    "city": "Johannesburg",
    "state": "Gauteng",
    "country": "South Africa",
    "postalCode": "2122",
    "twitter": "https://twitter.com",
    "facebook": "https://facebook.com",
    "linkedIn": "https://linkedin.com"
    }
}

TIP

See Client API to get the full data structure of the Client Object. Some of the fields are Fixed Options fields with set options to choose from like a drop-down menu.

# Quote Line Items

The Quote line items are specified in a separate POST request. A valid quote must be created before adding line items. Note - new line items can be added to existing quotes.

TIP

To add a quote line item, the uniqueID of the quote is required. That can be obtained from the GET request results.

To add line items, the following end-point should be used:

https://skhokho.io/api/v1.0/quote-items

This end-point only accepts POST requests. POST request Payload:

{
    "uniqueId": "xxxxxxxxx",
    "items": [
        {
            "title": "Weekly Meeting Costs",
            "price": "3567.12",
            "quantity": 4
        },
        {
            "title": "Monthly Meeting Costs",
            "price": "9567.12",
            "quantity": 2
        }
    ]
}

The Payload must contain:

  1. The uniqueId of the Quote
  2. A list of items. The list can include just one item if required.

The ITEM object structure is:

Field Required/Optional Json Key Data Type Format
Tile of Item Required title string
Price of Item Required price string 345.12
Quantity of Items Required quantity integer