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
api [2021/09/14 21:32] flackapi [2023/06/03 07:19] (current) – [Quote Request API] flack
Line 48: Line 48:
     "results": [     "results": [
         {         {
-            "description": "All purchasablein stock virtual compounds",  +            "id": 1, 
-            "entry_count": 35772718+            "name": "Mcule Full", 
 +            "description": "Purchasable Mcule supplier ULTIMATE catalogs", 
 +            "entry_count": 40240579, 
 +            "last_updated": "2023-01-21",
             "files": [             "files": [
                 {                 {
-                    "download_url": "https://mcule.s3.amazonaws.com/database/mcule_purchasable_full_170918.sdf.gz",  +                    "size_mb": 9337
-                    "file_type": "sdf.gz",  +                    "file_type": "sdf.gz", 
-                    "file_type_display": "2D SDF (sdf.gz)",  +                    "file_type_display": "2D SDF (sdf.gz)", 
-                    "size_mb": 5762 +                    "download_url": "https://mcule.s3.amazonaws.com/database/mcule_purchasable_full_230121.sdf.gz" 
-                }, +                },
                 {                 {
-                    "download_url": "https://mcule.s3.amazonaws.com/database/mcule_purchasable_full_170918.smiles.gz",  +                    "size_mb": 513
-                    "file_type": "smiles.gz",  +                    "file_type": "smi.gz", 
-                    "file_type_display": "SMILES (smi.gz)",  +                    "file_type_display": "SMILES (smi.gz)", 
-                    "size_mb": 462+                    "download_url": "https://mcule.s3.amazonaws.com/database/mcule_purchasable_full_230121.smi.gz"
                 }                 }
-            ],  +            ], 
-            "last_updated": "2017-09-18",  +            "public": true
-            "name": "Mcule Purchasable (full)"+            "group": "default"
-            "public": true+
         },          }, 
         {         {
-            "description": "All purchasable, in stock compounds",  +            "id": 2, 
-            "entry_count": 5648837+            "name": "Mcule In Stock", 
 +            "description": "Purchasable Mcule supplier in stock catalogs", 
 +            "entry_count": 5790697, 
 +            "last_updated": "2023-01-20",
             "files": [             "files": [
                 {                 {
-                    "download_url": "https://mcule.s3.amazonaws.com/database/mcule_purchasable_in_stock_170918.sdf.gz",  +                    "size_mb": 1327
-                    "file_type": "sdf.gz",  +                    "file_type": "sdf.gz", 
-                    "file_type_display": "2D SDF (sdf.gz)",  +                    "file_type_display": "2D SDF (sdf.gz)", 
-                    "size_mb": 1311 +                    "download_url": "https://mcule.s3.amazonaws.com/database/mcule_purchasable_in_stock_230120.sdf.gz" 
-                }, +                },
                 {                 {
-                    "download_url": "https://mcule.s3.amazonaws.com/database/mcule_purchasable_in_stock_170918.smiles.gz",  +                    "size_mb": 85
-                    "file_type": "smiles.gz",  +                    "file_type": "smi.gz", 
-                    "file_type_display": "SMILES (smi.gz)",  +                    "file_type_display": "SMILES (smi.gz)", 
-                    "size_mb": 84+                    "download_url": "https://mcule.s3.amazonaws.com/database/mcule_purchasable_in_stock_230120.smi.gz"
                 }                 }
-            ],  +            ], 
-            "last_updated": "2017-09-18",  +            "public": true
-            "name": "Mcule Purchasable (in stock)"+            "group": "default"
-            "public": true+
         }         }
     ]     ]
Line 162: Line 166:
 ===== InChIKey lookup ===== ===== InChIKey lookup =====
 == Endpoint: == == Endpoint: ==
-<code>/lookup/<inchi_key></code>+<code>/lookup/inchikey/<inchi_key></code>
  
 == Example API request: == == Example API request: ==
Line 585: Line 589:
  
 Fields: Fields:
