Skip to content

Quotes

6 endpoints. Authentication, errors, paging and rate limits are described once, in the API overview.

Action Method Description
acceptquote POST Accept a quote and raise its invoice
createquote POST Create a new quote for a client
deletequote POST Delete a quote
getquotes GET List all quotes with optional filtering
sendquote POST Mark a quote as sent to the client
updatequote POST Update an existing quote

acceptquote

Accept a quote and raise its invoice.

POST /api/v1/acceptquote

Permission: manage_quotes

Parameters

Name Type Required Description
quoteid integer yes The quote.

Response

Field Description
result success
quoteid integer
status string: Accepted
invoiceid integer: the invoice raised from it

Errors

Status When
404 No such quote.

Note

Raises the invoice, as the client Accept button does. Accepting an accepted quote changes nothing.

Example

curl -X POST https://example.com/api/v1/acceptquote \
  -H "X-API-Key: $PNLCS_IDENTIFIER" \
  -H "X-API-Secret: $PNLCS_SECRET" \
  --data-urlencode "quoteid=1"

createquote

Create a new quote for a client.

POST /api/v1/createquote

Permission: manage_quotes

Parameters

Name Type Required Description
userid integer yes The client. clientid is accepted too.
subject string no Default Quote.
validuntil date no Default 30 days from today.
items array no The lines: items[0][description], items[0][quantity] (default 1), items[0][unit_price], items[0][discount], items[0][taxable].

Response

Field Description
result success
quoteid integer

Note

Created as a Draft. Send it with sendquote.

Example

curl -X POST https://example.com/api/v1/createquote \
  -H "X-API-Key: $PNLCS_IDENTIFIER" \
  -H "X-API-Secret: $PNLCS_SECRET" \
  --data-urlencode "userid=1"

deletequote

Delete a quote.

POST /api/v1/deletequote

Permission: manage_quotes

Parameters

Name Type Required Description
quoteid integer yes The quote.

Response

Field Description
result success

Errors

Status When
404 No such quote.

Example

curl -X POST https://example.com/api/v1/deletequote \
  -H "X-API-Key: $PNLCS_IDENTIFIER" \
  -H "X-API-Secret: $PNLCS_SECRET" \
  --data-urlencode "quoteid=1"

getquotes

List all quotes with optional filtering.

GET /api/v1/getquotes

Permission: list_quotes

Parameters

Name Type Required Description
userid integer no Only this client's quotes.
status string no Draft, Sent, Accepted or Declined.
limitstart integer no Where the page starts. Default 0.
limitnum integer no Page size, 1 to 250. Default 25.

Response

Field Description
result success
totalresults integer: rows matching the filters
startnumber integer: where this page starts
numreturned integer: rows on this page
data array: the rows

Note

Each quote carries its client and line items.

Example

curl -G https://example.com/api/v1/getquotes \
  -H "X-API-Key: $PNLCS_IDENTIFIER" \
  -H "X-API-Secret: $PNLCS_SECRET"

sendquote

Mark a quote as sent to the client.

POST /api/v1/sendquote

Permission: manage_quotes

Parameters

Name Type Required Description
quoteid integer yes The quote.

Response

Field Description
result success
quoteid integer
status string: Sent

Errors

Status When
404 No such quote.

Note

Marks it Sent, as the Send button in the admin area does, so the client can see and accept it in the client area. No email is sent.

Example

curl -X POST https://example.com/api/v1/sendquote \
  -H "X-API-Key: $PNLCS_IDENTIFIER" \
  -H "X-API-Secret: $PNLCS_SECRET" \
  --data-urlencode "quoteid=1"

updatequote

Update an existing quote.

POST /api/v1/updatequote

Permission: manage_quotes

Parameters

Name Type Required Description
quoteid integer yes The quote.
status string no Draft, Sent, Accepted or Declined (exactly as written).
validuntil date no Valid until.
notes string no Admin notes.
customer_notes string no Notes shown to the client.
proposal string no The proposal text.

Response

Field Description
result success
quoteid integer

Errors

Status When
404 No such quote.

Example

curl -X POST https://example.com/api/v1/updatequote \
  -H "X-API-Key: $PNLCS_IDENTIFIER" \
  -H "X-API-Secret: $PNLCS_SECRET" \
  --data-urlencode "quoteid=1"