Customers API Routes
Customers can place orders as guest customers or register.
When a customer registers, they can manage their profile, save addresses for later usage, and more.
These API routes allow customers to create and manage their accounts.
POST /store/customers#
Register Customer
Register a customer. Use the /auth/customer/emailpass/register API route first to retrieve the registration token and pass it in the header of the request.
Authentication: cookie session, JWT bearer token.
Header parameters
x-publishable-api-keystringx-medusa-localestringOptionalen-USQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.localestringOptionalen-USRequest body (application/json)
emailstringOptionalcompany_namestringOptionalfirst_namestringOptionallast_namestringOptionalphonestringOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
customerobjectThe customer's details.
customerobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
customer.created: Emitted when a customer is created.
GET /store/customers/me#
Get Logged-in Customer
Retrieve the logged-in customer. You can expand the customer's relations or select the fields that should be returned.
Authentication: cookie session, JWT bearer token.
Header parameters
x-publishable-api-keystringx-medusa-localestringOptionalen-USQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the Retrieve Custom Links documentation.localestringOptionalen-USRequest examples
Responses
200 OK
customerobjectThe customer's details.
customerobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /store/customers/me#
Update Customer
Update the logged-in customer's details.
Authentication: cookie session, JWT bearer token.
Header parameters
x-publishable-api-keystringx-medusa-localestringOptionalen-USQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.localestringOptionalen-USRequest body (application/json)
company_namestringOptionalfirst_namestringOptionallast_namestringOptionalphonestringOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
customerobjectThe customer's details.
customerobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
customer.updated: Emitted when a customer is updated.
GET /store/customers/me/addresses#
List Customer's Addresses
Retrieve the addresses of the logged-in customer. The addresses can be filtered by fields such as country_code. The addresses can also be sorted or paginated.
Authentication: cookie session, JWT bearer token.
Header parameters
x-publishable-api-keystringx-medusa-localestringOptionalen-USQuery parameters
citystring | string[]Optionalpostal_codestring | string[]Optionalcountry_codestring | string[]OptionalqstringOptional$andobject[]Optional$orobject[]OptionallocalestringOptionalen-USlimitnumberOptionaloffsetnumberOptionalorderstringOptional-.with_deletedbooleanOptionalfieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.Request examples
Responses
200 OK
limitnumberoffsetnumbercountnumberaddressesobject[]The list of addresses.
addressesobject[]estimate_countnumberOptional400, 401, 404, 409, 422, 500: an error response is returned.
POST /store/customers/me/addresses#
Create Address for Logged-In Customer
Create an address for the logged-in customer.
Authentication: cookie session, JWT bearer token.
Header parameters
x-publishable-api-keystringx-medusa-localestringOptionalen-USQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the Retrieve Custom Links documentation.localestringOptionalen-USRequest body (application/json)
first_namestringOptionallast_namestringOptionalphonestringOptionalcompanystringOptionaladdress_1stringOptionaladdress_2stringOptionalcitystringOptionalcountry_codestringOptionalprovincestringOptionalus-capostal_codestringOptionaladdress_namestringOptionalis_default_shippingbooleanOptionalis_default_billingbooleanOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
customerobjectThe customer's details.
customerobject400, 401, 404, 409, 422, 500: an error response is returned.
GET /store/customers/me/addresses/{address_id}#
Get Customer's Address
Retrieve an address of the logged-in customer. You can expand the address's relations or select the fields that should be returned.
Authentication: cookie session, JWT bearer token.
Path parameters
address_idstringHeader parameters
x-publishable-api-keystringx-medusa-localestringOptionalen-USQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the Retrieve Custom Links documentation.localestringOptionalen-USRequest examples
Responses
200 OK
addressobjectThe customer address's details
addressobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /store/customers/me/addresses/{address_id}#
Update Customer's Address
Update the logged-in customer's address.
Authentication: cookie session, JWT bearer token.
Path parameters
address_idstringHeader parameters
x-publishable-api-keystringx-medusa-localestringOptionalen-USQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the Retrieve Custom Links documentation.localestringOptionalen-USRequest body (application/json)
first_namestringOptionallast_namestringOptionalphonestringOptionalcompanystringOptionaladdress_1stringOptionaladdress_2stringOptionalcitystringOptionalcountry_codestringOptionalprovincestringOptionalus-capostal_codestringOptionaladdress_namestringOptionalis_default_shippingbooleanOptionalis_default_billingbooleanOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
customerobjectThe customer's details.
customerobject400, 401, 404, 409, 422, 500: an error response is returned.
DELETE /store/customers/me/addresses/{address_id}#
Remove Customer's Address
Remove an address of the logged-in customer.
Authentication: cookie session, JWT bearer token.
Path parameters
address_idstringHeader parameters
x-publishable-api-keystringx-medusa-localestringOptionalen-USQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the Retrieve Custom Links documentation.localestringOptionalen-USRequest examples
Responses
200 OK
idstringobjectstringDefault: "address"
deletedbooleanparentobjectOptionalThe customer's details.
parentobjectOptional400, 401, 404, 409, 422, 500: an error response is returned.