Medusa
Store APIAdmin API
Store APIAdmin API
Discord
Twitter
Linkedin
Github
  1. Customers
  • Getting Started
    • Introduction
    • Authentication
    • HTTP Compression
    • Publishable API Key
    • Expanding Fields
    • Selecting Fields
    • Query Parameter Types
    • Pagination
  • Auth
    • Customer Login (JWT)
      POST
    • Customer Login (JWT)
      POST
    • Check if Email Exists
      GET
    • Get Current Customer
      GET
    • Customer Log out
      DELETE
    • Customer Login
      POST
  • Carts
    • Create Payment Sessions
      POST
    • Refresh a Payment Session
      POST
    • Create a Cart
      POST
    • Complete a Cart
      POST
    • Select a Payment Session
      POST
    • Delete a Payment Session
      DELETE
    • Update a Payment Session
      POST
    • Get a Cart
      GET
    • Update a Cart
      POST
    • Add Shipping Method
      POST
    • Update a Line Item
      POST
    • Delete a Line Item
      DELETE
    • Add a Line Item
      POST
    • Calculate Cart Taxes
      POST
    • Remove Discount
      DELETE
  • Customers
    • Request Password Reset
      POST
    • Get Saved Payment Methods
      GET
    • Add a Shipping Address
      POST
    • Update Customer
      POST
    • Get a Customer
      GET
    • Update a Shipping Address
      POST
    • Delete an Address
      DELETE
    • Create a Customer
      POST
    • Reset Password
      POST
    • List Orders
      GET
  • Gift Cards
    • Get Gift Card by Code
  • Orders
    • Claim Order
    • Verify Order Claim
    • Get an Order
    • Look Up an Order
    • Get by Cart ID
  • Order Edits
    • Complete an Order Edit
    • Retrieve an Order Edit
    • Decline an Order Edit
  • Payment Collections
    • Authorize Payment Session
    • Authorize Payment Sessions
    • Refresh a Payment Session
    • Get a PaymentCollection
    • Manage Payment Sessions
    • Create a Payment Session
  • Products
    • Search Products
    • List Products
    • Get a Product
  • Product Variants
    • Get a Product Variant
    • Get Product Variants
  • Product Tags
    • List Product Tags
  • Product Categories
    • List Product Categories
    • Get a Product Category
  • Product Collections
    • Get a Collection
    • List Collections
  • Product Types
    • List Product Types
  • Regions
    • List Regions
    • Get a Region
  • Returns
    • Create Return
  • Return Reasons
    • List Return Reasons
    • Get a Return Reason
  • Shipping Options
    • List for Cart
    • Get Shipping Options
  • Swaps
    • Get by Cart ID
    • Create a Swap
  1. Customers

Update Customer

POST
/store/customers/me
Customers
Update the logged-in customer's details.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST '{{BASE_URL}}/store/customers/me' \
--header 'Content-Type: application/json' \
--data-raw '{
    "first_name": "string",
    "last_name": "string",
    "password": "string",
    "phone": "string",
    "email": "string",
    "metadata": {},
    "billing_address": {
        "first_name": "Arno",
        "last_name": "Willms",
        "phone": 16128234334802,
        "company": "string",
        "address_1": "14433 Kemmer Court",
        "address_2": "Suite 369",
        "city": "South Geoffreyview",
        "province": "Kentucky",
        "postal_code": 72093,
        "country_code": "st",
        "metadata": {
            "car": "white"
        }
    }
}'
Response Response Example
200 - Example 1
{
  "customer": {
    "id": "cus_01G2SG30J8C85S4A5CHM2S1NS2",
    "email": "user@example.com",
    "first_name": "Arno",
    "last_name": "Willms",
    "billing_address_id": "addr_01G8ZH853YPY9B94857DY91YGW",
    "phone": 16128234334802,
    "has_account": false,
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "deleted_at": "2019-08-24T14:15:22Z",
    "orders": [
      {}
    ],
    "metadata": {
      "car": "white"
    },
    "groups": [
      {
        "id": "cgrp_01G8ZH853Y6TFXWPG5EYE81X63",
        "name": "VIP",
        "created_at": "2019-08-24T14:15:22Z",
        "updated_at": "2019-08-24T14:15:22Z",
        "deleted_at": "2019-08-24T14:15:22Z",
        "customers": [
          {}
        ],
        "price_lists": [
          {}
        ],
        "metadata": {
          "car": "white"
        }
      }
    ],
    "shipping_addresses": [
      {
        "id": "addr_01G8ZC9VS1XVE149MGH2J7QSSH",
        "customer_id": "cus_01G2SG30J8C85S4A5CHM2S1NS2",
        "customer": {},
        "company": "Acme",
        "first_name": "Arno",
        "last_name": "Willms",
        "address_1": "14433 Kemmer Court",
        "address_2": "Suite 369",
        "city": "South Geoffreyview",
        "province": "Kentucky",
        "postal_code": 72093,
        "phone": 16128234334802,
        "created_at": "2019-08-24T14:15:22Z",
        "updated_at": "2019-08-24T14:15:22Z",
        "deleted_at": "2019-08-24T14:15:22Z",
        "country_code": "st",
        "metadata": {
          "car": "white"
        },
        "country": {
          "id": 109,
          "name": "ITALY",
          "display_name": "Italy",
          "region_id": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G",
          "region": {},
          "iso_2": "it",
          "iso_3": "ita",
          "num_code": 380
        }
      }
    ],
    "billing_address": {
      "id": "addr_01G8ZC9VS1XVE149MGH2J7QSSH",
      "customer_id": "cus_01G2SG30J8C85S4A5CHM2S1NS2",
      "customer": {},
      "company": "Acme",
      "first_name": "Arno",
      "last_name": "Willms",
      "address_1": "14433 Kemmer Court",
      "address_2": "Suite 369",
      "city": "South Geoffreyview",
      "province": "Kentucky",
      "postal_code": 72093,
      "phone": 16128234334802,
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z",
      "deleted_at": "2019-08-24T14:15:22Z",
      "country_code": "st",
      "metadata": {
        "car": "white"
      },
      "country": {
        "id": 109,
        "name": "ITALY",
        "display_name": "Italy",
        "region_id": "reg_01G1G5V26T9H8Y0M4JNE3YGA4G",
        "region": {},
        "iso_2": "it",
        "iso_3": "ita",
        "num_code": 380
      }
    }
  }
}

