These endpoints manage the full quotation lifecycle between Medusa and ERPNext. They cover creating a Quotation from a Medusa draft order, updating approval status, refreshing item lists, generating PDF URLs, and fetching real-time prices for cart items. All endpoints are guest-accessible.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/aerele/medusa_integration/llms.txt
Use this file to discover all available pages before exploring further.
Create quotation
POST Guestcustomer_id — first against the Customer doctype, then against Leads. If the party is a Lead and create_so is true, the Lead is automatically converted to a Customer before the quotation is saved. A billing address is created or updated if provided.
Taxes are applied from item tax templates automatically. Only templates associated with the configured company are included.
Request body
Medusa customer ID. Must match a Customer or Lead with a
medusa_id field in ERPNext.Medusa draft order ID. Stored as
medusa_draft_order_id on the Quotation.Medusa quotation ID. Stored as
medusa_quotation_id on the Quotation.Line items to add to the quotation.
Billing address to create or update for the customer.
When
true and the party is a Lead, converts the Lead to a Customer before saving the quotation.Response fields
"Quotation created successfully" on success.The ERPNext name (ID) of the created Quotation.
Example
Update quotation
POST Guest"Approved" or "Rejected". When approved with create_so: true, a Sales Order and Payment Request are automatically created and the payment URL is returned.
Request body
Medusa quotation ID (stored as
medusa_quotation_id on the ERPNext Quotation).Approval decision. Accepted values:
"Approved" or "Rejected".Medusa order ID. Stored as
medusa_order_id on the Quotation when approved.When
true and approval is "Approved", creates a Sales Order from the Quotation and generates a Payment Request.When
create_so is true, sets custom_is_courier_required on the Sales Order.Delivery location and contact number. Set as
custom_location_and_contact_no on the Sales Order when create_so is true.Response fields
Whenapproval: "Approved" and create_so: true:
"Quotation updated successfully, Sales Order created & Payment URL generated"ERPNext Quotation name.
ERPNext Sales Order name.
ERPNext Payment Request name.
Payment gateway URL for the customer to complete payment.
"Quotation updated successfully"ERPNext Quotation name.
Example
Update quotation (new items)
POST GuestRequest body
Medusa quotation ID (
medusa_quotation_id on the ERPNext Quotation).Replacement item list for the quotation.
Items that were not approved, stored in the
unapproved_items child table.Items whose quantities were increased, stored in the
custom_increased_items table.Billing address used to determine delivery charges. If the city is not Muscat, a delivery charge is appended to the taxes table.
Response fields
"Quotation updated successfully"ERPNext Quotation name.
Example
Fetch quotation PDF URL
POST GuestRequest body
ERPNext Quotation name (e.g.
"QTN-2024-00001").Response
Returns a plain string URL on success:Example
Get Medusa prices
GET / POST Guestdraft_order_id is provided, the associated Payment Request URL is also returned.
Prices are suppressed (returned as
0) if they exceed the configured price_visibility_threshold from the Homepage Landing settings.Request body
List of products to price.
ERPNext price list name. Defaults to the customer’s default price list if not specified.
Medusa customer ID. Used to resolve negotiated prices from the customer’s specific price list entries.
Medusa draft order ID. When provided, the response is wrapped to include the associated payment URL.
Response fields
Withoutdraft_order_id: a dictionary keyed by medusa_product_id or medusa_variant_id.
Price entry for the given Medusa ID.
draft_order_id:
Same per-item dictionary as above.
Payment URL from the Payment Request linked to the Sales Order for this draft order, or
null if none.