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 [2017/12/05 13:20] – [Multiple queries exact search with availability] flackapi [2019/08/05 17:50] flack
Line 40: Line 40:
 Content-Type: application/json Content-Type: application/json
  
-[ +{ 
-    { +    "count": 2,  
-        "created": "2015-05-18", +    "next": null,  
-        "description": "Gzipped 2D SDF of all purchasable compounds", +    "previous": null 
-        "download_size_gb": 2.2+    "results": [ 
-        "download_url": "https://mcule.s3.amazonaws.com/mcule_purchasable_compounds_150518.sdf.gz", +        
-        "entry_count": 11695894+            "description": "All purchasable, in stock & virtual compounds",  
-        "name": "mcule_purchasable_compounds+            "entry_count": 35772718,  
-    }, +            "files":
-    +                { 
-        "created": "2015-05-18", +                    "download_url": "https://mcule.s3.amazonaws.com/database/mcule_purchasable_full_170918.sdf.gz",  
-        "description": "Gzipped 2D SDF of in stock compounds with known or unknown exact stock amount", +                    "file_type": "sdf.gz",  
-        "download_size_gb": 1.4+                    "file_type_display": "2D SDF (sdf.gz)" 
-        "download_url": "https://mcule.s3.amazonaws.com/mcule_in_stock_compounds_150518.sdf.gz", +                    "size_mb": 5762 
-        "entry_count": 5827052+                },  
-        "name": "mcule_in_stock_compounds+                
-    }, +                    "download_url": "https://mcule.s3.amazonaws.com/database/mcule_purchasable_full_170918.smiles.gz",  
-    +                    "file_type": "smiles.gz",  
-        "created": "2015-05-18", +                    "file_type_display": "SMILES (smi.gz)",  
-        "description": "Gzipped 2D SDF of in stock compounds with known exact stock amount", +                    "size_mb": 462 
-        "download_size_gb": 1.2+                } 
-        "download_url": "https://mcule.s3.amazonaws.com/mcule_known_stock_amount_compounds_150518.sdf.gz"+            ],  
-        "entry_count": 4922295+            "last_updated": "2017-09-18",  
-        "name": "mcule_known_stock_amount_compounds+            "name": "Mcule Purchasable (full)" 
-    }+        },  
-    { +        { 
-        "created": "2015-08-20", +            "description": "All purchasable, in stock compounds",  
-        "description": "Gzipped 2D SDF of purchasable compounds with known prices", +            "entry_count": 5648837,  
-        "download_size_gb": 2.2+            "files":
-        "download_url": "https://mcule.s3.amazonaws.com/mcule_instant_quotable_compounds_150820.sdf.gz", +                { 
-        "entry_count": 11533450+                    "download_url": "https://mcule.s3.amazonaws.com/database/mcule_purchasable_in_stock_170918.sdf.gz",  
-        "name": "mcule_instant_quotable_compounds+                    "file_type": "sdf.gz",  
-    }, +                    "file_type_display": "2D SDF (sdf.gz)" 
-    { +                    "size_mb": 1311 
-        "created": "2014-07-21", +                },  
-        "description": "Gzipped csv (delimitertab) of all compounds with mcule ID, standard InChI and InChIKey", +                
-        "download_size_gb": 0.4+                    "download_url": "https://mcule.s3.amazonaws.com/database/mcule_purchasable_in_stock_170918.smiles.gz",  
-        "download_url": "https://mcule.s3.amazonaws.com/mcule_inchies_140721.csv.gz"+                    "file_type": "smiles.gz",  
-        "entry_count": 7334938+                    "file_type_display": "SMILES (smi.gz)",  
-        "name": "mcule_inchies+                    "size_mb": 84 
-    +                } 
-]+            ],  
 +            "last_updated": "2017-09-18",  
 +            "name": "Mcule Purchasable (in stock)" 
 +        } 
 +    ] 
 +
 +</code> 
 + 
 + 
 +===== Compound details ===== 
 +== Endpoint: == 
 +<code>/compound/<mcule_id>/</code> 
 + 
 +== Example API request: == 
 +<code> 
 +http https://mcule.com/api/v1/compound/MCULE-9380369173/ --print HBhb 
 +</code> 
 + 
 +== Request: == 
 +<code> 
 +GET /api/v1/compound/MCULE-9380369173/ HTTP/1.
 +Accept: */* 
 +Accept-Encoding: gzip, deflate 
 +</code> 
 + 
 +== Response: == 
 +<code> 
 +HTTP/1.1 200 OK 
 +Allow: GETHEAD, OPTIONS 
 +Content-Encoding: gzip 
 +Content-Type: application/json 
 + 
 +
 +    "components": [],  
 +    "formula": "C15H11N3O2S2" 
 +    "inchi_key": "WVRLGAPZMSKMGL-UHFFFAOYSA-N",  
 +    "mcule_id": "MCULE-9380369173",  
 +    "mol": "\n  mcule   05121714262D\n\n 22 24  0  0  0  0  0  0  0  0999 V2000\n    3.8489    4.0497    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n    3.8489    3.0496    0.0000 O    0  0  0  0  0  0  0  0  0  0  0\n    2.9831    2.5496    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n    2.1169    3.0496    0.0000 O    0  0  0  0  0  0  0  0  0  0  0\n    2.9831    1.5495    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n    3.7922    0.9621    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n    3.4832    0.0109    0.0000 N    0  0  0  0  0  0  0  0  0  0  0\n    2.4829    0.0109    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n    1.8951   -0.7981    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n    0.9006   -0.6935    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n    0.3127   -1.5025    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n    0.6220   -2.4537    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n   -0.1871   -3.0416    0.0000 N    0  0  0  0  0  0  0  0  0  0  0\n   -0.9960   -2.4537    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n   -0.6872   -1.5025    0.0000 S    0  0  0  0  0  0  0  0  0  0  0\n   -1.9472   -2.7625    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n   -2.1550   -3.7409    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n   -3.1061   -4.0497    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n   -3.8489   -3.3807    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n   -3.6412   -2.4024    0.0000 C    0  0  0  0  0  0  0  0  0  0  0\n   -2.6901   -2.0935    0.0000 N    0  0  0  0  0  0  0  0  0  0  0\n    2.1740    0.9621    0.0000 S    0  0  0  0  0  0  0  0  0  0  0\n  1  2  1  0  0  0  0\n  2  3  1  0  0  0  0\n  3  4  2  0  0  0  0\n  3  5  1  0  0  0  0\n  5  6  2  0  0  0  0\n  6  7  1  0  0  0  0\n  7  8  2  0  0  0  0\n  8  9  1  0  0  0  0\n  9 10  2  3  0  0  0\n 10 11  1  0  0  0  0\n 11 12  2  0  0  0  0\n 12 13  1  0  0  0  0\n 13 14  2  0  0  0  0\n 14 15  1  0  0  0  0\n 11 15  1  0  0  0  0\n 14 16  1  0  0  0  0\n 16 17  1  0  0  0  0\n 17 18  2  0  0  0  0\n 18 19  1  0  0  0  0\n 19 20   0  0  0  0\n 20 21  1  0  0  0  0\n 16 21  2  0  0  0  0\n  8 22  1  0  0  0  0\n  5 22  1  0  0  0  0\nM  END",  
 +    "properties": { 
 +        "atoms": 33,  
 +        "components": 1,  
 +        "ct_bonds": 1,  
 +        "h_bond_acceptors": 5,  
 +        "h_bond_donors": 0,  
 +        "halogen_atoms": 0,  
 +        "heavy_atoms": 22,  
 +        "heteroatoms": 7,  
 +        "hydrogens": 11,  
 +        "known_ct_bonds": 0,  
 +        "known_stereocenters": 0,  
 +        "logp": 3.6186,  
 +        "mol_mass": 329.401,  
 +        "non_organic_atoms": 0,  
 +        "o_and_n_atoms": 5,  
 +        "psa": 121.45,  
 +        "r3_violations": 5,  
 +        "r5_violations": 0,  
 +        "refractivity": 87.6665,  
 +        "rings": 3,  
 +        "rotatable_bonds": 5,  
 +        "stereocenters": 0,  
 +        "undef_ct_bonds": 0,  
 +        "undef_stereocenters": 0,  
 +        "unknown_ct_bonds": 1,  
 +        "unknown_stereocenters": 0 
 +    },  
 +    "smiles": "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O",  
 +    "std_inchi": "InChI=1S/C15H11N3O2S2/c1-20-15(19)12-9-17-13(22-12)6-5-10-8-18-14(21-10)11-4-2-3-7-16-11/h2-9H,1H3",  
 +    "stereo_type": "none",  
 +    "url""https://mcule.com/MCULE-9380369173/" 
 +
 +</code> 
 + 
 +===== InChIKey lookup ===== 
 +== Endpoint: == 
 +<code>/lookup/<inchi_key></code> 
 + 
 +== Example API request: == 
 +<code> 
 +http https://mcule.com/api/v1/lookup/inchikey/WVRLGAPZMSKMGL-UHFFFAOYSA-N --print HBhb 
 +</code> 
 + 
 +== Request: == 
 +<code> 
 +GET /api/v1/lookup/inchikey/WVRLGAPZMSKMGL-UHFFFAOYSA-N HTTP/1.1 
 +Accept: */* 
 +Accept-Encoding: gzipdeflate 
 +</code> 
 + 
 +== Response: == 
 +<code> 
 +HTTP/1.1 200 OK 
 +Allow: GET, HEAD, OPTIONS 
 +Content-Encoding: gzip 
 +Content-Type: application/json 
 + 
 +
 +    "results": [ 
 +        
 +            "mcule_id": "MCULE-9380369173",  
 +            "smiles": "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O",  
 +            "url": "https://mcule.com/MCULE-9380369173/" 
 +        } 
 +    ] 
 +
 +</code> 
 + 
 + 
 +===== Single query search / lookup ===== 
 +== Endpoint: == 
 +<code>/search/lookup/?query=<your_query></code> 
 + 
 +Where the query can be an mcule ID, SMILES, InChI or InChIKey identifier. 
 + 
 +== Example API request: == 
 +<code> 
 +http 'https://mcule.com/api/v1/search/lookup/?query=COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O' --print HBhb 
 +</code> 
 + 
 +== Request: == 
 +<code> 
 +GET /api/v1/search/lookup/?query=COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O HTTP/1.
 +Accept: */* 
 +Accept-Encoding: gzip, deflate 
 +</code> 
 + 
 +== Response: == 
 +<code> 
 +HTTP/1.1 200 OK 
 +Allow: GET, HEADOPTIONS 
 +Content-Encoding: gzip 
 +Content-Type: application/json 
 + 
 +
 +    "results": [ 
 +        
 +            "mcule_id": "MCULE-9380369173",  
 +            "smiles": "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O" 
 +            "url": "https://mcule.com/MCULE-9380369173/" 
 +        
 +    ] 
 +}
 </code> </code>
  
Line 99: Line 240:
  
 Protected API endpoints are only accessible if a valid token is provided in the Authorization header of the request. Protected API endpoints are only accessible if a valid token is provided in the Authorization header of the request.
 +
 +===== Compound availability =====
 +== Endpoint: ==
 +<code>/compound/<mcule_id>/availability/</code>
 +
 +== Example API request: ==
 +<code>
 +http https://mcule.com/api/v1/compound/MCULE-9380369173/availability/ "Authorization: Token <your_token>" --print HBhb
 +</code>
 +
 +== Request: ==
 +<code>
 +GET /api/v1/compound/MCULE-9380369173/availability/ HTTP/1.1
 +Accept: */*
 +Accept-Encoding: gzip, deflate
 +Authorization: Token <your_token>
 +</code>
 +
 +== Response: ==
 +<code>
 +HTTP/1.1 200 OK
 +Allow: GET, HEAD, OPTIONS
 +Content-Encoding: gzip
 +Content-Type: application/json
 +
 +{
 +    "availability_type": "in stock", 
 +    "confirmed_amount": 242, 
 +    "confirmed_amount_unit": "mg"
 +}
 +</code>
 +
 +
 +===== Compound prices =====
 +== Endpoint: ==
 +<code>/compound/<mcule_id>/prices/</code>
 +
 +== Example API request: ==
 +<code>
 +http https://mcule.com/api/v1/compound/MCULE-9380369173/prices/ "Authorization: Token <your_token>" --print HBhb
 +</code>
 +
 +== Request: ==
 +<code>
 +GET /api/v1/compound/MCULE-9380369173/prices/ HTTP/1.1
 +Accept: */*
 +Accept-Encoding: gzip, deflate
 +Authorization: Token <your_token>
 +</code>
 +
 +== Response: ==
 +<code>
 +HTTP/1.1 200 OK
 +Allow: GET, HEAD, OPTIONS
 +Content-Encoding: gzip
 +Content-Type: application/json
 +
 +{
 +    "best_prices": [
 +        {
 +            "amount": 1, 
 +            "currency": "USD", 
 +            "delivery_time_working_days": 9, 
 +            "price": 107, 
 +            "purity": 90, 
 +            "unit": "mg"
 +        }, 
 +        {
 +            "amount": 5, 
 +            "currency": "USD", 
 +            "delivery_time_working_days": 9, 
 +            "price": 116, 
 +            "purity": 90, 
 +            "unit": "mg"
 +        }, 
 +        {
 +            "amount": 10, 
 +            "currency": "USD", 
 +            "delivery_time_working_days": 9, 
 +            "price": 151, 
 +            "purity": 90, 
 +            "unit": "mg"
 +        }
 +    ]
 +}
 +</code>
 +
 +It returns the best prices for 1mg, 5mg and 10mg amounts by default.
 +You can specify amounts of your choice in the //amounts// GET parameter:
 +
 +<code>
 +http 'https://mcule.com/api/v1/compound/MCULE-9380369173/prices/?amounts=15,20' "Authorization: Token <your_token>" --print HBhb
 +</code>
 +
  
 ===== Multiple queries exact search ===== ===== Multiple queries exact search =====
Line 143: Line 378:
             "mcule_id": "MCULE-9380369173",              "mcule_id": "MCULE-9380369173", 
             "smiles": "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O",              "smiles": "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O", 
-            "url": "http://mcule.com/MCULE-9380369173/"+            "url": "https://mcule.com/MCULE-9380369173/"
         },          }, 
         {         {
Line 149: Line 384:
             "mcule_id": "MCULE-4016901520",              "mcule_id": "MCULE-4016901520", 
             "smiles": "CC1=C(C(N2CC3C(CCC3N)C2)=O)SC(CC2=CC=CC=C2)=N1",              "smiles": "CC1=C(C(N2CC3C(CCC3N)C2)=O)SC(CC2=CC=CC=C2)=N1", 
-            "url": "http://mcule.com/MCULE-4016901520/"+            "url": "https://mcule.com/MCULE-4016901520/"
         },          }, 
         {         {
Line 155: Line 390:
             "mcule_id": "MCULE-7428195288",              "mcule_id": "MCULE-7428195288", 
             "smiles": "C1([C@H](C(C)C)NC(CCCC[C@H]2CCSS2)=O)NC2=C(C=CC=C2)N=1",              "smiles": "C1([C@H](C(C)C)NC(CCCC[C@H]2CCSS2)=O)NC2=C(C=CC=C2)N=1", 
-            "url": "http://mcule.com/MCULE-7428195288/"+            "url": "https://mcule.com/MCULE-7428195288/"
         },          }, 
         {         {
Line 161: Line 396:
             "mcule_id": "MCULE-1259420189",              "mcule_id": "MCULE-1259420189", 
             "smiles": "CCCCC1=CC=C(CC(N(CC2CCN(C)CC2)C)=O)C=C1",              "smiles": "CCCCC1=CC=C(CC(N(CC2CCN(C)CC2)C)=O)C=C1", 
-            "url": "http://mcule.com/MCULE-1259420189/"+            "url": "https://mcule.com/MCULE-1259420189/"
         }         }
     ]     ]
Line 213: Line 448:
             "mcule_id": "MCULE-9380369173",              "mcule_id": "MCULE-9380369173", 
             "smiles": "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O",              "smiles": "COC(C1SC(C=CC2SC(C3=NC=CC=C3)=NC=2)=NC=1)=O", 
-            "url": "http://mcule.com/MCULE-9380369173/"+            "url": "https://mcule.com/MCULE-9380369173/"
         },          }, 
         {         {
Line 224: Line 459:
             "mcule_id": "MCULE-4016901520",              "mcule_id": "MCULE-4016901520", 
             "smiles": "CC1=C(C(N2CC3C(CCC3N)C2)=O)SC(CC2=CC=CC=C2)=N1",              "smiles": "CC1=C(C(N2CC3C(CCC3N)C2)=O)SC(CC2=CC=CC=C2)=N1", 
-            "url": "http://mcule.com/MCULE-4016901520/"+            "url": "https://mcule.com/MCULE-4016901520/"
         },          }, 
         {         {
Line 235: Line 470:
             "mcule_id": "MCULE-7428195288",              "mcule_id": "MCULE-7428195288", 
             "smiles": "C1([C@H](C(C)C)NC(CCCC[C@H]2CCSS2)=O)NC2=C(C=CC=C2)N=1",              "smiles": "C1([C@H](C(C)C)NC(CCCC[C@H]2CCSS2)=O)NC2=C(C=CC=C2)N=1", 
-            "url": "http://mcule.com/MCULE-7428195288/"+            "url": "https://mcule.com/MCULE-7428195288/"
         },          }, 
         {         {
Line 246: Line 481:
             "mcule_id": "MCULE-1259420189",              "mcule_id": "MCULE-1259420189", 
             "smiles": "CCCCC1=CC=C(CC(N(CC2CCN(C)CC2)C)=O)C=C1",              "smiles": "CCCCC1=CC=C(CC(N(CC2CCN(C)CC2)C)=O)C=C1", 
-            "url": "http://mcule.com/MCULE-1259420189/"+            "url": "https://mcule.com/MCULE-1259420189/"
         }         }
     ]     ]
  
 </code> </code>
 +
 +
 +===== Quote Request API (Available soon...) =====
 +== Endpoint: ==
 +<code>/iquote-queries/</code>
 +
 +== Example API request: ==
 +<code>
 +echo '{"customer_first_name": "John", "customer_last_name": "Doe", "delivery_country": "US", "mcule_ids": ["MCULE-2221628462", "MCULE-6824753328", "MCULE-1886826647", "MCULE-4609548851", "MCULE-7223347867"], "min_amount": null, "amount": 1}' | http https://mcule.com/api/v1/iquote-queries/ "Authorization: Token <your_token>" --print HBhb
 +</code>
 +
 +Mandatory fields:
 +  * **mcule_ids**: List of mcule IDs of structures you want get a quote request for
 +  * **customer_first_name**: The customer's first name
 +  * **customer_last_name**: The customer's last name
 +  * **delivery_country**: ISO 3166-1 alpha-2 code of the delivery country
 +
 +Optional fields:
 +  * **amount**: Preferred amount per molecule (mg); default: 1
 +  * **min_amount**: Acceptable minimum amount (mg); default: 1
 +
 +== Request: ===
 +<code>
 +POST /api/v1/iquote-queries/ HTTP/1.1
 +Accept: application/json, */*
 +Accept-Encoding: gzip, deflate
 +Authorization: Token <your_token>
 +Content-Type: application/json
 +
 +{
 +    "amount": 1, 
 +    "customer_first_name": "John", 
 +    "customer_last_name": "Doe", 
 +    "delivery_country": "US", 
 +    "mcule_ids": [
 +        "MCULE-2221628462", 
 +        "MCULE-6824753328", 
 +        "MCULE-1886826647", 
 +        "MCULE-4609548851", 
 +        "MCULE-7223347867"
 +    ], 
 +    "min_amount": null
 +}
 +</code>
 +
 +== Response: ===
 +<code>
 +HTTP/1.1 201 CREATED
 +Allow: GET, POST, HEAD, OPTIONS
 +Content-Type: application/json
 +
 +{
 +    "amount": 1, 
 +    "api_url": "https://mcule.com/api/v1/iquote-queries/15029/", 
 +    "created": "2019-08-05T19:21:55.339011", 
 +    "customer_email": "", 
 +    "customer_first_name": "John", 
 +    "customer_last_name": "Doe", 
 +    "deliver_multiple_salt_forms": false, 
 +    "delivery_address": "", 
 +    "delivery_city": "", 
 +    "delivery_contact_person_email": "", 
 +    "delivery_contact_person_name": "", 
 +    "delivery_contact_person_phone": "", 
 +    "delivery_country": "US", 
 +    "delivery_post_code": "", 
 +    "delivery_time": 21, 
 +    "dmso_concentration": 20.0, 
 +    "dmso_max_volume": "0.85", 
 +    "dmso_min_purity": "99.5", 
 +    "empty_plate_columns": true, 
 +    "end_date": null, 
 +    "extra_amount": null, 
 +    "format": 0, 
 +    "group": null, 
 +    "id": 15029, 
 +    "keep_original_salt_form": false, 
 +    "keep_original_stereo_form": false, 
 +    "keep_original_tautomer_form": false, 
 +    "max_combinations": 10000, 
 +    "max_time": 42, 
 +    "min_amount": null, 
 +    "min_combinations": 137, 
 +    "notes": "", 
 +    "original": null, 
 +    "package_consolidation": true, 
 +    "plate_source": null, 
 +    "plate_type": "", 
 +    "priority_cutoff": null, 
 +    "promo_code": "", 
 +    "purity": null, 
 +    "quote_staff_options": false, 
 +    "recalc_type": null, 
 +    "recalc_value": null, 
 +    "site_url": "https://mcule.com/quote/query/15029/", 
 +    "start_date": null, 
 +    "state": 10, 
 +    "state_display": "Pending", 
 +    "target_cc": null, 
 +    "target_volume": null, 
 +    "user": 11
 +}
 +</code>
 +
 +
 +===== Quote Request Status API (Available soon...) =====
 +
 +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.
 +
 +States:
 +  * **10 / Pending**: The quote query is queued but the processing has not started yet.
 +  * **20 / Running**: The processing of the quote query is in progress.
 +  * **30 / Done**: The processing of the quote query is finished. For one quote request query we might generate multiple quotes (this is what we call a group) or it is also possible that we could not generate any quotes for a particular quote request. If there are quotes they will appear under the **group** field where the **quotes** field contains a list of the generated quotes and some basic info about them. You can get detailed data of a particular quote by calling the endpoint specified in the **api_url** field.
 +  * **40 / Error**: An error happened during the processing of the quote query.
 +
 +Following the above example where the ID of the quote request is //15029// we query the status of the quote request:
 +<code>
 +http https://mcule.com/api/v1/iquote-queries/15029/ "Authorization: Token <your_token>" --print HBhb
 +</code>
 +
 +== Request: ===
 +
 +<code>
 +GET /api/v1/iquote-queries/15029/ HTTP/1.1
 +Accept: */*
 +Accept-Encoding: gzip, deflate
 +Authorization: Token <your_token>
 +
 +== Response: ===
 +<code>
 +HTTP/1.1 200 OK
 +Allow: GET, HEAD, OPTIONS
 +Connection: keep-alive
 +Content-Encoding: gzip
 +Content-Type: application/json
 +
 +{
 +    "amount": 1, 
 +    "api_url": "https://mcule.com/api/v1/iquote-queries/15029/", 
 +    "created": "2019-08-05T19:21:55.339011", 
 +    "customer_email": "", 
 +    "customer_first_name": "John", 
 +    "customer_last_name": "Doe", 
 +    "deliver_multiple_salt_forms": false, 
 +    "delivery_address": "", 
 +    "delivery_city": "", 
 +    "delivery_contact_person_email": "", 
 +    "delivery_contact_person_name": "", 
 +    "delivery_contact_person_phone": "", 
 +    "delivery_country": "US", 
 +    "delivery_post_code": "", 
 +    "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", 
 +    "extra_amount": null, 
 +    "format": 0, 
 +    "group": {
 +        "created": "2019-08-05T19:22:13.063732", 
 +        "id": 11647, 
 +        "query": 15029, 
 +        "quotes": [
 +            {
 +                "active": true, 
 +                "analytical_services_price": "0.00", 
 +                "api_url": "https://mcule.com/api/v1/iquotes/15679/", 
 +                "avg_product_price": 80.75, 
 +                "coverage_percent": 80, 
 +                "created": "2019-08-05T19:22:13.099143", 
 +                "delivery_days": 11, 
 +                "delivery_price": "194.16", 
 +                "description": "", 
 +                "discount": 0, 
 +                "duplicate_count": 0, 
 +                "extra_handling_price": "0.00", 
 +                "group": 11647, 
 +                "id": 15679, 
 +                "is_expired": false, 
 +                "is_saved": false, 
 +                "missing": [
 +                    346209969
 +                ], 
 +                "name": "", 
 +                "order_data": null, 
 +                "payment_due_days": 30, 
 +                "po_number": null, 
 +                "price": "551.04", 
 +                "product_discount_price": "0.00", 
 +                "products_price": "323.00", 
 +                "reference_id_full": "I-15679", 
 +                "reformatting_price": "0.00", 
 +                "shipping_price": "33.88", 
 +                "site_url": "https://mcule.com/quote/I-15679/", 
 +                "special_formatting_price": null, 
 +                "state": 10, 
 +                "state_display": "Displayed", 
 +                "stock_with_amount_ratio": 0, 
 +                "suppliers_count": 2, 
 +                "total_cost": 551.04, 
 +                "total_cost_without_discount": 551.04, 
 +                "total_discount_price": "0.00", 
 +                "tracking": null, 
 +                "type": 30, 
 +                "type_display": "Special offer", 
 +                "updated": "2019-08-05T19:22:13.099155", 
 +                "valid_until": "2019-09-04T19:22:13.099"
 +            }, 
 +            {
 +                "active": true, 
 +                "analytical_services_price": "0.00", 
 +                "api_url": "https://mcule.com/api/v1/iquotes/15678/", 
 +                "avg_product_price": 160.298, 
 +                "coverage_percent": 100, 
 +                "created": "2019-08-05T19:22:13.087753", 
 +                "delivery_days": 11, 
 +                "delivery_price": "339.47", 
 +                "description": "", 
 +                "discount": 0, 
 +                "duplicate_count": 0, 
 +                "extra_handling_price": "0.00", 
 +                "group": 11647, 
 +                "id": 15678, 
 +                "is_expired": false, 
 +                "is_saved": false, 
 +                "missing": [], 
 +                "name": "", 
 +                "order_data": null, 
 +                "payment_due_days": 30, 
 +                "po_number": null, 
 +                "price": "1183.84", 
 +                "product_discount_price": "0.00", 
 +                "products_price": "801.49", 
 +                "reference_id_full": "I-15678", 
 +                "reformatting_price": "0.00", 
 +                "shipping_price": "42.88", 
 +                "site_url": "https://mcule.com/quote/I-15678/", 
 +                "special_formatting_price": null, 
 +                "state": 10, 
 +                "state_display": "Displayed", 
 +                "stock_with_amount_ratio": 0, 
 +                "suppliers_count": 3, 
 +                "total_cost": 1183.84, 
 +                "total_cost_without_discount": 1183.84, 
 +                "total_discount_price": "0.00", 
 +                "tracking": null, 
 +                "type": 20, 
 +                "type_display": "Fastest delivery", 
 +                "updated": "2019-08-05T19:22:13.087765", 
 +                "valid_until": "2019-09-04T19:22:13.087"
 +            }, 
 +            {
 +                "active": true, 
 +                "analytical_services_price": "0.00", 
 +                "api_url": "https://mcule.com/api/v1/iquotes/15677/", 
 +                "avg_product_price": 123.29, 
 +                "coverage_percent": 100, 
 +                "created": "2019-08-05T19:22:13.069027", 
 +                "delivery_days": 21, 
 +                "delivery_price": "311.16", 
 +                "description": "", 
 +                "discount": 0, 
 +                "duplicate_count": 0, 
 +                "extra_handling_price": "0.00", 
 +                "group": 11647, 
 +                "id": 15677, 
 +                "is_expired": false, 
 +                "is_saved": false, 
 +                "missing": [], 
 +                "name": "", 
 +                "order_data": null, 
 +                "payment_due_days": 30, 
 +                "po_number": null, 
 +                "price": "967.41", 
 +                "product_discount_price": "0.00", 
 +                "products_price": "616.45", 
 +                "reference_id_full": "I-15677", 
 +                "reformatting_price": "0.00", 
 +                "shipping_price": "39.80", 
 +                "site_url": "https://mcule.com/quote/I-15677/", 
 +                "special_formatting_price": null, 
 +                "state": 10, 
 +                "state_display": "Displayed", 
 +                "stock_with_amount_ratio": 0, 
 +                "suppliers_count": 3, 
 +                "total_cost": 967.41, 
 +                "total_cost_without_discount": 967.41, 
 +                "total_discount_price": "0.00", 
 +                "tracking": null, 
 +                "type": 10, 
 +                "type_display": "Best price", 
 +                "updated": "2019-08-05T19:22:13.069039", 
 +                "valid_until": "2019-09-04T19:22:13.069"
 +            }
 +        ], 
 +        "site_url": "https://mcule.com/quote/group/11647/", 
 +        "updated": "2019-08-05T19:22:13.063747"
 +    }, 
 +    "id": 15029, 
 +    "keep_original_salt_form": false, 
 +    "keep_original_stereo_form": false, 
 +    "keep_original_tautomer_form": false, 
 +    "max_combinations": 10000, 
 +    "max_time": 42, 
 +    "min_amount": null, 
 +    "min_combinations": 137, 
 +    "notes": "", 
 +    "original": null, 
 +    "package_consolidation": true, 
 +    "plate_source": null, 
 +    "plate_type": "", 
 +    "priority_cutoff": null, 
 +    "promo_code": "", 
 +    "purity": null, 
 +    "quote_staff_options": false, 
 +    "recalc_type": null, 
 +    "recalc_value": null, 
 +    "site_url": "https://mcule.com/quote/query/15029/", 
 +    "start_date": "2019-08-05T19:21:55.430800", 
 +    "state": 30, 
 +    "state_display": "Done", 
 +    "target_cc": null, 
 +    "target_volume": null, 
 +    "user": 11
 +}
 +</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 a "Special offer" quote.
 +
 +===== Quote API (Available soon...) =====
 +
 +In order to get the detailed data of an individual quote, you can query the following endpoint.
 +
 +<code>
 +http https://mcule.com/api/v1/iquotes/15677/ "Authorization: Token <your_token>" --print HBhb
 +</code>
 +
 +== Request: ===
 +<code>
 +GET /api/v1/iquotes/15677/ HTTP/1.1
 +Accept: */*
 +Accept-Encoding: gzip, deflate
 +Authorization: Token <your_token>
 +</code>
 +
 +== Response: ===
 +<code>
 +HTTP/1.1 200 OK
 +Allow: GET, HEAD, OPTIONS
 +Content-Encoding: gzip
 +Content-Type: application/json
 +
 +{
 +    "active": true, 
 +    "analytical_services_price": "0.00", 
 +    "api_url": "https://mcule.com/api/v1/iquotes/15677/", 
 +    "avg_product_price": 123.29, 
 +    "catalog_data": [
 +        {
 +            "catalog": 6, 
 +            "delivery_price": "86.95", 
 +            "delivery_time": 11, 
 +            "effective_price": "380.17", 
 +            "id": 90198, 
 +            "products_count": 3, 
 +            "products_price": "287.82", 
 +            "quote": 15677, 
 +            "reformatting_price": "0.00"
 +        }, 
 +        {
 +            "catalog": 156, 
 +            "delivery_price": "107.21", 
 +            "delivery_time": 10, 
 +            "effective_price": "144.45", 
 +            "id": 90197, 
 +            "products_count": 1, 
 +            "products_price": "35.18", 
 +            "quote": 15677, 
 +            "reformatting_price": "0.00"
 +        }, 
 +        {
 +            "catalog": 202, 
 +            "delivery_price": "117.00", 
 +            "delivery_time": 21, 
 +            "effective_price": "416.37", 
 +            "id": 90196, 
 +            "products_count": 1, 
 +            "products_price": "293.45", 
 +            "quote": 15677, 
 +            "reformatting_price": "0.00"
 +        }
 +    ], 
 +    "coverage_percent": 100, 
 +    "created": "2019-08-05T19:22:13.069027", 
 +    "delivery_days": 21, 
 +    "delivery_price": "311.16", 
 +    "description": "", 
 +    "discount": 0, 
 +    "duplicate_count": 0, 
 +    "extra_handling_price": "0.00", 
 +    "group": 11647, 
 +    "id": 15677, 
 +    "is_expired": false, 
 +    "is_saved": false, 
 +    "items": [
 +        {
 +            "amount": 1, 
 +            "id": 1740173, 
 +            "price": "144.45", 
 +            "product": 505393003, 
 +            "product_compound_mcule_id": "MCULE-1886826647", 
 +            "product_delivery_time": 6, 
 +            "product_external_id": "Q499", 
 +            "product_mcule_id": "P-505393003", 
 +            "product_price": "35.18", 
 +            "product_purity": 98, 
 +            "quote": 15677, 
 +            "raw_product_price": "25.00", 
 +            "structure_origin": 346255984, 
 +            "structure_origin_mcule_id": "MCULE-1886826647"
 +        }, 
 +        {
 +            "amount": 1, 
 +            "id": 1740172, 
 +            "price": "97.32", 
 +            "product": 346316287, 
 +            "product_compound_mcule_id": "MCULE-3906582667", 
 +            "product_delivery_time": 7, 
 +            "product_external_id": "Z1450413036", 
 +            "product_mcule_id": "P-346316287", 
 +            "product_price": "95.94", 
 +            "product_purity": 90, 
 +            "quote": 15677, 
 +            "raw_product_price": "73.80", 
 +            "structure_origin": 346316288, 
 +            "structure_origin_mcule_id": "MCULE-6824753328"
 +        }, 
 +        {
 +            "amount": 1, 
 +            "id": 1740171, 
 +            "price": "97.32", 
 +            "product": 346567071, 
 +            "product_compound_mcule_id": "MCULE-2221628462", 
 +            "product_delivery_time": 7, 
 +            "product_external_id": "Z1373424921", 
 +            "product_mcule_id": "P-346567071", 
 +            "product_price": "95.94", 
 +            "product_purity": 90, 
 +            "quote": 15677, 
 +            "raw_product_price": "73.80", 
 +            "structure_origin": 346567072, 
 +            "structure_origin_mcule_id": "MCULE-2221628462"
 +        }, 
 +        {
 +            "amount": 1, 
 +            "id": 1740170, 
 +            "price": "97.32", 
 +            "product": 346206264, 
 +            "product_compound_mcule_id": "MCULE-7223347867", 
 +            "product_delivery_time": 7, 
 +            "product_external_id": "Z2327039912", 
 +            "product_mcule_id": "P-346206264", 
 +            "product_price": "95.94", 
 +            "product_purity": 90, 
 +            "quote": 15677, 
 +            "raw_product_price": "73.80", 
 +            "structure_origin": 346206265, 
 +            "structure_origin_mcule_id": "MCULE-7223347867"
 +        }, 
 +        {
 +            "amount": 1, 
 +            "id": 1740169, 
 +            "price": "416.37", 
 +            "product": 580505383, 
 +            "product_compound_mcule_id": "MCULE-4609548851", 
 +            "product_delivery_time": 19, 
 +            "product_external_id": "X52967", 
 +            "product_mcule_id": "P-580505383", 
 +            "product_price": "293.45", 
 +            "product_purity": null, 
 +            "quote": 15677, 
 +            "raw_product_price": "225.73", 
 +            "structure_origin": 346209969, 
 +            "structure_origin_mcule_id": "MCULE-4609548851"
 +        }
 +    ], 
 +    "missing": [], 
 +    "name": "", 
 +    "order_data": null, 
 +    "payment_due_days": 30, 
 +    "po_number": null, 
 +    "price": "967.41", 
 +    "price_items": [
 +        {
 +            "attr": "product_discount", 
 +            "name": "Product discount (0%)", 
 +            "price": 0.0
 +        }, 
 +        {
 +            "attr": "delivery_price_final", 
 +            "name": "Shipping (from 3 suppliers to Mcule)", 
 +            "price": 311.16
 +        }, 
 +        {
 +            "attr": "shipping_price_final", 
 +            "name": "Shipping & package consolidation", 
 +            "price": 39.8
 +        }, 
 +        {
 +            "attr": "reformatting_price_final", 
 +            "name": "Reformatting", 
 +            "price": 0
 +        }, 
 +        {
 +            "attr": "analytical_services_price_final", 
 +            "name": "Analytical services", 
 +            "price": 0
 +        }, 
 +        {
 +            "attr": "extra_handling_price_final", 
 +            "name": "Extra handling", 
 +            "price": 0
 +        }, 
 +        {
 +            "attr": "total_discount_price", 
 +            "name": "Total discount (0%)", 
 +            "price": 0.0
 +        }
 +    ], 
 +    "product_discount_price": "0.00", 
 +    "products_price": "616.45", 
 +    "query": {
 +        "amount": 1, 
 +        "api_url": "https://mcule.com/api/v1/iquote-queries/15029/", 
 +        "created": "2019-08-05T19:21:55.339011", 
 +        "customer_email": "", 
 +        "customer_first_name": "John", 
 +        "customer_last_name": "Doe", 
 +        "deliver_multiple_salt_forms": false, 
 +        "delivery_address": "", 
 +        "delivery_city": "", 
 +        "delivery_contact_person_email": "", 
 +        "delivery_contact_person_name": "", 
 +        "delivery_contact_person_phone": "", 
 +        "delivery_country": "US", 
 +        "delivery_post_code": "", 
 +        "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", 
 +        "extra_amount": null, 
 +        "format": 0, 
 +        "group": 11647, 
 +        "id": 15029, 
 +        "keep_original_salt_form": false, 
 +        "keep_original_stereo_form": false, 
 +        "keep_original_tautomer_form": false, 
 +        "max_combinations": 10000, 
 +        "max_time": 42, 
 +        "min_amount": null, 
 +        "min_combinations": 137, 
 +        "notes": "", 
 +        "original": null, 
 +        "package_consolidation": true, 
 +        "plate_source": null, 
 +        "plate_type": "", 
 +        "priority_cutoff": null, 
 +        "promo_code": "", 
 +        "purity": null, 
 +        "quote_staff_options": false, 
 +        "recalc_type": null, 
 +        "recalc_value": null, 
 +        "site_url": "https://mcule.com/quote/query/15029/", 
 +        "start_date": "2019-08-05T19:21:55.430800", 
 +        "state": 30, 
 +        "state_display": "Done", 
 +        "target_cc": null, 
 +        "target_volume": null, 
 +        "user": 11
 +    }, 
 +    "reference_id_full": "I-15677", 
 +    "reformatting_price": "0.00", 
 +    "shipping_price": "39.80", 
 +    "site_url": "https://mcule.com/quote/I-15677/", 
 +    "special_formatting_price": null, 
 +    "state": 10, 
 +    "state_display": "Displayed", 
 +    "stock_with_amount_ratio": 0, 
 +    "supplier_data": [
 +        {
 +            "delivery_price": "86.95", 
 +            "delivery_time": 10, 
 +            "effective_price": "380.17", 
 +            "id": 69668, 
 +            "products_count": 3, 
 +            "products_price": "287.82", 
 +            "quote": 15677, 
 +            "reformatting_price": "0.00", 
 +            "supplier": 3, 
 +            "supplier_po_deadline_days": 19, 
 +            "supplier_po_handling_fee": "0.00", 
 +            "supplier_po_products_price": "221.40"
 +        }, 
 +        {
 +            "delivery_price": "107.21", 
 +            "delivery_time": 9, 
 +            "effective_price": "144.45", 
 +            "id": 69669, 
 +            "products_count": 1, 
 +            "products_price": "35.18", 
 +            "quote": 15677, 
 +            "reformatting_price": "0.00", 
 +            "supplier": 37, 
 +            "supplier_po_deadline_days": 19, 
 +            "supplier_po_handling_fee": "0.00", 
 +            "supplier_po_products_price": "25.00"
 +        }, 
 +        {
 +            "delivery_price": "117.00", 
 +            "delivery_time": 20, 
 +            "effective_price": "416.37", 
 +            "id": 69667, 
 +            "products_count": 1, 
 +            "products_price": "293.45", 
 +            "quote": 15677, 
 +            "reformatting_price": "0.00", 
 +            "supplier": 33, 
 +            "supplier_po_deadline_days": 19, 
 +            "supplier_po_handling_fee": "0.00", 
 +            "supplier_po_products_price": "225.73"
 +        }
 +    ], 
 +    "suppliers_count": 3, 
 +    "total_cost": 967.41, 
 +    "total_cost_without_discount": 967.41, 
 +    "total_discount_price": "0.00", 
 +    "tracking": null, 
 +    "type": 10, 
 +    "type_display": "Best price", 
 +    "updated": "2019-08-05T19:22:13.069039", 
 +    "valid_until": "2019-09-04T19:22:13.069"
 +}
 +</code>
 +
api.txt · Last modified: 2024/05/10 08:12 by bkovats