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 [2022/02/10 12:24] – [Quote API] flackapi [2022/02/23 18:23] – [InChIKey lookup] flack
Line 162: Line 162:
 ===== InChIKey lookup ===== ===== InChIKey lookup =====
 == Endpoint: == == Endpoint: ==
-<code>/lookup/<inchi_key></code>+<code>/lookup/inchikey/<inchi_key></code>
  
 == Example API request: == == Example API request: ==
Line 1736: Line 1736:
     * **billing_address**: Billing address     * **billing_address**: Billing address
     * **billing_city**: Billing city     * **billing_city**: Billing city
-    * **billing_company_name**: Billing company name+    * **billing_company_name**: Billing Institution / Company name
     * **billing_country**: Billing country     * **billing_country**: Billing country
-    * **billing_post_code**: Billing post code +    * **billing_post_code**: Billing ZIP / Post code 
-    * **billing_state**: Billing state (or province)+    * **billing_state**: Billing State / Province
     * **billing_email**: Billing contact email     * **billing_email**: Billing contact email
     * **billing_first_name**: Billing contact first name     * **billing_first_name**: Billing contact first name
Line 1748: Line 1748:
     * **shipping_address**: Shipping address     * **shipping_address**: Shipping address
     * **shipping_city**: shipping city     * **shipping_city**: shipping city
-    * **shipping_company_name**: Shipping company name+    * **shipping_company_name**: Shipping Institution / Company name
     * **shipping_country**: Shipping country     * **shipping_country**: Shipping country
-    * **shipping_post_code**: Shipping post code +    * **shipping_post_code**: Shipping ZIP / Post code 
-    * **shipping_state**: Shipping state (or province)+    * **shipping_state**: Shipping State / Province
     * **shipping_email**: Shipping contact email     * **shipping_email**: Shipping contact email
     * **shipping_first_name**: Shipping contact first name     * **shipping_first_name**: Shipping contact first name
Line 1860: Line 1860:
 </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>
 +
 +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.txt · Last modified: 2023/06/03 07:19 by flack