GET <qbench-url>/qbench/api/v1/quotation/{quotationID}
- Will retrieve a quotation by its ID.
GET <qbench-url>/qbench/api/v1/quotation/uuid/{quotationUUID}
- Will retrieve a quotation by its UUID.
Retrieving a single quotation will display a list of any line items for the quotation. Each quotation item will be one of the following item types:
- QUOTATION_ITEM
- A standard quotation line item.
- FLAT_SURCHARGE
- A surcharge of a flat dollar amount.
- FLAT_DISCOUNT
- A discount of a flat dollar amount.
- PERCENT_SURCHARGE
- A surcharge that is a percentage of a previous subtotal.
- PERCENT_DISCOUNT
- A discount that is a percentage of a previous subtotal.
- SUBTOTAL
- A subtotal of any previous line items.
Example request:
ID Request:
GET /qbench/api/v1/quotation/1 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
UUID Request:
GET /qbench/api/v1/quotation/uuid/ab0b5889-0936-46a5-abb1-08a8215d2b65 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
"customer_id": 4,
"date_created": "08/04/2022",
"expiration_date": "08/11/2022",
"id": 1,
"last_updated": "1659638682",
"quotation_date": "08/04/2022",
"quotation_items": [
{
"amount": 250.0,
"base_price": 250.0,
"discount": 0.0,
"id": 1,
"name": "Identification A <197A>",
"quantity": 1,
"quotation_id": 1,
"surcharge": null
},
{
"amount": 65.0,
"base_price": 65.0,
"discount": 0.0,
"id": 2,
"name": "pH",
"quantity": 1,
"quotation_id": 1,
"surcharge": null
},
{
"amount": 700.0,
"base_price": 700.0,
"discount": 0.0,
"id": 3,
"name": "Testing",
"quantity": 1,
"quotation_id": 1,
"surcharge": null
}
],
"status": "DRAFT",
"uuid": "ab0b5889-0936-46a5-abb1-08a8215d2b65",
"qb2d4": "4122073"
}
PATCH <qbench-url>/qbench/api/v1/quotation/{quotationID}
- Update the existing quotation by ID
Example request:
PATCH /qbench/api/v1/quotation/1 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Content-Type: application/json
{
"status": "ACCEPTED"
}
Example response:
{
"message": "OK",
"qba2b9": "b28a2f6ebccc"
}
GET <qbench-url>/qbench/api/v1/quotation/print/{quotationID}
To print quotation with the provided quotation ID and quotation template ID.
Example request:
GET /qbench/api/v1/quotation/print/1 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Content-Type: application/json
{
"template_id": 1
}
Example response:
The response will returned as bytes data with the content type of application/pdf. You may write those bytes data to a file in order to view it as a pdf.
Response Header Example:
Date: Mon, 10 Jun 2024 19:33:04 GMT
Content-Type: application/pdf
Content-Length: 134134
Connection: close
Server: nginx
Access-Control-Allow-Origin: *
Pragma: no-cache
Strict-Transport-Security: max-age=31536000;
Vary: Cookie
Set-Cookie: session=eyJjc3JmX3Rva2VuIjoiMzA0NWVmNjUtYTRhMy00NGFmLTg3NDgtM2IwMDUzYTg1MDkwIn0.ZmdU8A.d0lacwbb7oPANIIBt2hAQ4LJ46w; Secure; HttpOnly; Path=/; SameSite=Lax
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0
Response Body Example:
%PDF-1.5
%����
4 0 obj
<< /Length 5 0 R
/Filter /FlateDecode
>>
stream
x��[ێܸ}�W�!���,Jԥ� �/��
�/� 6�nzgƗ�h|i;��>d�,�86蕨:U��:E�{�����S�c֪�X�����s��Z
m��n��P��4�_��뛪ȗw��C[�;��|�`l�����E&���53�>8�� 5��dgM��m�9���՛Hʣm��E!.�A�e�>�ތ���y�׳��K�����Hy��e��x��E��C���TR�����<uA��K2EPoY|Hҙ�`�5��,>{19SWEa������T�P�MZxxGbв_XiI{���!lR�8�Œ��D�~$���\2YH�(�}p��� �^X�r@{����6~>'ud{a�/0�J�Lp��u�u��w�~}�Ui3
S��G�[=�j��=�c"�1\d�/��IJ�o`Y���C�]
......
POST <qbench-url>/qbench/api/v1/quotation/email/send/{quotationID}
- Send the quotation by quotationID to emails list provided along with the email_message.
Example request:
POST /qbench/api/v1/quotation/email/send/1?emails=customer_1@qbench.com&emails=customer_2@qbench.com&email_message=Email Send From API! HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
"date_emailed": "06/10/2024 07:47 PM",
"emailed_by": null,
"qbd": "956fcf"
}
POST <qbench-url>/qbench/api/v1/quotation
- Create Quotation
Example request:
POST /qbench/api/v1/quotation HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Content-Type: application/json
{
"template_id": 1,
"email_to": "testing@qbench.com,testing_2@qbench.com",
"status": "DRAFT",
"customer_id": 4,
"quotation_date": "05/20/2024",
"expiration_date": "05/28/2024",
"quotation_item_dicts": [
{
"quotation_item_type": "QUOTATION_ITEM",
"base_price": 250.0,
"discount": 0.0,
"name": "Quotation Item 1",
"quantity": 1,
"amount": 250.0,
"surcharge": null
}
]
}
Example response:
{
"id": 2,
"qb3be": "80bec9"
}
Comments
0 comments
Please sign in to leave a comment.