api
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
api [2019/08/22 11:10] – flack | api [2023/05/23 18:29] – [Substructure search] flack | ||
---|---|---|---|
Line 1: | Line 1: | ||
API base url: https:// | API base url: https:// | ||
- | Examples are demonstrated with [[https:// | + | Examples are demonstrated with [[https:// |
+ | |||
+ | Only the most important request/ | ||
====== Response status codes ====== | ====== Response status codes ====== | ||
Line 46: | Line 48: | ||
" | " | ||
{ | { | ||
- | "description": "All purchasable, in stock & virtual compounds", | + | "id": |
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
{ | { | ||
- | "download_url": | + | "size_mb": |
- | " | + | " |
- | " | + | " |
- | "size_mb": | + | "download_url": |
- | }, | + | }, |
{ | { | ||
- | "download_url": | + | "size_mb": |
- | " | + | " |
- | " | + | " |
- | "size_mb": | + | "download_url": |
} | } | ||
- | ], | + | ], |
- | "last_updated": | + | "public": |
- | "name": "Mcule Purchasable (full)" | + | "group": "default" |
}, | }, | ||
{ | { | ||
- | "description": "All purchasable, in stock compounds", | + | "id": |
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
{ | { | ||
- | "download_url": | + | "size_mb": |
- | " | + | " |
- | " | + | " |
- | "size_mb": | + | "download_url": |
- | }, | + | }, |
{ | { | ||
- | "download_url": | + | "size_mb": |
- | " | + | " |
- | " | + | " |
- | "size_mb": | + | "download_url": |
} | } | ||
- | ], | + | ], |
- | "last_updated": | + | "public": |
- | "name": "Mcule Purchasable (in stock)" | + | "group": "default" |
} | } | ||
] | ] | ||
} | } | ||
</ | </ | ||
+ | |||
+ | If you call this API endpoint as an authenticated user (=you provide a [[api# | ||
Line 156: | Line 166: | ||
===== InChIKey lookup ===== | ===== InChIKey lookup ===== | ||
== Endpoint: == | == Endpoint: == | ||
- | < | + | < |
== Example API request: == | == Example API request: == | ||
Line 229: | Line 239: | ||
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 |
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 246: | ||
</ | </ | ||
+ | Example: | ||
+ | < | ||
+ | Authorization: | ||
+ | </ | ||
+ | |||
+ | If you have a valid access token you can check it on the [[https:// | ||
====== Protected API endpoints ====== | ====== Protected API endpoints ====== | ||
Line 333: | Line 349: | ||
http ' | http ' | ||
</ | </ | ||
+ | |||
+ | |||
+ | ===== Compound list details ===== | ||
+ | |||
+ | With this endpoint you can get compound details information for multiple compound mcule IDs in a single API call. | ||
+ | |||
+ | == Endpoint: == | ||
+ | < | ||
+ | |||
+ | == Basic API request: == | ||
+ | < | ||
+ | echo ' | ||
+ | </ | ||
+ | |||
+ | |||
+ | == Example API request: == | ||
+ | < | ||
+ | echo ' | ||
+ | </ | ||
+ | |||
+ | == Request: == | ||
+ | < | ||
+ | POST / | ||
+ | Authorization: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ], | ||
+ | " | ||
+ | 1, | ||
+ | 5, | ||
+ | 10 | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | == Response: == | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Fields: | ||
+ | * **mcule_ids**: | ||
+ | * **availability**: | ||
+ | * **components**: | ||
+ | * **price_amounts**: | ||
+ | |||
+ | Limits: | ||
+ | * **mcule_ids**: | ||
+ | * **price_amounts**: | ||
+ | |||
===== Multiple queries exact search ===== | ===== Multiple queries exact search ===== | ||
Multiple queries exact search currently accepts the following input identifiers: | Multiple queries exact search currently accepts the following input identifiers: | ||
+ | The maximum number of queries you can send to this endpoint is 1000 currently. | ||
== Endpoint: == | == Endpoint: == | ||
Line 375: | Line 641: | ||
" | " | ||
{ | { | ||
- | " | + | " |
- | " | + | " |
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | }, | + | }, |
{ | { | ||
- | " | + | " |
- | " | + | " |
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | }, | + | }, |
{ | { | ||
- | " | + | " |
- | " | + | " |
- | "smiles": " | + | " |
- | " | + | " |
- | }, | + | "query": " |
+ | " | ||
+ | " | ||
+ | }, | ||
{ | { | ||
- | " | + | " |
- | " | + | " |
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
} | } | ||
Line 401: | Line 679: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | Please note that in case the queries are InChIKeys, **matching_level** and **matching_level_display** will always be **null** in the response. | ||
===== Multiple queries exact search with availability ===== | ===== Multiple queries exact search with availability ===== | ||
Line 441: | Line 721: | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
" | " | ||
- | }, | + | }, |
- | " | + | " |
- | " | + | " |
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | }, | + | }, |
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
" | " | ||
- | }, | + | }, |
- | " | + | " |
- | " | + | " |
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | }, | + | }, |
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
" | " | ||
- | }, | + | }, |
- | " | + | " |
- | " | + | " |
- | "smiles": " | + | " |
- | " | + | " |
- | }, | + | "query": " |
+ | " | ||
+ | " | ||
+ | }, | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
" | " | ||
- | }, | + | }, |
- | " | + | " |
- | " | + | " |
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
} | } | ||
] | ] | ||
- | } | + | } |
</ | </ | ||
+ | Please note that in case the queries are InChIKeys, **matching_level** and **matching_level_display** will always be **null** in the response. | ||
- | ===== Quote Request API ===== | ||
- | Available soon... | + | ===== Similarity search ===== |
+ | Similarity search currently accepts the following input identifiers: | ||
+ | |||
+ | == Endpoint: == | ||
+ | < | ||
+ | |||
+ | == Example API request: == | ||
+ | < | ||
+ | echo ' | ||
+ | </ | ||
+ | |||
+ | or | ||
+ | |||
+ | < | ||
+ | echo ' | ||
+ | </ | ||
+ | |||
+ | == Request: == | ||
+ | < | ||
+ | POST / | ||
+ | Accept: application/ | ||
+ | Accept-Encoding: | ||
+ | Authorization: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | == Response: == | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: POST, OPTIONS | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Mandatory fields: | ||
+ | |||
+ | * **query**: string, accepted identifiers: | ||
+ | |||
+ | Optional fields: | ||
+ | |||
+ | * **threshold**: | ||
+ | * **limit**: integer, accepted values between 1 and 1000, default: 100 | ||
+ | * **collection**: | ||
+ | |||
+ | |||
+ | ===== Substructure search ===== | ||
+ | Substructure search currently accepts the following input identifiers: | ||
+ | |||
+ | == Endpoint: == | ||
+ | < | ||
+ | |||
+ | == Example API request: == | ||
+ | < | ||
+ | echo ' | ||
+ | </ | ||
+ | |||
+ | == Request: == | ||
+ | < | ||
+ | POST / | ||
+ | Accept: application/ | ||
+ | Accept-Encoding: | ||
+ | Authorization: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | == Response: == | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: POST, OPTIONS | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Mandatory fields: | ||
+ | |||
+ | * **query**: string, accepted identifiers: | ||
+ | |||
+ | Optional fields: | ||
+ | |||
+ | * **limit**: integer, accepted values between 1 and 1000, default: 100 | ||
+ | * **collection**: | ||
+ | |||
+ | |||
+ | ===== Compound suppliers public API ===== | ||
+ | |||
+ | You can get some very basic (public) information about our compound suppliers with this API. | ||
+ | |||
+ | == Endpoint: == | ||
+ | < | ||
+ | |||
+ | == Example API request: == | ||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | == Example request: === | ||
+ | < | ||
+ | GET / | ||
+ | Accept: */* | ||
+ | Accept-Encoding: | ||
+ | Authorization: | ||
+ | </ | ||
+ | |||
+ | == Example response: === | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: GET, HEAD, OPTIONS | ||
+ | Connection: keep-alive | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | |||
+ | ... | ||
+ | |||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | The detail API endpoint is also available on this endpoint: | ||
+ | < | ||
+ | |||
+ | 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: == | ||
+ | < | ||
+ | |||
+ | == Example API request: == | ||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | == Example request: === | ||
+ | < | ||
+ | GET / | ||
+ | Accept: */* | ||
+ | Accept-Encoding: | ||
+ | Authorization: | ||
+ | Connection: keep-alive | ||
+ | </ | ||
+ | |||
+ | == Example response: === | ||
+ | < | ||
+ | HTTP/1.1 200 OK | ||
+ | Allow: GET, HEAD, OPTIONS | ||
+ | Connection: keep-alive | ||
+ | Content-Encoding: | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | |||
+ | ... | ||
+ | |||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | The detail API endpoint is also available on this endpoint: | ||
+ | < | ||
+ | |||
+ | It will return a similar response as the above one but for an individual compound catalog. | ||
+ | |||
+ | |||
+ | |||
+ | ===== Quote Request API ===== | ||
== Endpoint: == | == Endpoint: == | ||
Line 501: | Line 1065: | ||
Mandatory fields: | Mandatory fields: | ||
- | * **mcule_ids**: | + | * **mcule_ids**: |
- | * **customer_first_name**: | + | * **customer_first_name**: |
- | * **customer_last_name**: | + | * **customer_last_name**: |
- | * **delivery_country**: | + | * **delivery_country**: |
Optional fields: | Optional fields: | ||
* **amount**: Preferred amount per molecule (mg). (default: 1) | * **amount**: Preferred amount per molecule (mg). (default: 1) | ||
- | * **min_amount**: | + | * **min_amount**: |
* **target_volume**: | * **target_volume**: | ||
* **target_cc**: | * **target_cc**: | ||
- | * **extra_amount**: | + | * **extra_amount**: |
- | * **customer_email**: | + | * **min_extra_amount**: |
- | * **delivery_time**: | + | * **customer_email**: |
+ | * **delivery_time**: | ||
* **purity**: Required minimum purity (%). (default: null) | * **purity**: Required minimum purity (%). (default: null) | ||
+ | * **higher_amounts**: | ||
+ | * **item_filters**: | ||
+ | * **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. | ||
+ | |||
+ | **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# | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
Advanced optional fields: | Advanced optional fields: | ||
Line 522: | Line 1101: | ||
* **keep_original_tautomer_form**: | * **keep_original_tautomer_form**: | ||
* **keep_original_stereo_form**: | * **keep_original_stereo_form**: | ||
- | * **deliver_multiple_salt_forms**: | + | * **deliver_multiple_salt_forms**: |
- | == Request: === | + | == Example request: === |
< | < | ||
POST / | POST / | ||
Line 549: | Line 1128: | ||
</ | </ | ||
- | == Response: === | + | == Example response: === |
< | < | ||
HTTP/1.1 201 CREATED | HTTP/1.1 201 CREATED | ||
Line 568: | Line 1147: | ||
" | " | ||
" | " | ||
- | " | + | " |
+ | " | ||
" | " | ||
" | " | ||
" | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 595: | Line 1174: | ||
===== Quote Request Status API ===== | ===== Quote Request Status API ===== | ||
- | Available soon... | + | Since processing |
- | + | ||
- | Since generating | + | |
States: | States: | ||
Line 610: | Line 1187: | ||
</ | </ | ||
- | == Request: === | + | == Example request: === |
< | < | ||
Line 619: | Line 1196: | ||
</ | </ | ||
- | == Response: === | + | == Example response: === |
< | < | ||
HTTP/1.1 200 OK | HTTP/1.1 200 OK | ||
Line 641: | Line 1218: | ||
" | " | ||
" | " | ||
+ | " | ||
" | " | ||
" | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
" | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 656: | Line 1228: | ||
" | " | ||
{ | { | ||
- | " | ||
" | " | ||
" | " | ||
Line 672: | Line 1243: | ||
" | " | ||
" | " | ||
- | " | ||
- | 346209969 | ||
- | ], | ||
" | " | ||
" | " | ||
Line 694: | Line 1262: | ||
" | " | ||
" | " | ||
- | " | ||
" | " | ||
- | " | + | " |
" | " | ||
" | " | ||
}, | }, | ||
{ | { | ||
- | " | ||
" | " | ||
" | " | ||
Line 717: | Line 1283: | ||
" | " | ||
" | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 737: | Line 1302: | ||
" | " | ||
" | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 744: | Line 1308: | ||
}, | }, | ||
{ | { | ||
- | " | ||
" | " | ||
" | " | ||
Line 760: | Line 1323: | ||
" | " | ||
" | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 794: | Line 1356: | ||
" | " | ||
" | " | ||
- | " | ||
- | " | ||
" | " | ||
- | " | ||
" | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
- | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 819: | Line 1370: | ||
</ | </ | ||
- | As you can see from the result we could generate 3 different quotes for the query. A "Best price" quote, a " | + | Check for the **group** field. If it is not null, we could generate some quotes for your quote query. |
===== Quote API ===== | ===== Quote API ===== | ||
- | Available soon... | + | In order to get the detailed data of an individual quote, you can call the detail API endpoint |
- | + | ||
- | In order to get the detailed data of an individual quote, you can query the following | + | |
< | < | ||
Line 831: | Line 1380: | ||
</ | </ | ||
- | == Request: === | + | == Example request: === |
< | < | ||
GET / | GET / | ||
Line 839: | Line 1388: | ||
</ | </ | ||
- | == Response: === | + | == Example response: === |
< | < | ||
HTTP/1.1 200 OK | HTTP/1.1 200 OK | ||
Line 847: | Line 1396: | ||
{ | { | ||
- | "active": | + | "additional_document_notes": |
+ | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 853: | Line 1404: | ||
" | " | ||
{ | { | ||
+ | " | ||
" | " | ||
" | " | ||
" | " | ||
- | " | + | " |
+ | " | ||
" | " | ||
" | " | ||
Line 864: | Line 1417: | ||
}, | }, | ||
{ | { | ||
+ | " | ||
" | " | ||
" | " | ||
" | " | ||
" | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 875: | Line 1430: | ||
}, | }, | ||
{ | { | ||
+ | " | ||
" | " | ||
" | " | ||
" | " | ||
" | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 901: | Line 1458: | ||
{ | { | ||
" | " | ||
+ | " | ||
" | " | ||
" | " | ||
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 917: | Line 1479: | ||
{ | { | ||
" | " | ||
+ | " | ||
" | " | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 933: | Line 1500: | ||
{ | { | ||
" | " | ||
+ | " | ||
" | " | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 949: | Line 1521: | ||
{ | { | ||
" | " | ||
+ | " | ||
" | " | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
- | " | + | " |
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 965: | Line 1542: | ||
{ | { | ||
" | " | ||
+ | " | ||
" | " | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
" | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
" | " | ||
- | " | ||
" | " | ||
" | " | ||
} | } | ||
], | ], | ||
- | " | ||
" | " | ||
" | " | ||
Line 1039: | Line 1620: | ||
" | " | ||
" | " | ||
+ | " | ||
" | " | ||
" | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
" | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 1053: | Line 1629: | ||
" | " | ||
" | " | ||
- | " | ||
- | " | ||
" | " | ||
- | " | ||
" | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
- | " | ||
- | " | ||
- | " | ||
" | " | ||
" | " | ||
Line 1089: | Line 1654: | ||
" | " | ||
" | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 1103: | Line 1669: | ||
" | " | ||
" | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 1117: | Line 1684: | ||
" | " | ||
" | " | ||
+ | " | ||
" | " | ||
" | " | ||
Line 1139: | Line 1707: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | == Fields: === | ||
+ | |||
+ | Where currency is not specified, it is always USD. | ||
+ | |||
+ | * **additional_document_notes**: | ||
+ | * **amount_range**: | ||
+ | * **amount_range_display**: | ||
+ | * **analytical_services_price**: | ||
+ | * **avg_product_price**: | ||
+ | * **catalog_data**: | ||
+ | * **products_count**: | ||
+ | * **products_price**: | ||
+ | * **effective_price_display**: | ||
+ | * **avg_effective_price**: | ||
+ | * **delivery_time**: | ||
+ | * **quote**: The ID of the quote this catalog level quote data belongs to. | ||
+ | * **coverage_percent**: | ||
+ | * **created**: | ||
+ | * **delivery_days**: | ||
+ | * **delivery_price**: | ||
+ | * **duplicate_count**: | ||
+ | * **extra_handling_price**: | ||
+ | * **group**: | ||
+ | * **id**: The ID of the Instant Quote. | ||
+ | * **is_expired**: | ||
+ | * **is_saved**: | ||
+ | * **items**: list of product level data | ||
+ | * **amount**: Quoted amount (mg) | ||
+ | * **effective_price_display**: | ||
+ | * **price**: effective price | ||
+ | * **product_available_amount**: | ||
+ | * **product_available_amount_display**: | ||
+ | * **product_mcule_id**: | ||
+ | * **product**: | ||
+ | * **product_compound_mcule_id**: | ||
+ | * **product_delivery_time**: | ||
+ | * **product_price**: | ||
+ | * **product_purity**: | ||
+ | * **product_smiles**: | ||
+ | * **structure_origin_mcule_id**: | ||
+ | * **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**: | ||
+ | * **billing_address**: | ||
+ | * **billing_city**: | ||
+ | * **billing_company_name**: | ||
+ | * **billing_country**: | ||
+ | * **billing_post_code**: | ||
+ | * **billing_state**: | ||
+ | * **billing_email**: | ||
+ | * **billing_first_name**: | ||
+ | * **billing_last_name**: | ||
+ | * **billing_phone**: | ||
+ | * **billing_same**: | ||
+ | * **billing_vat**: | ||
+ | * **shipping_address**: | ||
+ | * **shipping_city**: | ||
+ | * **shipping_company_name**: | ||
+ | * **shipping_country**: | ||
+ | * **shipping_post_code**: | ||
+ | * **shipping_state**: | ||
+ | * **shipping_email**: | ||
+ | * **shipping_first_name**: | ||
+ | * **shipping_last_name**: | ||
+ | * **shipping_phone**: | ||
+ | * **notes**: notes | ||
+ | * **po_number**: | ||
+ | * **po_file_filename**: | ||
+ | * **po_option**: | ||
+ | * **po_option_display**: | ||
+ | * **created**: | ||
+ | * **updated**: | ||
+ | * **id**: ID of the purchase order data | ||
+ | * **payment_due_days**: | ||
+ | * **price**: Total price of quote (USD) | ||
+ | * **price_items**: | ||
+ | * **product_discount_price**: | ||
+ | * **products_price**: | ||
+ | * **query**: The quote query fields | ||
+ | * **reference_id_full**: | ||
+ | * **reformatting_price**: | ||
+ | * **shipping_price**: | ||
+ | * **site_url**: | ||
+ | * **special_formatting_price**: | ||
+ | * **state**: State code of the quote. | ||
+ | * **state_display**: | ||
+ | * **supplier_data**: | ||
+ | * **delivery_price**: | ||
+ | * **delivery_time**: | ||
+ | * **effective_price**: | ||
+ | * **avg_effective_price**: | ||
+ | * **products_count**: | ||
+ | * **products_price**: | ||
+ | * **quote**: The ID of the quote this supplier quote data belongs to. | ||
+ | * **reformatting_price**: | ||
+ | * **supplier**: | ||
+ | * **suppliers_count**: | ||
+ | * **total_cost**: | ||
+ | * **total_cost_without_discount**: | ||
+ | * **total_discount_price**: | ||
+ | * **type**: Type code of the quote. | ||
+ | * **type_display**: | ||
+ | * **updated**: | ||
+ | * **valid_until**: | ||
+ | | ||
+ | ==== Quote - Missing structures ==== | ||
+ | |||
+ | You can get the missing structures along with the reason of their exclusion. | ||
+ | |||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | And it will return a similar response to this: | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== 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 // | ||
+ | |||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | ==== 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 // | ||
+ | |||
+ | < | ||
+ | http https:// | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Quote order ===== | ||
+ | |||
+ | Submit purchase order for a quote via API. | ||
+ | |||
+ | < | ||
+ | http --form POST https:// | ||
+ | </ | ||
+ | |||
+ | == Example request: === | ||
+ | < | ||
+ | POST / | ||
+ | Accept: */* | ||
+ | Accept-Encoding: | ||
+ | Authorization: | ||
+ | Content-Type: | ||
+ | |||
+ | +-----------------------------------------+ | ||
+ | | NOTE: binary data not shown in terminal | | ||
+ | +-----------------------------------------+ | ||
+ | </ | ||
+ | |||
+ | Please note that in case you submit a file in the API request, you have to use // | ||
+ | |||
+ | If you don't submit a file in the API request, you can use // | ||
+ | |||
+ | < | ||
+ | echo ' | ||
+ | </ | ||
+ | |||
+ | == Example request: === | ||
+ | < | ||
+ | POST / | ||
+ | Accept: application/ | ||
+ | Authorization: | ||
+ | Content-Type: | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | == Example response: === | ||
+ | < | ||
+ | HTTP/1.0 201 CREATED | ||
+ | Allow: POST, OPTIONS | ||
+ | Content-Type: | ||
+ | |||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | Mandatory fields: | ||
+ | * **po_option**: | ||
+ | |||
+ | Optional fields: | ||
+ | * **billing_address**: | ||
+ | * **billing_city**: | ||
+ | * **billing_company_name**: | ||
+ | * **billing_country**: | ||
+ | * **billing_post_code**: | ||
+ | * **billing_state**: | ||
+ | * **billing_email**: | ||
+ | * **billing_first_name**: | ||
+ | * **billing_last_name**: | ||
+ | * **billing_phone**: | ||
+ | * **billing_same**: | ||
+ | * **billing_vat**: | ||
+ | * **shipping_address**: | ||
+ | * **shipping_city**: | ||
+ | * **shipping_company_name**: | ||
+ | * **shipping_country**: | ||
+ | * **shipping_post_code**: | ||
+ | * **shipping_state**: | ||
+ | * **shipping_email**: | ||
+ | * **shipping_first_name**: | ||
+ | * **shipping_last_name**: | ||
+ | * **shipping_phone**: | ||
+ | * **notes**: notes | ||
+ | * **po_number**: | ||
+ | * **po_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' | ||
+ | |||
+ | |||
+ | ====== 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:// | ||
+ | |||
+ | We'll probably extend this repository with new examples later. | ||
api.txt · Last modified: 2024/05/10 08:12 by bkovats