-  * **mcule_ids**: Required. List of mcule IDs. Only compound level mcule IDs are accepted, e.g.: MCULE-7655747555. Mcule IDs that represent other structure levels (e.g. MCULE-7655747555-0, MCULE-7655747555-0-0, P-611592727) are not accepted.+  * **mcule_ids**: Required. List of mcule IDs. Only compound level mcule IDs are accepted, e.g.: MCULE-7655747555. Mcule IDs that represent other [[structurelevels|structure levels]] (e.g. MCULE-7655747555-0, MCULE-7655747555-0-0, P-611592727) are not accepted.
   * **availability**: Optional. Default: false. Whether to return availability information in the response. If you don't need this information you can set it to false (or just leave it out from the request) in order to get a quicker response. Collecting this information can take some time.    * **availability**: Optional. Default: false. Whether to return availability information in the response. If you don't need this information you can set it to false (or just leave it out from the request) in order to get a quicker response. Collecting this information can take some time. 
   * **components**: Optional. Default: true. Whether to return components information in the response in case the compound has multiple components. If you don't need this information you can set it to false in order to get a slightly quicker response.    * **components**: Optional. Default: true. Whether to return components information in the response in case the compound has multiple components. If you don't need this information you can set it to false in order to get a slightly quicker response. 
Line 591: Line 595:
  
 Limits: Limits:
-  * **mcule_ids**: The size of this list is limited to 500. If you specify the *price_amounts* field the limit is reduced to 100 since collecting pricing information is an expensive operation.+  * **mcule_ids**: The size of this list is limited to 500. If you specify the **price_amounts** field the limit is reduced to 100 since collecting pricing information is an expensive operation.
   * **price_amounts**: The size of this list is limited to 5.    * **price_amounts**: The size of this list is limited to 5. 
  
Line 841: Line 845:
 </code> </code>
  
-The **threshold** field accepts values between 0.7 and 1.0the default is 0.9.+Mandatory fields: 
 + 
 +    * **query**: stringaccepted identifiers: mcule ID, SMILES. 
 + 
 +Optional fields:
  
-The **limit** field accepts values between 1 and 1000, the default is 100.+    * **threshold**: float, similarity threshold, accepted values between 0.7 and 1.0, default: 0.9 
 +    * **limit**: integer, accepted values between 1 and 1000, default100 
 +    * **collection**: string, accepted values: "full", "in_stock", default: "full". If you specify "in_stock" the search will be performed on the Mcule Purchasable (In Stock) collection which means that Virtual /  Potentially purchasable (60-80%) compounds will be excluded from the hits.
  
  
Line 909: Line 919:
 </code> </code>
  
-The **limit** field accepts values between 1 and 1000, the default is 100.+Mandatory fields: 
 + 
 +    * **query**: string, accepted identifiers: mcule ID, SMILES. 
 + 
 +Optional fields: 
 + 
 +    * **limit**: integer, accepted values between 1 and 1000, default100 
 +    * **collection**: string, accepted values: "full", "in_stock", default: "full". If you specify "in_stock" the search will be performed on the Mcule Purchasable (In Stock) collection which means that Virtual /  Potentially purchasable (60-80%) compounds will be excluded from the hits.
  
  
Line 1057: Line 1074:
   * **amount**: Preferred amount per molecule (mg). (default: 1)   * **amount**: Preferred amount per molecule (mg). (default: 1)
   * **min_amount**: Acceptable minimum amount (mg). (default: null)   * **min_amount**: Acceptable minimum amount (mg). (default: null)
-  * **target_volume**: The target volume (in ml), in case of solution based amount.+  * **target_volume**: The target volume (in µL), in case of solution based amount.
   * **target_cc**: Target concentration (mM), 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 the preferred extra amount (in mg) can be specified here.   * **extra_amount**: In case of solution based amount calculation the preferred extra amount (in mg) can be specified here.
Line 1066: Line 1083:
   * **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)   * **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.
 +  * **scheme**: If you have access to predefined / pre-negotiated quote request schemes, you can specify here which one you want to use. You have to send the ID of the scheme which will be provided to you after negotiation. A quote query scheme is essentially a template that contains predefined quote query parameters, or even include private parameters that affect quote generation in various ways (e.g.: discounts, predefined custom prices). These parameters can be customized for your use case. The scheme might already contain mandatory fields like delivery_country. In this case you don't have to specify them again, they will be applied from the scheme. Any explicitly specified public parameter during the request will override the one that comes from the specified scheme. 
  
 The **amount** or target concentration-volume pair (**target_volume** and **target_cc**) need to be specified. The **amount** or target concentration-volume pair (**target_volume** and **target_cc**) need to be specified.
Line 1129: Line 1147:
     "delivery_contact_person_name": "",      "delivery_contact_person_name": "", 
     "delivery_contact_person_phone": "",      "delivery_contact_person_phone": "", 
-    "delivery_country": "US", +    "delivery_country": "US", 
 +    "delivery_format_display": "Dry powder/film in supplier vial", 
     "delivery_post_code": "",      "delivery_post_code": "", 
     "delivery_time": 21,      "delivery_time": 21, 
