Skip to main content

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.

The ERPNext Medusa Integration exposes a set of Frappe whitelisted methods that bridge your Medusa storefront with ERPNext. These endpoints handle storefront product data, quotation lifecycle management, sales order synchronization, customer linking, and wishlist/review operations.

Base URL

All endpoints share the same URL pattern:
https://<your-erpnext-site>/api/method/medusa_integration.api.<function_name>
For endpoints defined in utils.py, replace api with utils:
https://<your-erpnext-site>/api/method/medusa_integration.utils.<function_name>

Authentication

Endpoints decorated with @frappe.whitelist(allow_guest=True) accept unauthenticated requests. No session token or API key is required.These are used for all storefront-facing operations — browsing products, managing wishlists, creating quotations, and so on.

Request format

  • POST requests: send a JSON body with Content-Type: application/json.
  • GET requests: pass parameters as URL query string parameters.
# POST example
curl --request POST \
  --url "https://erp.example.com/api/method/medusa_integration.api.create_quotation" \
  --header "Content-Type: application/json" \
  --data '{"customer_id": "cus_01", "draft_order_id": "dor_01", "items": []}'

# GET example
curl "https://erp.example.com/api/method/medusa_integration.api.get_website_image?medusa_id=prod_01&customer_id=cus_01"

Response format

All endpoints return JSON. Successful responses contain the documented fields directly. Error responses include an error string field and may return an appropriate HTTP status code (404 for not found, 500 for server errors).
{
  "error": "Item not found for variant ID: var_01"
}

Request logging

Every API call — inbound and outbound — is automatically recorded in ERPNext under the Medusa Request Log doctype. Each log entry captures:
  • Request status (Success / Failure)
  • Request payload
  • Response body
  • Associated voucher type and name (when applicable)
You can review logs at ERPNext → Medusa Request Log to debug integration issues.

Available endpoints

EndpointMethodAuthDescription
get_website_itemsGET/POSTGuestPaginated storefront product listing with filters
get_website_variantsGETGuestVariant items for a parent product
get_website_imageGETGuestImage URL, brand image, quantity, and price for a product
get_distinct_specsPOSTGuestDistinct colour/shape/shade specs for a set of products
get_all_brandsGETGuestAll brands with images, optionally filtered by item group
create_quotationPOSTGuestCreate a Quotation from a Medusa draft order
update_quotationPOSTGuestApprove or reject a quotation; optionally create Sales Order
update_quotation_newPOSTGuestUpdate quotation item list, unapproved items, and increased items
fetch_quotation_pdf_urlPOSTGuestReturn a print URL for a quotation PDF
get_medusa_pricesGET/POSTGuestStandard and negotiated prices for Medusa product/variant IDs
export_sales_orderPOSTGuestPush Sales Order and payment status back to Medusa
sync_missing_prices_to_medusaPOSTGuestBulk-sync item prices that lack a Medusa price ID
fetch_all_customersGETGuestERPNext customers without a Medusa ID
update_addressPOSTGuestUpdate billing address for a customer
link_medusa_leadGETAuth requiredLink an ERPNext Customer to a Medusa Lead ID
handle_wishlistPOSTGuestAdd or remove items from a customer’s wishlist
add_review_to_website_itemPOSTGuestAdd or update a product review
fetch_relevant_itemsPOSTGuestRecommended items for a product page
fetch_relevant_collection_productsPOSTGuestTop-selling products for a given item group

Build docs developers (and LLMs) love