User Tools

Site Tools


ultimate-api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
ultimate-api [2020/07/20 16:19]
flack
ultimate-api [2020/12/07 15:54]
flack
Line 225: Line 225:
 </code> </code>
  
-In case of similarity searches the **tan** value contains the similarity value.+In case of similarity searches the **tan** value the response contains the similarity value. 
 + 
 +In case of similarity searches you can control the minimum similarity with the **sim_threshold** param. Its default  value is 0.7. Its minimum value is also 0.7 unless you are allowed to use a lower value. For example: 
 +<code> 
 +
 +    "query":
 +        "type": "sim", 
 +        "query": "C(N1C(C(OC2CCCN(C3=CC=CC=C3)C2)=O)CN(C)C1=O)(=O)C(=C)CN1CCOCC1", 
 +        "limit": 5, 
 +        "sim_threshold": 0.8 
 +    } 
 +
 +</code>
  
  
Line 321: Line 333:
 == Example API request: == == Example API request: ==
 <code> <code>
-echo '{"compounds": ["VKCCTPSYCYARFI-UHFFFAOYSA-N", "DVPXLZBGJCHMEO-UHFFFAOYSA-N", "XKJIOIJSLLCDOZ-UHFFFAOYSA-N", "XVWBPPRZAKJXSY-UHFFFAOYSA-N", "ZNOWNQHKOHUYLP-UHFFFAOYSA-N", "IEJBADVRNXRNLB-UHFFFAOYSA-N", "LZRUMHHZJMDZLR-UHFFFAOYSA-N", "PTKVKZOBUQFOJX-UHFFFAOYSA-N", "LFHNTOJEMXUDKP-UHFFFAOYSA-N", "SICGQCSMIMRHLF-UHFFFAOYSA-N", "YGLRUSPDEQEHKM-UHFFFAOYSA-N"], "amount": 1, "currency":"USD", individual": true}' | http https://ultimateapp.mcule.com/api/v1/pricing/ --print HBhb+echo '{"compounds": ["VKCCTPSYCYARFI-UHFFFAOYSA-N", "DVPXLZBGJCHMEO-UHFFFAOYSA-N", "XKJIOIJSLLCDOZ-UHFFFAOYSA-N", "XVWBPPRZAKJXSY-UHFFFAOYSA-N", "ZNOWNQHKOHUYLP-UHFFFAOYSA-N", "IEJBADVRNXRNLB-UHFFFAOYSA-N", "LZRUMHHZJMDZLR-UHFFFAOYSA-N", "PTKVKZOBUQFOJX-UHFFFAOYSA-N", "LFHNTOJEMXUDKP-UHFFFAOYSA-N", "SICGQCSMIMRHLF-UHFFFAOYSA-N", "YGLRUSPDEQEHKM-UHFFFAOYSA-N"], "amount": 1, "currency":"USD", "individual": true}' | http https://ultimateapp.mcule.com/api/v1/pricing/ --print HBhb
 </code> </code>
  