Line 1199: Line 1218:
     "delivery_contact_person_phone": "",      "delivery_contact_person_phone": "", 
     "delivery_country": "US",      "delivery_country": "US", 
 +    "delivery_format_display": "Dry powder/film in supplier vial", 
     "delivery_post_code": "",      "delivery_post_code": "", 
     "delivery_time": 21,      "delivery_time": 21, 
Line 1376: Line 1396:
  
 { {
 +    "additional_document_notes": "",
 +    "amount_range": [1, 1],
 +    "amount_range_display": "1",
     "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 1439: Line 1462:
             "price": "144.45",              "price": "144.45", 
             "product": 505393003,             "product": 505393003,
 +            "product_available_amount": null,
 +            "product_available_amount_display": "In stock",
             "product_catalog_id": 156,             "product_catalog_id": 156,
             "product_catalog_name": "Building Blocks",              "product_catalog_name": "Building Blocks", 
Line 1445: Line 1470:
             "product_price": "35.18",              "product_price": "35.18", 
             "product_purity": 98,              "product_purity": 98, 
 +            "product_smiles": "CCC(NCC[C@H]1C2=C(C=CC3=C2CCO3)CC1)=O",
             "product_supplier_id": 37,             "product_supplier_id": 37,
             "product_supplier_name": "AK Scientific",             "product_supplier_name": "AK Scientific",
Line 1456: Line 1482:
             "id": 1740172,              "id": 1740172, 
             "price": "97.32",              "price": "97.32", 
 +            "product": 346316287, 
 +            "product_available_amount": null,
 +            "product_available_amount_display": "In stock",
             "product_catalog_id": 6,             "product_catalog_id": 6,
             "product_catalog_name": "Advanced Collection",             "product_catalog_name": "Advanced Collection",
-            "product": 346316287,  
             "product_compound_mcule_id": "MCULE-3906582667",              "product_compound_mcule_id": "MCULE-3906582667", 
             "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_smiles": "CC1N(C(C2NCCC2)=O)CC(C2=C(C)C=CC=C2)C1.Cl",
             "product_supplier_id": 3,             "product_supplier_id": 3,
             "product_supplier_name": "Enamine",             "product_supplier_name": "Enamine",
Line 1475: Line 1504:
             "price": "97.32",              "price": "97.32", 
             "product": 346567071,              "product": 346567071, 
 +            "product_available_amount": null,
 +            "product_available_amount_display": "In stock",
             "product_catalog_id": 6,             "product_catalog_id": 6,
             "product_catalog_name": "Advanced Collection",             "product_catalog_name": "Advanced Collection",
Line 1481: Line 1512:
             "product_price": "95.94",              "product_price": "95.94", 
             "product_purity": 90,              "product_purity": 90, 
 +            "product_smiles": "FC1=C(N2CC3=C(C=CC=C3)OCC2)N=CC=C1",
             "product_supplier_id": 3,             "product_supplier_id": 3,
             "product_supplier_name": "Enamine",             "product_supplier_name": "Enamine",
Line 1493: Line 1525:
             "price": "97.32",              "price": "97.32", 
             "product": 346206264,              "product": 346206264, 
 +            "product_available_amount": null,
 +            "product_available_amount_display": "In stock",
             "product_catalog_id": 6,             "product_catalog_id": 6,
             "product_catalog_name": "Advanced Collection",             "product_catalog_name": "Advanced Collection",
Line 1499: Line 1533:
             "product_price": "95.94",              "product_price": "95.94", 
             "product_purity": 90,             "product_purity": 90,
 +            "product_smiles": "OC(C1(C2=C(C(F)(F)F)C=CC=C2)CC1)=O",
             "product_supplier_id": 3,             "product_supplier_id": 3,
             "product_supplier_name": "Enamine",              "product_supplier_name": "Enamine", 
Line 1511: Line 1546:
             "price": "416.37",              "price": "416.37", 
             "product": 580505383,              "product": 580505383, 
 +            "product_available_amount": null,
 +            "product_available_amount_display": "Potentially purchasable (60-80%)",
             "product_catalog_id": 202,             "product_catalog_id": 202,
             "product_catalog_name": "Compounds on demand",             "product_catalog_name": "Compounds on demand",
Line 1517: Line 1554:
             "product_price": "293.45",              "product_price": "293.45", 
             "product_purity": null,              "product_purity": null, 
 +            "product_smiles": "OC(C1(C2=C(C(F)(F)F)C=CC=C2)CC1)=O",
             "product_supplier_id": 33,             "product_supplier_id": 33,
             "product_supplier_name": "Manchester Organics",             "product_supplier_name": "Manchester Organics",
Line 1582: Line 1620:
         "delivery_contact_person_phone": "",          "delivery_contact_person_phone": "", 
         "delivery_country": "US",          "delivery_country": "US", 
 +        "delivery_format_display": "Dry powder/film in supplier vial",
         "delivery_post_code": "",          "delivery_post_code": "", 
         "delivery_time": 21,          "delivery_time": 21, 
Line 1673: Line 1712:
 Where currency is not specified, it is always USD. Where currency is not specified, it is always USD.
  
 +  * **additional_document_notes**: additional document notes if there are any
 +  * **amount_range**: Amount / product (mg), min - max product amounts as a list
 +  * **amount_range_display**: Amount / product (mg) as string
   * **analytical_services_price**: price of analytical services (USD)   * **analytical_services_price**: price of analytical services (USD)
   * **avg_product_price**: Average product price (USD)   * **avg_product_price**: Average product price (USD)
Line 1696: Line 1738:
     * **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     * **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     * **price**: effective price
 +    * **product_available_amount**: concrete available amount (mg) data if available,
 +    * **product_available_amount_display**: availability display, e.g.: In stock, Potentially purchasable (60-80%),
     * **product_mcule_id**: The mcule ID of the quoted product.     * **product_mcule_id**: The mcule ID of the quoted product.
     * **product**: The ID of the quoted product (should be neglected).     * **product**: The ID of the quoted product (should be neglected).
Line 1702: Line 1746:
     * **product_price**: Product price (USD)     * **product_price**: Product price (USD)
     * **product_purity**: Minimum purity (%)     * **product_purity**: Minimum purity (%)
 +    * **product_smiles**: SMILES of the product
     * **structure_origin_mcule_id**: The mcule ID of the query molecule.     * **structure_origin_mcule_id**: The mcule ID of the query molecule.
     * **quote**: The ID of the quote this product level quote data belongs to.     * **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.   * **name**: The name of the quote. Quotes created via the API don't have names.
-  * **order_data**: Order data. (Should be neglected).+  * **order_data**: If the quote has been ordered, data related to the purchase order is provided here. 
 +    * **billing_address**: Billing address 
 +    * **billing_city**: Billing city 
 +    * **billing_company_name**: Billing Institution / Company name 
 +    * **billing_country**: Billing country 
 +    * **billing_post_code**: Billing ZIP / Post code 
 +    * **billing_state**: Billing State / Province 
 +    * **billing_email**: Billing contact email 
 +    * **billing_first_name**: Billing contact first name 
 +    * **billing_last_name**: Billing contact last name 
 +    * **billing_phone**: Billing contact phone number 
 +    * **billing_same**: Whether the billing data is the same is shipping data 
 +    * **billing_vat**: Billing VAT number 
 +    * **shipping_address**: Shipping address 
 +    * **shipping_city**: shipping city 
 +    * **shipping_company_name**: Shipping Institution / Company name 
 +    * **shipping_country**: Shipping country 
 +    * **shipping_post_code**: Shipping ZIP / Post code 
 +    * **shipping_state**: Shipping State / Province 
 +    * **shipping_email**: Shipping contact email 
 +    * **shipping_first_name**: Shipping contact first name 
 +    * **shipping_last_name**: Shipping contact last name 
 +    * **shipping_phone**: Shipping contact phone number 
 +    * **notes**: notes 
 +    * **po_number**: Customer Purchase Order number 
 +    * **po_file_filename**: In case a Purchase Order file was submitted, the name of the filename. 
 +    * **po_option**: Purchase Order option (10: Upload PO, 20: Order without PO, 30: Send PO later) 
 +    * **po_option_display**: Purchase Order option as string 
 +    * **created**: Datetime when the purchase order was submitted 
 +    * **updated**: Datetime when the purchase order data was updated 
 +    * **id**: ID of the purchase order data
   * **payment_due_days**: Payment terms. Number of days net or prepayment by credit card   * **payment_due_days**: Payment terms. Number of days net or prepayment by credit card
   * **price**: Total price of quote (USD)   * **price**: Total price of quote (USD)
Line 1802: Line 1877:
 </code> </code>
  
 +
 +===== Quote order =====
 +
 +Submit purchase order for a quote via API.
 +
 +<code>
 +http --form POST https://mcule.com/api/v1/iquotes/15677/order/ po_option=10 po_file@~/po.pdf "Authorization: Token <your_token>" --print HBhb
 +</code>
 +
 +== Example request: ===
 +<code>
 +POST /api/v1/iquotes/15677/order/ HTTP/1.1
 +Accept: */*
 +Accept-Encoding: gzip, deflate
 +Authorization: Token <your_token>
 +Content-Type: multipart/form-data; boundary=b582e4472c434fd6b30b265ffef125e8
 +
 ++-----------------------------------------+
 +| NOTE: binary data not shown in terminal |
 ++-----------------------------------------+
 +</code>
 +
 +Please note that in case you submit a file in the API request, you have to use //Content-Type: multipart/form-data// as you can see at the above request.
 +
 +If you don't submit a file in the API request, you can use //Content-Type: application/json// :
 +
 +<code>
 +echo '{"po_option": 20, "shipping_country": "US", "shipping_first_name": "John", "shipping_last_name": "Doe"}' | http https://mcule.com/api/v1/iquotes/15677/order/ "Authorization: Token <your_token>" --print HBhb
 +</code>
 +
 +== Example request: ===
 +<code>
 +POST /api/v1/iquotes/15677/order/ HTTP/1.1
 +Accept: application/json, */*
 +Authorization: Token <your_token>
 +Content-Type: application/json
 +{
 +    "po_option": 20,
 +    "shipping_country": "US",
 +    "shipping_first_name": "John",
 +    "shipping_last_name": "Doe"
 +}
 +</code>
 +
 +== Example response: ===
 +<code>
 +HTTP/1.0 201 CREATED
 +Allow: POST, OPTIONS
 +Content-Type: application/json
 +
 +{
 +    "billing_address": "",
 +    "billing_city": "",
 +    "billing_company_name": "",
 +    "billing_country": "",
 +    "billing_email": "",
 +    "billing_first_name": "",
 +    "billing_last_name": "",
 +    "billing_phone": "",
 +    "billing_post_code": "",
 +    "billing_same": true,
 +    "billing_state": "",
 +    "billing_vat": "",
 +    "created": "2022-04-29T17:02:09.257359",
 +    "id": 3691,
 +    "notes": "",
 +    "po_file_filename": "",
 +    "po_number": "",
 +    "po_option": 20,
 +    "po_option_display": "Order without PO",
 +    "shipping_address": "",
 +    "shipping_city": "",
 +    "shipping_company_name": "",
 +    "shipping_country": "US",
 +    "shipping_email": "",
 +    "shipping_first_name": "John",
 +    "shipping_last_name": "Doe",
 +    "shipping_phone": "",
 +    "shipping_post_code": "",
 +    "shipping_state": "",
 +    "updated": "2022-04-29T17:02:09.257373"
 +}
 +</code>
 +
 +
 +Mandatory fields:
 +    * **po_option**: Purchase Order option (10: Upload PO, 20: Order without PO, 30: Send PO later)
 +
 +Optional fields:
 +    * **billing_address**: Billing address
 +    * **billing_city**: Billing city
 +    * **billing_company_name**: Billing Institution / Company name
 +    * **billing_country**: Billing country
 +    * **billing_post_code**: Billing ZIP / Post code
 +    * **billing_state**: Billing State / Province
 +    * **billing_email**: Billing contact email
 +    * **billing_first_name**: Billing contact first name
 +    * **billing_last_name**: Billing contact last name
 +    * **billing_phone**: Billing contact phone number
 +    * **billing_same**: Whether the billing data is the same as shipping data
 +    * **billing_vat**: Billing VAT number
 +    * **shipping_address**: Shipping address
 +    * **shipping_city**: Shipping city
 +    * **shipping_company_name**: Shipping Institution / Company name
 +    * **shipping_country**: Shipping country
 +    * **shipping_post_code**: Shipping ZIP / Post code
 +    * **shipping_state**: Shipping State / Province
 +    * **shipping_email**: Shipping contact email
 +    * **shipping_first_name**: Shipping contact first name
 +    * **shipping_last_name**: Shipping contact last name
 +    * **shipping_phone**: Shipping contact phone number
 +    * **notes**: notes
 +    * **po_number**: Customer Purchase Order number
 +    * **po_file**: Purchase Order document file.
 +
 +The address and contact fields are optional if this information is included in the Purchase Order document or will be provided later to our support team. Although providing the shipping and billing address / contact information here can speed up the ordering process, if you decide to leave them empty, our support team will contact you to reconcile this information. 
 +
 +Subsequent calls to this same endpoint make it possible to update the purchase order information. You can also report incorrect data at order@mcule.com. Please make sure you reference the quote's Full reference ID (**reference_id_full** field in the corresponding API response) in your email.
  
  
api.1631655163.txt.gz · Last modified: 2021/09/14 21:32 by flack