These endpoints manage customer data between ERPNext and the Medusa storefront. They cover finding ERPNext customers not yet linked to Medusa, updating billing addresses, and linking an existing Customer to a Medusa Lead. Two endpoints are guest-accessible; the lead-linking endpoint requires authentication.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.
Fetch all customers
GET Guestmedusa_id set. Optionally filters by customer name to support typeahead search. Intended for customer import and linking workflows in the admin panel.
Request parameters
Search string. Each whitespace-separated word is matched as a
LIKE '%word%' condition against customer_name. All words must match.Response
Returns an array of customer objects on success, or the string"No relevant customers found" when there are no results.
ERPNext internal document name (customer ID).
Display name of the customer.
Customer email address.
Customer mobile number.
Example
Update address
POST Guestcustomer_id is updated. Only fields present in the request body are modified.
Request body
ERPNext Customer document name (e.g.
"CUST-00042").Primary street address.
Secondary address line.
City.
State or emirate.
Country name as it appears in ERPNext (e.g.
"Oman").Postal or ZIP code.
Response
Returns the string"Address updated successfully" on success. Returns an error object on failure.
Example
Link Medusa lead
GET Auth requiredmedusa_id is copied to the Customer and the Lead is set as the lead_name on the Customer record.
Validation
Before linking, the endpoint checks:- The Lead exists in ERPNext.
- The Lead has a
medusa_idset. - The
medusa_idis not already linked to a different Customer.
ValidationError.
Request parameters
ERPNext Customer document name (e.g.
"CUST-00042").ERPNext Lead document name (e.g.
"CRM-LEAD-2024-00001").Response fields
"success" when the link is established.