Request

Body Params application/json
first_name
string 
optional
The customer's first name.
last_name
string 
optional
The customer's last name.
password
string 
optional
The customer's password.
phone
string 
optional
The customer's phone number.
email
string 
optional
The customer's email.
metadata
object 
optional
Additional custom data about the customer.
billing_address
optional
The address to be used for billing purposes.
Any of
Address fields used when creating/updating an address.
first_name
string 
optional
First name
Example:
Arno
last_name
string 
optional
Last name
Example:
Willms
phone
string 
optional
Phone Number
Example:
16128234334802
company
string 
optional
Company
address_1
string 
optional
Address line 1
Example:
14433 Kemmer Court
address_2
string 
optional
Address line 2
Example:
Suite 369
city
string 
optional
City
Example:
South Geoffreyview
province
string 
optional
Province
Example:
Kentucky
postal_code
string 
optional
Postal Code
Example:
72093
country_code
string 
optional
The 2 character ISO code of the country in lower case
Example:
st
metadata
object 
optional
An optional key-value map with additional details
Example:
{"car":"white"}
Examples

Responses

🟢200OK
application/json
Body
The customer's details.
customer
object (Customer) 
required
A customer can make purchases in your store and manage their profile.
id
string 
required
The customer's ID
Example:
cus_01G2SG30J8C85S4A5CHM2S1NS2
email
string <email>
required
The customer's email
first_name
string  | null 
required
The customer's first name
Example:
Arno
last_name
string  | null 
required
The customer's last name
Example:
Willms
billing_address_id
string  | null 
required
The customer's billing address ID
Example:
addr_01G8ZH853YPY9B94857DY91YGW
phone
string  | null 
required
The customer's phone number
Example:
16128234334802
has_account
boolean 
required
Whether the customer has an account or not
Default:
false
created_at
string <date-time>
required
The date with timezone at which the resource was created.
updated_at
string <date-time>
required
The date with timezone at which the resource was updated.
deleted_at
string <date-time> | null 
required
The date with timezone at which the resource was deleted.
orders
array [object] 
optional
The details of the orders this customer placed.
metadata
object  | null 
required
An optional key-value map with additional details
Example:
{"car":"white"}
groups
array[object (Customer Group) {8}] 
optional
The customer groups the customer belongs to.
shipping_addresses
array[object (Address) {18}] 
optional
The details of the shipping addresses associated with the customer.
billing_address
object (Address) 
optional
An address is used across the Medusa backend within other schemas and object types. For example, a customer's billing and shipping addresses both use the Address entity.
🟠400Client Error or Multiple Errors
🟠401User is not authorized. Must log in first
🟠404Not Found Error
🟠409Invalid State Error
🟠422Invalid Request Error
🔴500Server Error
Modified at 2023-11-27 13:05:07
Previous
Add a Shipping Address
Next
Get a Customer
Built with