Customer REST API
Learn to use new customer REST APIs in Adobe Commerce as a Cloud Service. This tutorial is perfect for architects and developers looking to integrate and optimize API solutions effectively.
Who is this video for?
- Backend developers responsible for building integrations with Adobe Commerce
- Technical architects designing customer management workflows for headless commerce implementations
Video content
- Authenticate with Adobe IMS using server-to-server credentials to obtain an access token for API requests
- Use the correct REST API endpoint format for Commerce as a Cloud Service
- Create and update customer accounts programmatically using POST and PUT requests with proper JSON payloads
Code samples
Before starting, gather all the required values from Experience Cloud and the Adobe Developer Console. Having these values ready ensures a smooth setup process.
Instance details - experience.adobe.com
The instance details contain things like your Instance ID, GraphQL endpoints, credentials.
Developer details - https://developer.adobe.com/console/
The Developer Console is where you manage your API credentials, including client IDs, client secrets, and access tokens. You can also create new credential types, such as Server-to-Server or Native App authentication.
Prerequisites
<instance_id><rest_endpoint><client_id><client_secret>Step 1: Get Access Token (Server-to-Server Authentication)
curl -X POST 'https://ims-na1.adobelogin.com/ims/token/v3' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials&client_id=<client_id>&client_secret=<client_secret>&scope=openid,AdobeID,email,additional_info.projectedProductContext,profile,commerce.aco.ingestion,commerce.accs,org.read,additional_info.roles'
Sample Response:
{
"access_token": "eyJhbGciOiJSUzI1NiIs...",
"token_type": "bearer",
"expires_in": 86399
}
Step 2: Create a Customer
https://na1-sandbox.api.commerce.adobe.com/AbCYab34cdEfGHiJ27123.Endpoint: POST /V1/customers
curl -X POST \
"<rest_endpoint>/V1/customers" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-d '{
"customer": {
"email": "john.doe@example.com",
"firstname": "John",
"lastname": "Doe",
"store_id": 1,
"website_id": 1
},
"password": "TempPa55word!"
}'
Response:
{
"id": 5,
"group_id": 1,
"created_at": "2026-01-23 20:40:15",
"updated_at": "2026-01-23 20:40:15",
"created_in": "Default Store View",
"email": "john.doe@example.com",
"firstname": "John",
"lastname": "Doe",
"store_id": 1,
"website_id": 1,
"addresses": [],
"disable_auto_group_change": 0
}
Step 3: Update a Customer
https://na1-sandbox.api.commerce.adobe.com/AbCYab34cdEfGHiJ27123.The number 5 in the following example is the ID from the previously created customer using POST "id": 5,. Be sure to change5 to whatever id was returned in your request.
Endpoint: PUT /V1/customers/{customerId}
curl -X PUT \
"<rest_endpoint>/V1/customers/5" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-d '{
"customer": {
"id": 5,
"email": "john.doe@example.com",
"firstname": "John",
"lastname": "Doe-Updated"
}
}'
Response:
{
"id": 5,
"group_id": 1,
"created_at": "2026-01-23 20:40:15",
"updated_at": "2026-01-23 20:40:30",
"created_in": "Default Store View",
"email": "john.doe@example.com",
"firstname": "John",
"lastname": "Doe-Updated",
"store_id": 1,
"website_id": 1,
"addresses": []
}
Complete script (all-in-one)
https://na1-sandbox.api.commerce.adobe.com/AbCDefGHiJ1234567.#!/bin/bash
# Configuration be sure to update these with your projects unique values
CLIENT_ID="<client_id>"
CLIENT_SECRET="<client_secret>"
REST_ENDPOINT="<rest_endpoint>"
# Step 1: Get Access Token
echo "Getting access token..."
ACCESS_TOKEN=$(curl -s -X POST 'https://ims-na1.adobelogin.com/ims/token/v3' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d "grant_type=client_credentials&client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}&scope=openid,AdobeID,email,additional_info.projectedProductContext,profile,commerce.aco.ingestion,commerce.accs,org.read,additional_info.roles" | jq -r '.access_token')
echo "Token obtained: ${ACCESS_TOKEN:0:50}..."
# Step 2: Create Customer
echo ""
echo "Creating customer..."
CREATE_RESPONSE=$(curl -s -X POST \
"${REST_ENDPOINT}/V1/customers" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-d '{
"customer": {
"email": "john.doe@example.com",
"firstname": "John",
"lastname": "Doe",
"store_id": 1,
"website_id": 1
},
"password": "TempPa55word!"
}')
echo "Create Response:"
echo "$CREATE_RESPONSE" | jq .
# Extract customer ID
CUSTOMER_ID=$(echo "$CREATE_RESPONSE" | jq -r '.id')
echo "Customer ID: $CUSTOMER_ID"
# Step 3: Update Customer
echo ""
echo "Updating customer..."
curl -s -X PUT \
"${REST_ENDPOINT}/V1/customers/${CUSTOMER_ID}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-d "{
\"customer\": {
\"id\": ${CUSTOMER_ID},
\"email\": \"john.doe@example.com\",
\"firstname\": \"john\",
\"lastname\": \"Doe-Updated\"
}
}" | jq .
Important notes about this tutorial
- URL Path: Use
https://<server>.api.commerce.adobe.com/<tenant-id>/V1/customers— NOThttps://<host>/rest/<store-view-code>/V1/customers - Authentication: This tutorial used Server-to-Server (
client_credentialsgrant type) - Required Scope:
commerce.accs - Token Expiry: 86400 seconds (24 hours)