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/08/05 17:47] flackapi [2019/11/29 16:08] – [Database files] flack
Line 63: Line 63:
             ],              ], 
             "last_updated": "2017-09-18",              "last_updated": "2017-09-18", 
-            "name": "Mcule Purchasable (full)"+            "name": "Mcule Purchasable (full)"
 +            "public": true
         },          }, 
         {         {
Line 83: Line 84:
             ],              ], 
             "last_updated": "2017-09-18",              "last_updated": "2017-09-18", 
-            "name": "Mcule Purchasable (in stock)"+            "name": "Mcule Purchasable (in stock)"
 +            "public": true
         }         }
     ]     ]
 } }
 </code> </code>
 +
 +If you call this API endpoint as an authenticated user (=you provide a [[api#authentication|valid token]]) you might get additional private entries if you have permission to access them.
  
  
Line 229: Line 233:
  
 Authentication is currently a token based authentication. Authentication is currently a token based authentication.
-If you would like to access our protected API endpoints, please drop us an email at info@mcule.com and we can provide you with a token.+If you would like to access our protected API endpoints, please drop us an email at support@mcule.com and we can provide you with a token.
  
 Once you have a valid token you have to send it in the Authorization header: Once you have a valid token you have to send it in the Authorization header:
Line 236: Line 240:
 </code> </code>
  
 +Example:
 +<code>
 +Authorization: Token 905050288b9e786a4d60gc2fe2e5007000b7f17c
 +</code>
 +
 +If you have a valid access token you can check it on the [[https://mcule.com/accounts/api-access/|API acccess page]] on mcule.com. If you need to generate a new one, you can also do it there.
  
 ====== Protected API endpoints ====== ====== Protected API endpoints ======
Line 486: Line 496:
  
 </code> </code>
 +
 +
 +
 +===== Compound suppliers public API  =====
 +
 +You can get some very basic (public) information about our compound suppliers with this API.
 +
 +== Endpoint: ==
 +<code>/compound-suppliers-public/</code>
 +
 +== Example API request: ==
 +<code>
 +http https://mcule.com/api/v1/compound-suppliers-public/ "Authorization: Token <your_token>" --print HBhb
 +</code>
 +
 +== Example request: ===
 +<code>
 +GET /api/v1/compound-suppliers-public/ 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
 +Connection: keep-alive
 +Content-Encoding: gzip
 +Content-Type: application/json
 +
 +{
 +    "count": 115, 
 +    "next": "https://mcule.com/api/v1/compound-suppliers-public/?page=2", 
 +    "previous": null, 
 +    "results": [
 +        {
 +            "api_url": "https://mcule.com/api/v1/compound-suppliers-public/58/", 
 +            "catalogs": [
 +                {
 +                    "api_url": "https://mcule.com/api/v1/compound-catalogs-public/60/", 
 +                    "id": 60, 
 +                    "name": "Compound Cloud collection", 
 +                    "supplier": 58, 
 +                    "supplier_name": "BioAscent Discovery", 
 +                    "type": 30, 
 +                    "type_display": "Screening"
 +                }
 +            ], 
 +            "id": 58, 
 +            "name": "BioAscent Discovery", 
 +            "shipping_from_country": "", 
 +            "shipping_from_country_display": "", 
 +            "website": ""
 +        }, 
 +        
 +        ...
 +        
 +  ]
 +}
 +</code>
 +
 +The detail API endpoint is also available on this endpoint:
 +<code>/compound-suppliers-public/<supplier_id>/</code>
 +
 +It will return a similar response as the above one but for an individual compound supplier.
 +
 +
 +
 +
 +===== Compound catalogs public API  =====
 +
 +You can get some very basic (public) information about our compound catalogs with this API.
 +
 +== Endpoint: ==
 +<code>/compound-catalogs-public/</code>
 +
 +== Example API request: ==
 +<code>
 +http https://mcule.com/api/v1/compound-catalogs-public/ "Authorization: Token <your_token>" --print HBhb
 +</code>
 +
 +== Example request: ===
 +<code>
 +GET /api/v1/compound-catalogs-public/ HTTP/1.1
 +Accept: */*
 +Accept-Encoding: gzip, deflate
 +Authorization: Token <your_token>
 +Connection: keep-alive
 +</code>
 +
 +== Example response: ===
 +<code>
 +HTTP/1.1 200 OK
 +Allow: GET, HEAD, OPTIONS
 +Connection: keep-alive
 +Content-Encoding: gzip
 +Content-Type: application/json
 +
 +{
 +    "count": 205, 
 +    "next": "https://mcule.com/api/v1/compound-catalogs-public/?page=2", 
 +    "previous": null, 
 +    "results": [
 +        {
 +            "api_url": "https://mcule.com/api/v1/compound-catalogs-public/60/", 
 +            "id": 60, 
 +            "name": "Compound Cloud collection", 
 +            "supplier": 58, 
 +            "supplier_name": "BioAscent Discovery", 
 +            "type": 30, 
 +            "type_display": "Screening"
 +        }, 
 +
 +        ...
 +        
 +    ]
 +}
 +</code>
 +
 +
 +The detail API endpoint is also available on this endpoint:
 +<code>/compound-catalogs-public/<catalog_id>/</code>
 +
 +It will return a similar response as the above one but for an individual compound catalog.
 +
  
  
 ===== Quote Request API ===== ===== Quote Request API =====
 +
 == Endpoint: == == Endpoint: ==
 <code>/iquote-queries/</code> <code>/iquote-queries/</code>
Line 498: Line 635:
  
 Mandatory fields: Mandatory fields:
-  * **mcule_ids**: List of mcule IDs of structures you want get a quote request for +  * **mcule_ids**: List of mcule IDs of structures you want get a quote for. 
-  * **customer_first_name**: The customer's first name +  * **customer_first_name**: The customer's first name. It does not need to be specified if the user's first name is specified on the Edit profile page on mcule.com. 
-  * **customer_last_name**: The customer's last name +  * **customer_last_name**: The customer's last name. It does not need to be specified if the user's last name is specified on the Edit profile page on mcule.com. 
-  * **delivery_country**: ISO 3166-1 alpha-2 code of the delivery country+  * **delivery_country**: ISO 3166-1 alpha-2 code of the delivery country
  
 Optional fields: Optional fields:
-  * **amount**: Preferred amount per molecule (mg)default: 1 +  * **amount**: Preferred amount per molecule (mg). (default: 1) 
-  * **min_amount**: Acceptable minimum amount (mg)default: 1+  * **min_amount**: Acceptable minimum amount (mg). (default: null) 
 +  * **target_volume**: The target volume (in ml), in case of solution based amount. 
 +  * **target_cc**: Target concentration (mM), in case of solution based amount. 
 +  * **extra_amount**: In case of solution based amount calculation extra amount (in mg) can be specified here. 
 +  * **customer_email**: The customer's email address. By default it will be filled with the email address associated with the user making the API request. 
 +  * **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) 
 +  * **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.
  
-== Request: ===+The **amount** or target concentration-volume pair (**target_volume** and **target_cc**) need to be specified. 
 + 
 +**item_filters** example: 
 +It has to be a data structure where keys are mcule IDs you specified in the **mcule_ids** field. If you specify a key that is not an item in the **mcule_ids** list you should get a validation error (400 Bad Request). 
 +Currently only supplier filtering is supported. You can specify a supplier ID list in the **suppliers** field to restrict product selection of a given item to a list of suppliers. If the list contains only one supplier ID, you restrict the product selection to that particular supplier. To get the ID of a supplier you can use the [[api#compound_suppliers_public_api|Compound suppliers Public API endpoint]] or the data is provided to you in another form (e.g.: exported database file that contains the information). If you specify a non-existing supplier ID, you should get a validation error. 
 +<code> 
 +
 +  "MCULE-2221628462": {"suppliers": [3]}, 
 +  "MCULE-6824753328": {"suppliers": [3, 48]} 
 +
 +</code>  
 + 
 +Advanced optional fields: 
 +  * **keep_original_salt_form**: If false (by default), allow Mcule to deliver an alternative salt form if the original is not available. (default: false) 
 +  * **keep_original_tautomer_form**: If false (by default), allow Mcule to deliver compounds drawn in alternative tautomer forms. Alternative tautomer forms are perceived by the system based on [[http://en.wikipedia.org/wiki/International_Chemical_Identifier|IUPAC InChI identifiers]]. (default: false) 
 +  * **keep_original_stereo_form**: If false (by default), allow Mcule to deliver compounds drawn in alternative stereochemical forms. (default: false) 
 +  * **deliver_multiple_salt_forms**: Deliver multiple salt forms or tautomers of the same compound. If false and the input contains duplicates, only a single salt form / tautomer will be kept (only effective when alternative salt or tautomer forms are allowed). (default: false) 
 + 
 + 
 +== Example request: ===
 <code> <code>
 POST /api/v1/iquote-queries/ HTTP/1.1 POST /api/v1/iquote-queries/ HTTP/1.1
Line 531: Line 696:
 </code> </code>
  
-== Response: ===+== Example response: ===
 <code> <code>
 HTTP/1.1 201 CREATED HTTP/1.1 201 CREATED
Line 553: Line 718:
     "delivery_post_code": "",      "delivery_post_code": "", 
     "delivery_time": 21,      "delivery_time": 21, 
-    "dmso_concentration": 20.0,  
-    "dmso_max_volume": "0.85",  
-    "dmso_min_purity": "99.5",  
-    "empty_plate_columns": true,  
     "end_date": null,      "end_date": null, 
-    "extra_amount": null,  
-    "format": 0,  
     "group": null,      "group": null, 
     "id": 15029,      "id": 15029, 
Line 565: Line 724:
     "keep_original_stereo_form": false,      "keep_original_stereo_form": false, 
     "keep_original_tautomer_form": false,      "keep_original_tautomer_form": false, 
-    "max_combinations": 10000,  
-    "max_time": 42,  
     "min_amount": null,      "min_amount": null, 
-    "min_combinations": 137,  
     "notes": "",      "notes": "", 
-    "original": null,  
-    "package_consolidation": true,  
-    "plate_source": null,  
-    "plate_type": "",  
-    "priority_cutoff": null,  
     "promo_code": "",      "promo_code": "", 
     "purity": null,      "purity": null, 
-    "quote_staff_options": false,  
-    "recalc_type": null,  
-    "recalc_value": null,  
     "site_url": "https://mcule.com/quote/query/15029/",      "site_url": "https://mcule.com/quote/query/15029/", 
     "start_date": null,      "start_date": null, 
Line 593: Line 741:
 ===== Quote Request Status API ===== ===== Quote Request Status API =====
  
-Since generating a quote request can take some time it is an asynchronous process. You can query the status of a quote request by calling the detail API endpoint of the quote request. It is returned in the **api_url** field when you create the quote request. You can also use the **id** field to construct the API call. YOu can check the **state** field of the response whether the async quote request processing is finished.+Since processing a quote request and generating suitable quotes can take some time it is an asynchronous process. You can query the status of a quote request by calling the detail API endpoint of the quote request. It is returned in the **api_url** field when you create the quote request. You can also use the **id** field to construct the url of the API call. You can check the **state** field of the response whether the async quote request processing is finished.
  
 States: States:
Line 606: Line 754:
 </code> </code>
  
-== Request: ===+== Example request: ===
  
 <code> <code>
Line 613: Line 761:
 Accept-Encoding: gzip, deflate Accept-Encoding: gzip, deflate
 Authorization: Token <your_token> Authorization: Token <your_token>
 +</code>
  
-== Response: ===+== Example response: ===
 <code> <code>
 HTTP/1.1 200 OK HTTP/1.1 200 OK
Line 638: Line 787:
     "delivery_post_code": "",      "delivery_post_code": "", 
     "delivery_time": 21,      "delivery_time": 21, 
-    "dmso_concentration": 20.0,  
-    "dmso_max_volume": "0.85",  
-    "dmso_min_purity": "99.5",  
-    "empty_plate_columns": true,  
     "end_date": "2019-08-05T19:22:13.109267",      "end_date": "2019-08-05T19:22:13.109267", 
-    "extra_amount": null,  
-    "format": 0,  
     "group": {     "group": {
         "created": "2019-08-05T19:22:13.063732",          "created": "2019-08-05T19:22:13.063732", 
Line 651: Line 794:
         "quotes": [         "quotes": [
             {             {
-                "active": true,  
                 "analytical_services_price": "0.00",                  "analytical_services_price": "0.00", 
                 "api_url": "https://mcule.com/api/v1/iquotes/15679/",                  "api_url": "https://mcule.com/api/v1/iquotes/15679/", 
Line 667: Line 809:
                 "is_expired": false,                  "is_expired": false, 
                 "is_saved": false,                  "is_saved": false, 
-                "missing": [ 
-                    346209969 
-                ],  
                 "name": "",                  "name": "", 
                 "order_data": null,                  "order_data": null, 
Line 689: Line 828:
                 "total_cost_without_discount": 551.04,                  "total_cost_without_discount": 551.04, 
                 "total_discount_price": "0.00",                  "total_discount_price": "0.00", 
-                "tracking": null,  
                 "type": 30,                  "type": 30, 
-                "type_display": "Special offer", +                "type_display": "Optimum", 
                 "updated": "2019-08-05T19:22:13.099155",                  "updated": "2019-08-05T19:22:13.099155", 
                 "valid_until": "2019-09-04T19:22:13.099"                 "valid_until": "2019-09-04T19:22:13.099"
             },              }, 
             {             {
-                "active": true,  
                 "analytical_services_price": "0.00",                  "analytical_services_price": "0.00", 
                 "api_url": "https://mcule.com/api/v1/iquotes/15678/",                  "api_url": "https://mcule.com/api/v1/iquotes/15678/", 
Line 712: Line 849:
                 "is_expired": false,                  "is_expired": false, 
                 "is_saved": false,                  "is_saved": false, 
-                "missing": [],  
                 "name": "",                  "name": "", 
                 "order_data": null,                  "order_data": null, 
Line 732: Line 868:
                 "total_cost_without_discount": 1183.84,                  "total_cost_without_discount": 1183.84, 
                 "total_discount_price": "0.00",                  "total_discount_price": "0.00", 
-                "tracking": null,  
                 "type": 20,                  "type": 20, 
                 "type_display": "Fastest delivery",                  "type_display": "Fastest delivery", 
Line 739: Line 874:
             },              }, 
             {             {
-                "active": true,  
                 "analytical_services_price": "0.00",                  "analytical_services_price": "0.00", 
                 "api_url": "https://mcule.com/api/v1/iquotes/15677/",                  "api_url": "https://mcule.com/api/v1/iquotes/15677/", 
Line 755: Line 889:
                 "is_expired": false,                  "is_expired": false, 
                 "is_saved": false,                  "is_saved": false, 
-                "missing": [],  
                 "name": "",                  "name": "", 
                 "order_data": null,                  "order_data": null, 
Line 789: Line 922:
     "keep_original_stereo_form": false,      "keep_original_stereo_form": false, 
     "keep_original_tautomer_form": false,      "keep_original_tautomer_form": false, 
-    "max_combinations": 10000,  
-    "max_time": 42,  
     "min_amount": null,      "min_amount": null, 
-    "min_combinations": 137,  
     "notes": "",      "notes": "", 
-    "original": null,  
-    "package_consolidation": true,  
-    "plate_source": null,  
-    "plate_type": "",  
-    "priority_cutoff": null,  
     "promo_code": "",      "promo_code": "", 
     "purity": null,      "purity": null, 
-    "quote_staff_options": false,  
-    "recalc_type": null,  
-    "recalc_value": null,  
     "site_url": "https://mcule.com/quote/query/15029/",      "site_url": "https://mcule.com/quote/query/15029/", 
     "start_date": "2019-08-05T19:21:55.430800",      "start_date": "2019-08-05T19:21:55.430800", 
Line 814: Line 936:
 </code> </code>
  
-As you can see from the result we could generate 3 different quotes for the query. A "Best price" quote, a "Fastest delivery" quote and "Special offer" quote.+Check for the **group** field. If it is not null, we could generate some quotes for your quote query. As you can see from the above resultwe could generate 3 different quotes for the quote query. A "Best price" quote, a "Fastest delivery" quote and an "Optimum" quote.
  
-===== Quote API =====+===== Quote API  =====
  
-In order to get the detailed data of an individual quote, you can query the following endpoint.+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 //15677//:
  
 <code> <code>
Line 824: Line 946:
 </code> </code>
  
-== Request: ===+== Example request: ===
 <code> <code>
 GET /api/v1/iquotes/15677/ HTTP/1.1 GET /api/v1/iquotes/15677/ HTTP/1.1
Line 832: Line 954:
 </code> </code>
  
-== Response: ===+== Example response: ===
 <code> <code>
 HTTP/1.1 200 OK HTTP/1.1 200 OK
Line 840: Line 962:
  
 { {
-    "active": true,  
     "analytical_services_price": "0.00",      "analytical_services_price": "0.00", 
     "api_url": "https://mcule.com/api/v1/iquotes/15677/",      "api_url": "https://mcule.com/api/v1/iquotes/15677/", 
Line 846: Line 967:
     "catalog_data": [     "catalog_data": [
         {         {
 +            "avg_effective_price": -126.72333333333333,
             "catalog": 6,              "catalog": 6, 
             "delivery_price": "86.95",              "delivery_price": "86.95", 
             "delivery_time": 11,              "delivery_time": 11, 
-            "effective_price": "380.17", +            "effective_price": "380.17"
 +            "effective_price_display": -380.17,
             "id": 90198,              "id": 90198, 
             "products_count": 3,              "products_count": 3, 
Line 857: Line 980:
         },          }, 
         {         {
 +            "avg_effective_price": -144.45,
             "catalog": 156,              "catalog": 156, 
             "delivery_price": "107.21",              "delivery_price": "107.21", 
             "delivery_time": 10,              "delivery_time": 10, 
             "effective_price": "144.45",              "effective_price": "144.45", 
 +            "effective_price_display": -144.45,
             "id": 90197,              "id": 90197, 
             "products_count": 1,              "products_count": 1, 
Line 868: Line 993:
         },          }, 
         {         {
 +            "avg_effective_price": -416.37,
             "catalog": 202,              "catalog": 202, 
             "delivery_price": "117.00",              "delivery_price": "117.00", 
             "delivery_time": 21,              "delivery_time": 21, 
             "effective_price": "416.37",              "effective_price": "416.37", 
 +            "effective_price": -416.37, 
             "id": 90196,              "id": 90196, 
             "products_count": 1,              "products_count": 1, 
Line 894: Line 1021:
         {         {
             "amount": 1,              "amount": 1, 
 +            "effective_price_display": -144.45,
             "id": 1740173,              "id": 1740173, 
             "price": "144.45",              "price": "144.45", 
-            "product": 505393003, +            "product": 505393003
 +            "product_catalog_id": 156, 
 +            "product_catalog_name": "Building Blocks"
             "product_compound_mcule_id": "MCULE-1886826647",              "product_compound_mcule_id": "MCULE-1886826647", 
-            "product_delivery_time": 6,  
-            "product_external_id": "Q499",  
             "product_mcule_id": "P-505393003",              "product_mcule_id": "P-505393003", 
             "product_price": "35.18",              "product_price": "35.18", 
             "product_purity": 98,              "product_purity": 98, 
 +            "product_supplier_id": 37,
 +            "product_supplier_name": "AK Scientific",
             "quote": 15677,              "quote": 15677, 
-            "raw_product_price": "25.00",  
             "structure_origin": 346255984,              "structure_origin": 346255984, 
             "structure_origin_mcule_id": "MCULE-1886826647"             "structure_origin_mcule_id": "MCULE-1886826647"
Line 910: Line 1039:
         {         {
             "amount": 1,              "amount": 1, 
 +            "effective_price_display": -97.32,
             "id": 1740172,              "id": 1740172, 
             "price": "97.32",              "price": "97.32", 
 +            "product_catalog_id": 6,
 +            "product_catalog_name": "Advanced Collection",
             "product": 346316287,              "product": 346316287, 
             "product_compound_mcule_id": "MCULE-3906582667",              "product_compound_mcule_id": "MCULE-3906582667", 
-            "product_delivery_time": 7,  
-            "product_external_id": "Z1450413036",  
             "product_mcule_id": "P-346316287",              "product_mcule_id": "P-346316287", 
             "product_price": "95.94",              "product_price": "95.94", 
             "product_purity": 90,              "product_purity": 90, 
 +            "product_supplier_id": 3,
 +            "product_supplier_name": "Enamine",
             "quote": 15677,              "quote": 15677, 
-            "raw_product_price": "73.80",  
             "structure_origin": 346316288,              "structure_origin": 346316288, 
             "structure_origin_mcule_id": "MCULE-6824753328"             "structure_origin_mcule_id": "MCULE-6824753328"
Line 926: Line 1057:
         {         {
             "amount": 1,              "amount": 1, 
 +            "effective_price_display": -97.32,
             "id": 1740171,              "id": 1740171, 
             "price": "97.32",              "price": "97.32", 
             "product": 346567071,              "product": 346567071, 
 +            "product_catalog_id": 6,
 +            "product_catalog_name": "Advanced Collection",
             "product_compound_mcule_id": "MCULE-2221628462",              "product_compound_mcule_id": "MCULE-2221628462", 
-            "product_delivery_time": 7,  
-            "product_external_id": "Z1373424921",  
             "product_mcule_id": "P-346567071",              "product_mcule_id": "P-346567071", 
             "product_price": "95.94",              "product_price": "95.94", 
             "product_purity": 90,              "product_purity": 90, 
 +            "product_supplier_id": 3,
 +            "product_supplier_name": "Enamine",
             "quote": 15677,              "quote": 15677, 
-            "raw_product_price": "73.80",  
             "structure_origin": 346567072,              "structure_origin": 346567072, 
             "structure_origin_mcule_id": "MCULE-2221628462"             "structure_origin_mcule_id": "MCULE-2221628462"
Line 942: Line 1075:
         {         {
             "amount": 1,              "amount": 1, 
 +            "effective_price_display": -97.32,
             "id": 1740170,              "id": 1740170, 
             "price": "97.32",              "price": "97.32", 
             "product": 346206264,              "product": 346206264, 
 +            "product_catalog_id": 6,
 +            "product_catalog_name": "Advanced Collection",
             "product_compound_mcule_id": "MCULE-7223347867",              "product_compound_mcule_id": "MCULE-7223347867", 
-            "product_delivery_time": 7,  
-            "product_external_id": "Z2327039912",  
             "product_mcule_id": "P-346206264",              "product_mcule_id": "P-346206264", 
             "product_price": "95.94",              "product_price": "95.94", 
-            "product_purity": 90, +            "product_purity": 90
 +            "product_supplier_id": 3, 
 +            "product_supplier_name": "Enamine"
             "quote": 15677,              "quote": 15677, 
-            "raw_product_price": "73.80",  
             "structure_origin": 346206265,              "structure_origin": 346206265, 
             "structure_origin_mcule_id": "MCULE-7223347867"             "structure_origin_mcule_id": "MCULE-7223347867"
Line 958: Line 1093:
         {         {
             "amount": 1,              "amount": 1, 
 +            "effective_price_display": -416.37,
             "id": 1740169,              "id": 1740169, 
             "price": "416.37",              "price": "416.37", 
             "product": 580505383,              "product": 580505383, 
 +            "product_catalog_id": 202,
 +            "product_catalog_name": "Compounds on demand",
             "product_compound_mcule_id": "MCULE-4609548851",              "product_compound_mcule_id": "MCULE-4609548851", 
-            "product_delivery_time": 19,  
-            "product_external_id": "X52967",  
             "product_mcule_id": "P-580505383",              "product_mcule_id": "P-580505383", 
             "product_price": "293.45",              "product_price": "293.45", 
             "product_purity": null,              "product_purity": null, 
 +            "product_supplier_id": 33,
 +            "product_supplier_name": "Manchester Organics",
             "quote": 15677,              "quote": 15677, 
-            "raw_product_price": "225.73",  
             "structure_origin": 346209969,              "structure_origin": 346209969, 
             "structure_origin_mcule_id": "MCULE-4609548851"             "structure_origin_mcule_id": "MCULE-4609548851"
         }         }
     ],      ], 
-    "missing": [],  
     "name": "",      "name": "", 
     "order_data": null,      "order_data": null, 
Line 1034: Line 1170:
         "delivery_post_code": "",          "delivery_post_code": "", 
         "delivery_time": 21,          "delivery_time": 21, 
-        "dmso_concentration": 20.0,  
-        "dmso_max_volume": "0.85",  
-        "dmso_min_purity": "99.5",  
-        "empty_plate_columns": true,  
         "end_date": "2019-08-05T19:22:13.109267",          "end_date": "2019-08-05T19:22:13.109267", 
-        "extra_amount": null,  
-        "format": 0,  
         "group": 11647,          "group": 11647, 
         "id": 15029,          "id": 15029, 
Line 1046: Line 1176:
         "keep_original_stereo_form": false,          "keep_original_stereo_form": false, 
         "keep_original_tautomer_form": false,          "keep_original_tautomer_form": false, 
-        "max_combinations": 10000,  
-        "max_time": 42,  
         "min_amount": null,          "min_amount": null, 
-        "min_combinations": 137,  
         "notes": "",          "notes": "", 
-        "original": null,  
-        "package_consolidation": true,  
-        "plate_source": null,  
-        "plate_type": "",  
-        "priority_cutoff": null,  
         "promo_code": "",          "promo_code": "", 
         "purity": null,          "purity": null, 
-        "quote_staff_options": false,  
-        "recalc_type": null,  
-        "recalc_value": null,  
         "site_url": "https://mcule.com/quote/query/15029/",          "site_url": "https://mcule.com/quote/query/15029/", 
         "start_date": "2019-08-05T19:21:55.430800",          "start_date": "2019-08-05T19:21:55.430800", 
Line 1082: Line 1201:
             "delivery_time": 10,              "delivery_time": 10, 
             "effective_price": "380.17",              "effective_price": "380.17", 
 +            "effective_price_display": -380.17, 
             "id": 69668,              "id": 69668, 
             "products_count": 3,              "products_count": 3, 
Line 1096: Line 1216:
             "delivery_time": 9,              "delivery_time": 9, 
             "effective_price": "144.45",              "effective_price": "144.45", 
 +            "effective_price_display": -144.45, 
             "id": 69669,              "id": 69669, 
             "products_count": 1,              "products_count": 1, 
Line 1110: Line 1231:
             "delivery_time": 20,              "delivery_time": 20, 
             "effective_price": "416.37",              "effective_price": "416.37", 
 +            "effective_price_display": -416.37, 
             "id": 69667,              "id": 69667, 
             "products_count": 1,              "products_count": 1, 
Line 1132: Line 1254:
 } }
 </code> </code>
 +
 +== Fields: ===
 +
 +Where currency is not specified, it is always USD.
 +
 +  * **analytical_services_price**: price of analytical services (USD)
 +  * **avg_product_price**: Average product price (USD)
 +  * **catalog_data**: list of catalog level data 
 +    * **products_count**: Number of products from this catalog
 +    * **products_price**: Total product price of this catalog (USD)
 +    * **effective_price_display**: Total price change if excluded this catalog. (USD) It shows how the total price will change upon removal of the catalog. In addition to the product price, this may include delivery cost, packaging fees, small / minimum order fees, etc.
 +    * **avg_effective_price**: Average price change upon exclusion of one product (USD).
 +    * **delivery_time**: Delivery time (work. days)
 +    * **quote**: The ID of the quote this catalog level quote data belongs to. 
 +  * **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**: The creation datetime of the quote.
 +  * **delivery_days**: Estimated delivery time. Number of working days after purchase order accepted.
 +  * **delivery_price**: Shipping cost from suppliers to Mcule (USD)
 +  * **duplicate_count**: Number of duplicates in the query.
 +  * **extra_handling_price**: Extra handling cost (USD)
 +  * **group**: 
 +  * **id**: The ID of the Instant Quote.
 +  * **is_expired**: Whether the quote is expired.
 +  * **is_saved**: Whether the quote is saved. Quotes created via the API are not saved.
 +  * **items**: list of product level data
 +    * **amount**: Quoted amount (mg)
 +    * **effective_price_display**: Total price change if excluded this product. (USD) It shows how the total price will change upon removal of the product. In addition to the product price, this may include delivery cost, packaging fees, small / minimum order fees, etc
 +    * **price**: effective price
 +    * **product_mcule_id**: The mcule ID of the quoted product.
 +    * **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_delivery_time**: Delivery time (working days)
 +    * **product_price**: Product price (USD)
 +    * **product_purity**: Minimum purity (%)
 +    * **structure_origin_mcule_id**: The mcule ID of the query molecule.
 +    * **quote**: The ID of the quote this product level quote data belongs to.
 +  * **name**: The name of the quote. Quotes created via the API don't have names.
 +  * **order_data**: Order data. (Should be neglected).
 +  * **payment_due_days**: Payment terms. Number of days net or prepayment by credit card
 +  * **price**: Total price of quote (USD)
 +  * **price_items**: The list of price items. They are only used for display purposes basically.
 +  * **product_discount_price**: Discount of products price (USD).
 +  * **products_price**: Price of products (USD)
 +  * **query**: The quote query fields
 +  * **reference_id_full**: The full reference ID of the instant quote.
 +  * **reformatting_price**: Reformatting price (USD)
 +  * **shipping_price**: Shipping & handling cost (USD)
 +  * **site_url**: The quote's URL to view on mcule.com site.
 +  * **special_formatting_price**: Special reformatting price (USD)
 +  * **state**: State code of the quote.
 +  * **state_display**: Human readable state of the quote.
 +  * **supplier_data**: list of supplier level data
 +    * **delivery_price**: Shipping cost (USD)
 +    * **delivery_time**: Delivery time (working days)
 +    * **effective_price**: Total price change if excluded this supplier. (USD) It shows how the total price will change upon removal of the supplier. In addition to the product price, this may include delivery cost, packaging fees, small / minimum order fees, etc.
 +    * **avg_effective_price**: Average price change upon exclusion of one product from this supplier (USD).
 +    * **products_count**: Number of products from this supplier.
 +    * **products_price**: Total product price of this supplier (USD)
 +    * **quote**: The ID of the quote this supplier quote data belongs to.
 +    * **reformatting_price**: Reformatting price (USD)
 +    * **supplier**: The ID of the supplier this supplier quote data belongs to.
 +  * **suppliers_count**: Number of suppliers
 +  * **total_cost**: Total cost (USD)
 +  * **total_cost_without_discount**: Total cost without discount (USD)
 +  * **total_discount_price**: Total discount price (USD)
 +  * **type**: Type code of the quote.
 +  * **type_display**: Human readable type of the quote.
 +  * **updated**: The update datetime the quote.
 +  * **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