User Tools

Site Tools


api

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
api [2019/09/08 09:49] – [Quote Request API] flackapi [2019/09/25 18:23] – [Quote - Missing structures] flack
Line 645: Line 645:
   * **delivery_time**: Delivery time limit (working days). Door-to-door delivery time. Only offer molecules that are available within the specified number of working days. You can specify null if delivery time is not critical. (default: 21)   * **delivery_time**: Delivery time limit (working days). Door-to-door delivery time. Only offer molecules that are available within the specified number of working days. You can specify null if delivery time is not critical. (default: 21)
   * **purity**: Required minimum purity (%). (default: null)   * **purity**: Required minimum purity (%). (default: null)
 +  * **higher_amounts**: Set to true if you would like to get a quote for the compounds in the largest possible quantity in case they do not cost more than the specified amount. (default: false)
   * **item_filters**: Per query item filters. Currently it supports only supplier filtering. See example below.   * **item_filters**: Per query item filters. Currently it supports only supplier filtering. See example below.
  
Line 1280: Line 1281:
     * **product**: The ID of the quoted product (should be neglected).     * **product**: The ID of the quoted product (should be neglected).
     * **product_compound_mcule_id**: The compound level structures' mcule ID of the quoted product.     * **product_compound_mcule_id**: The compound level structures' mcule ID of the quoted product.
 +    * **product_delivery_time**: Delivery time (working days)
     * **product_price**: Product price (USD)     * **product_price**: Product price (USD)
     * **product_purity**: Minimum purity (%)     * **product_purity**: Minimum purity (%)
Line 1318: Line 1320:
   * **updated**: The update datetime the quote.   * **updated**: The update datetime the quote.
   * **valid_until**: The datetime until the quote is valid.   * **valid_until**: The datetime until the quote is valid.
-   +   
 +==== Quote - Missing structures ==== 
 + 
 +You can get the missing structures along with the reason of their exclusion. 
 + 
 +<code> 
 +http https://mcule.com/api/v1/iquotes/<quote_id>/missing/ "Authorization: Token <your_token>" 
 +</code> 
 + 
 +And it will return a similar response to this: 
 +<code> 
 +
 +    "results":
 +        { 
 +            "data":
 +                "MCULE-6224850672": "No instant quotable products" 
 +            },  
 +            "id": 4,  
 +            "quote": 125,  
 +            "structure": 167312,  
 +            "structure_mcule_id": "MCULE-6224850672" 
 +        },  
 +        { 
 +            "data":
 +                "MCULE-7173925849": "No instant quotable products" 
 +            },  
 +            "id": 5,  
 +            "quote": 125,  
 +            "structure": 135326,  
 +            "structure_mcule_id": "MCULE-7173925849" 
 +        },  
 +        { 
 +            "data":
 +                "P-282184": "Purity filtering",  
 +                "P-307415": "Purity filtering" 
 +            },  
 +            "id": 6,  
 +            "quote": 125,  
 +            "structure": 201510,  
 +            "structure_mcule_id": "MCULE-9519333144" 
 +        } 
 +    ] 
 +
 +</code> 
 + 
 +==== 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://mcule.com/api/v1/iquotes/15677/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://mcule.com/api/v1/iquotes/15677/download-excel/ "Authorization: Token <your_token>" --download 
 +</code> 
 + 
 + 
 + 
 +====== Code examples (Python) ====== 
 + 
 +We created a public Git repository that contains Python code examples on how to use the Mcule API. These examples supplement the above API documentation and might give you a better understanding on how you can utilize those API endpoints currently. 
 + 
 +The repository is available here: 
 +[[https://bitbucket.org/mcule/mcule_api_usage_examples/]] 
 + 
 +We'll probably extend this repository with new examples later. 
api.txt · Last modified: 2023/06/03 07:19 by flack