Update My Profile
curl --request PATCH \
--url https://api.headlesscommerce.io/v1/storefront/customers/me \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Customer-Token: <api-key>' \
--data '
{
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"tags": [
"<string>"
],
"metadata": {}
}
'import requests
url = "https://api.headlesscommerce.io/v1/storefront/customers/me"
payload = {
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"tags": ["<string>"],
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"X-Customer-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Customer-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
first_name: '<string>',
last_name: '<string>',
phone: '<string>',
tags: ['<string>'],
metadata: {}
})
};
fetch('https://api.headlesscommerce.io/v1/storefront/customers/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.headlesscommerce.io/v1/storefront/customers/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'first_name' => '<string>',
'last_name' => '<string>',
'phone' => '<string>',
'tags' => [
'<string>'
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Customer-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.headlesscommerce.io/v1/storefront/customers/me"
payload := strings.NewReader("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Customer-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.headlesscommerce.io/v1/storefront/customers/me")
.header("Authorization", "Bearer <token>")
.header("X-Customer-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.headlesscommerce.io/v1/storefront/customers/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Customer-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"external_id": "<string>",
"status": "active",
"total_orders": 123,
"total_spent": {
"amount": 123,
"currency": "<string>"
},
"tags": [
"<string>"
],
"addresses": [
{
"name": "<string>",
"company": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>"
}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z"
}Storefront - Customers
Update My Profile
PATCH
/
storefront
/
customers
/
me
Update My Profile
curl --request PATCH \
--url https://api.headlesscommerce.io/v1/storefront/customers/me \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Customer-Token: <api-key>' \
--data '
{
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"tags": [
"<string>"
],
"metadata": {}
}
'import requests
url = "https://api.headlesscommerce.io/v1/storefront/customers/me"
payload = {
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"tags": ["<string>"],
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"X-Customer-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Customer-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
first_name: '<string>',
last_name: '<string>',
phone: '<string>',
tags: ['<string>'],
metadata: {}
})
};
fetch('https://api.headlesscommerce.io/v1/storefront/customers/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.headlesscommerce.io/v1/storefront/customers/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'first_name' => '<string>',
'last_name' => '<string>',
'phone' => '<string>',
'tags' => [
'<string>'
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Customer-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.headlesscommerce.io/v1/storefront/customers/me"
payload := strings.NewReader("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Customer-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.headlesscommerce.io/v1/storefront/customers/me")
.header("Authorization", "Bearer <token>")
.header("X-Customer-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.headlesscommerce.io/v1/storefront/customers/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Customer-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"external_id": "<string>",
"status": "active",
"total_orders": 123,
"total_spent": {
"amount": 123,
"currency": "<string>"
},
"tags": [
"<string>"
],
"addresses": [
{
"name": "<string>",
"company": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>"
}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z"
}Authorizations
API Key. Example: sk_live_xxxxx or pk_live_xxxxx
Storefront customer authentication token. Issued via POST /admin/customers/{id}/token. Required for accessing /storefront/customers/, /storefront/orders/.
Body
application/json
Response
200 - application/json
Success
⌘I