Line 799: Line 811:
  
 Check for the **quotes** field. If it is there and contains some items in the list, we could generate some quotes for your quote query. As you can see from the above result, we could generate 1 quote for the quote query. A "Best price" quote. Check for the **quotes** field. If it is there and contains some items in the list, we could generate some quotes for your quote query. As you can see from the above result, we could generate 1 quote for the quote query. A "Best price" quote.
 +
 +
 +====== Quote API  ======
 +
 +In order to get the detailed data of an individual quote, you can call the detail API endpoint of a quote, for example for the quote with ID //9//:
 +
 +<code>
 +http https://ultimateapp.mcule.com/api/v1/iquotes/9/ "Authorization: Token <your_token>" --print HBhb
 +</code>
 +
 +== Example request: ===
 +<code>
 +GET /api/v1/iquotes/9/ HTTP/1.1
 +Accept: */*
 +Accept-Encoding: gzip, deflate
 +Authorization: Token <your_token>
 +</code>
 +
 +== Example response: ===
 +<code>
 +HTTP/1.1 200 OK
 +Allow: GET, HEAD, OPTIONS
 +Content-Encoding: gzip
 +Content-Type: application/json
 +
 +{
 +    "additional_document_notes": "",
 +    "api_url": "https://ultimateapp.mcule.com/api/v1/iquotes/9/",
 +    "avg_product_price": "667.74",
 +    "avg_product_price_currency": "USD",
 +    "coverage_percent": 100,
 +    "created_at": "2020-07-20T14:01:30.506962Z",
 +    "id": 9,
 +    "items": [
 +        {
 +            "amount": 1,
 +            "compound": {
 +                "archived_at": null,
 +                "inchi_key": "RAQLVHPPDXCQDS-UHFFFAOYSA-N",
 +                "smiles": "C(NC1=C(C#N)C=C(C#N)C=N1)(=O)C1N=C(N2CCN(C3=CC=CC=C3)CC2)SC=1"
 +            },
 +            "product_price": 637.27,
 +            "product_price_currency": "USD",
 +            "purity_percent": 90
 +        },
 +        {
 +            "amount": 1,
 +            "compound": {
 +                "archived_at": null,
 +                "inchi_key": "QWPFQODIGUYSLE-UHFFFAOYSA-N",
 +                "smiles": "C(N(C(CSCC1OC=CC=1)=O)C1=C(C(F)(F)F)C=CC=C1)(=O)CCC1=NOC=C1"
 +            },
 +            "product_price": 698.21,
 +            "product_price_currency": "USD",
 +            "purity_percent": 90
 +        }
 +    ],
 +    "payment_due_days": 30,
 +    "price_items": [
 +        {
 +            "attr": "products_price",
 +            "name": "Products price",
 +            "price": 1335.48,
 +            "price_currency": "USD"
 +        },
 +        {
 +            "attr": "product_discount",
 +            "name": "Product discount (0%)",
 +            "price": 0.0,
 +            "price_currency": "USD"
 +        },
 +        {
 +            "attr": "shipping_price",
 +            "name": "Shipping & package consolidation",
 +            "price": 51.09,
 +            "price_currency": "USD"
 +        },
 +        {
 +            "attr": "reformatting_price",
 +            "name": "Reformatting",
 +            "price": 0.0,
 +            "price_currency": "USD"
 +        },
 +        {
 +            "attr": "total_discount_price",
 +            "name": "Total discount (0%)",
 +            "price": 0.0,
 +            "price_currency": "USD"
 +        }
 +    ],
 +    "product_discount_price": null,
 +    "product_discount_price_currency": "USD",
 +    "products_price": 1335.48,
 +    "products_price_currency": "USD",
 +    "query": {
 +        "amount": 1,
 +        "api_url": "https://ultimateapp.mcule.com/api/v1/iquote-queries/9/",
 +        "created_at": "2020-07-20T14:01:30.412763Z",
 +        "currency": "USD",
 +        "customer_email": "foo@bar.com",
 +        "customer_name": "John Doe",
 +        "delivery_country": {
 +            "code": "US",
 +            "name": "United States of America"
 +        },
 +        "delivery_format": 0,
 +        "delivery_format_display": "Dry powder/film in supplier vial",
 +        "ended_at": "2020-07-20T14:01:30.514096Z",
 +        "extra_amount": null,
 +        "id": 9,
 +        "notes": "",
 +        "purity": null,
 +        "scheme": 1,
 +        "started_at": "2020-07-20T14:01:30.464496Z",
 +        "state": 30,
 +        "state_display": "Done",
 +        "target_cc": null,
 +        "target_volume": null,
 +        "user": 2
 +    },
 +    "reference_id_full": "UI-9",
 +    "reformatting_price": null,
 +    "reformatting_price_currency": "USD",
 +    "selection_criteria": 10,
 +    "selection_criteria_display": "Best price",
 +    "shipping_price": 51.09,
 +    "shipping_price_currency": "USD",
 +    "state": 10,
 +    "state_display": "Displayed",
 +    "total_discount_price": null,
 +    "total_discount_price_currency": "USD",
 +    "total_price": 1386.57,
 +    "total_price_currency": "USD",
 +    "valid_until": "2020-08-19T14:01:30.506962Z"
 +}
 +</code>
 +
 +== Fields: ===
 +  * **additional_document_notes**: Additional document notes
 +  * **avg_product_price**: Average product price
 +  * **avg_product_price_currency**: Currency of average product price
 +  * **coverage_percent**: How many of the query molecules appear in the quote. E.g. if your query contains 10 molecules and you get a quote for 9, it is 90%.
 +  * **created_at**: The creation datetime of the quote.
 +  * **id**: The ID of the Instant Quote.
 +  * **items**: list of product level data
 +    * **amount**: Quoted amount (mg)
 +    * **compound**: the quoted compound
 +    * **product_price**: product price
 +    * **product_price_currency**: currency of product price
 +    * **purity_percent**: Guaranteed purity (%)
 +  * **payment_due_days**: Payment terms. Number of days net or prepayment by credit card
 +  * **price_items**: The list of price items. They are only used for display purposes basically.
 +  * **product_discount_price**: Discount of products price
 +  * **product_discount_price_currency**: Currency of discount of products price
 +  * **products_price**: Price of products
 +  * **products_price_currency**: Currency of price of products
 +  * **query**: The quote query fields
 +  * **reference_id_full**: The full reference ID of the instant quote.
 +  * **reformatting_price**: Reformatting price (USD)
 +  * **reformatting_price_currency**: Currency of reformatting price
 +  * **selection_criteria**: Selection criteria code of the quote.
 +  * **selection_criteria_display**: Human readable selection criteria of the quote.
 +  * **shipping_price**: Shipping & handling cost
 +  * **shipping_price_currency**: Currency of Shipping & handling cost
 +  * **state**: State code of the quote.
 +  * **state_display**: Human readable state of the quote.
 +  * **total_discount_price**: Total discount price
 +  * **total_discount_price_currency**: Currency of total discount price
 +  * **total_price**: Total price of quote
 +  * **total_price_currency**: Currency of the total price
 +  * **valid_until**: The datetime until the quote is valid.
 +  
 +==== Download quote as PDF  ====
 +
 +You can download a quote as a PDF file. Please note that the PDF file generation can take some time, the more item it contains the more time it will take to generate the file.
 +
 +The HTTP response contains a //Content-Disposition attachment; filename="<filename>"// header indicating that it should be downloaded.
 +
 +<code>
 +http https://ultimateapp.mcule.com/api/v1/iquotes/9/download-pdf/ "Authorization: Token <your_token>" --download
 +</code>
 +
 +==== Download quote as Excel (.xlsx) file  ====
 +
 +You can download a quote as an Excel file. Please note that the file generation can take some time, the more item it contains the more time it will take to generate the file.
 +
 +The HTTP response contains a //Content-Disposition attachment; filename="<filename>"// header indicating that it should be downloaded.
 +
 +<code>
 +http https://ultimateapp.mcule.com/api/v1/iquotes/9/download-excel/ "Authorization: Token <your_token>" --download
 +</code>
 +
  
  
  
ultimate-api.txt · Last modified: 2021/05/25 16:27 by flack