curl --request POST \
--url https://api.fabric.inc/v3/orders/actions/update-customer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-fabric-channel-id: <x-fabric-channel-id>' \
--header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
--data '
{
"accountId": "62272e917b12209e68751d94",
"company": "Demo Inc",
"email": "test@example.com",
"employeeId": "62272e917b12209e68751d94",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
},
"userId": "62272e917b12209e68751d94"
}
'import requests
url = "https://api.fabric.inc/v3/orders/actions/update-customer"
payload = {
"accountId": "62272e917b12209e68751d94",
"company": "Demo Inc",
"email": "test@example.com",
"employeeId": "62272e917b12209e68751d94",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
},
"userId": "62272e917b12209e68751d94"
}
headers = {
"x-fabric-tenant-id": "<x-fabric-tenant-id>",
"x-fabric-channel-id": "<x-fabric-channel-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-fabric-tenant-id': '<x-fabric-tenant-id>',
'x-fabric-channel-id': '<x-fabric-channel-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
accountId: '62272e917b12209e68751d94',
company: 'Demo Inc',
email: 'test@example.com',
employeeId: '62272e917b12209e68751d94',
name: {firstName: 'Alex', lastName: 'Doe', middleName: 'E'},
phone: {number: '123-456-7890', type: 'MOBILE'},
userId: '62272e917b12209e68751d94'
})
};
fetch('https://api.fabric.inc/v3/orders/actions/update-customer', 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.fabric.inc/v3/orders/actions/update-customer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => '62272e917b12209e68751d94',
'company' => 'Demo Inc',
'email' => 'test@example.com',
'employeeId' => '62272e917b12209e68751d94',
'name' => [
'firstName' => 'Alex',
'lastName' => 'Doe',
'middleName' => 'E'
],
'phone' => [
'number' => '123-456-7890',
'type' => 'MOBILE'
],
'userId' => '62272e917b12209e68751d94'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-fabric-channel-id: <x-fabric-channel-id>",
"x-fabric-tenant-id: <x-fabric-tenant-id>"
],
]);
$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.fabric.inc/v3/orders/actions/update-customer"
payload := strings.NewReader("{\n \"accountId\": \"62272e917b12209e68751d94\",\n \"company\": \"Demo Inc\",\n \"email\": \"test@example.com\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"userId\": \"62272e917b12209e68751d94\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-fabric-tenant-id", "<x-fabric-tenant-id>")
req.Header.Add("x-fabric-channel-id", "<x-fabric-channel-id>")
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.fabric.inc/v3/orders/actions/update-customer")
.header("x-fabric-tenant-id", "<x-fabric-tenant-id>")
.header("x-fabric-channel-id", "<x-fabric-channel-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"62272e917b12209e68751d94\",\n \"company\": \"Demo Inc\",\n \"email\": \"test@example.com\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"userId\": \"62272e917b12209e68751d94\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/orders/actions/update-customer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-fabric-tenant-id"] = '<x-fabric-tenant-id>'
request["x-fabric-channel-id"] = '<x-fabric-channel-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"62272e917b12209e68751d94\",\n \"company\": \"Demo Inc\",\n \"email\": \"test@example.com\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"userId\": \"62272e917b12209e68751d94\"\n}"
response = http.request(request)
puts response.read_body{
"failedCount": 2,
"failedOrderIds": [
"123k4h123k",
"123k4h124k"
],
"successCount": 18,
"totalRecordCount": 10
}{
"errors": [
{
"message": "Invalid request",
"type": "CLIENT_ERROR"
}
],
"message": "Bad request",
"type": "CLIENT_ERROR"
}{
"message": "Unauthorized request",
"type": "CLIENT_ERROR"
}{
"message": "Internal server error",
"type": "SERVER_ERROR"
}Update customer details for given order IDs
In many scenarios, customer details may change over time. For example, a customer might change their email, phone, or company affiliation.
By providing the order IDs and the updated customer details, this endpoint facilitates updating customer info for the given order IDs. This ensures order-related communication reaches the customer and they get timely customer service.
curl --request POST \
--url https://api.fabric.inc/v3/orders/actions/update-customer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-fabric-channel-id: <x-fabric-channel-id>' \
--header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
--data '
{
"accountId": "62272e917b12209e68751d94",
"company": "Demo Inc",
"email": "test@example.com",
"employeeId": "62272e917b12209e68751d94",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
},
"userId": "62272e917b12209e68751d94"
}
'import requests
url = "https://api.fabric.inc/v3/orders/actions/update-customer"
payload = {
"accountId": "62272e917b12209e68751d94",
"company": "Demo Inc",
"email": "test@example.com",
"employeeId": "62272e917b12209e68751d94",
"name": {
"firstName": "Alex",
"lastName": "Doe",
"middleName": "E"
},
"phone": {
"number": "123-456-7890",
"type": "MOBILE"
},
"userId": "62272e917b12209e68751d94"
}
headers = {
"x-fabric-tenant-id": "<x-fabric-tenant-id>",
"x-fabric-channel-id": "<x-fabric-channel-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-fabric-tenant-id': '<x-fabric-tenant-id>',
'x-fabric-channel-id': '<x-fabric-channel-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
accountId: '62272e917b12209e68751d94',
company: 'Demo Inc',
email: 'test@example.com',
employeeId: '62272e917b12209e68751d94',
name: {firstName: 'Alex', lastName: 'Doe', middleName: 'E'},
phone: {number: '123-456-7890', type: 'MOBILE'},
userId: '62272e917b12209e68751d94'
})
};
fetch('https://api.fabric.inc/v3/orders/actions/update-customer', 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.fabric.inc/v3/orders/actions/update-customer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => '62272e917b12209e68751d94',
'company' => 'Demo Inc',
'email' => 'test@example.com',
'employeeId' => '62272e917b12209e68751d94',
'name' => [
'firstName' => 'Alex',
'lastName' => 'Doe',
'middleName' => 'E'
],
'phone' => [
'number' => '123-456-7890',
'type' => 'MOBILE'
],
'userId' => '62272e917b12209e68751d94'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-fabric-channel-id: <x-fabric-channel-id>",
"x-fabric-tenant-id: <x-fabric-tenant-id>"
],
]);
$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.fabric.inc/v3/orders/actions/update-customer"
payload := strings.NewReader("{\n \"accountId\": \"62272e917b12209e68751d94\",\n \"company\": \"Demo Inc\",\n \"email\": \"test@example.com\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"userId\": \"62272e917b12209e68751d94\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-fabric-tenant-id", "<x-fabric-tenant-id>")
req.Header.Add("x-fabric-channel-id", "<x-fabric-channel-id>")
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.fabric.inc/v3/orders/actions/update-customer")
.header("x-fabric-tenant-id", "<x-fabric-tenant-id>")
.header("x-fabric-channel-id", "<x-fabric-channel-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"62272e917b12209e68751d94\",\n \"company\": \"Demo Inc\",\n \"email\": \"test@example.com\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"userId\": \"62272e917b12209e68751d94\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/orders/actions/update-customer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-fabric-tenant-id"] = '<x-fabric-tenant-id>'
request["x-fabric-channel-id"] = '<x-fabric-channel-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"62272e917b12209e68751d94\",\n \"company\": \"Demo Inc\",\n \"email\": \"test@example.com\",\n \"employeeId\": \"62272e917b12209e68751d94\",\n \"name\": {\n \"firstName\": \"Alex\",\n \"lastName\": \"Doe\",\n \"middleName\": \"E\"\n },\n \"phone\": {\n \"number\": \"123-456-7890\",\n \"type\": \"MOBILE\"\n },\n \"userId\": \"62272e917b12209e68751d94\"\n}"
response = http.request(request)
puts response.read_body{
"failedCount": 2,
"failedOrderIds": [
"123k4h123k",
"123k4h124k"
],
"successCount": 18,
"totalRecordCount": 10
}{
"errors": [
{
"message": "Invalid request",
"type": "CLIENT_ERROR"
}
],
"message": "Bad request",
"type": "CLIENT_ERROR"
}{
"message": "Unauthorized request",
"type": "CLIENT_ERROR"
}{
"message": "Internal server error",
"type": "SERVER_ERROR"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.
x-fabric-channel-id identifies the sales channel where the API request is being made; primarily for multichannel use cases. The channel ids are 12 corresponding to US and 13 corresponding to Canada. The default channel id is 12. This field is required.
Unique request ID
Body
Update customer info request
Customer's loyalty account ID or external identifier that is used to track their loyalty program activity and rewards earned.
"62272e917b12209e68751d94"
Shopper's company name. This may be used for company discounts.
"Demo Inc"
Contact person's email
"test@example.com"
Employee (ID or name) who initiated an update request
"62272e917b12209e68751d94"
Contact person's name
Show child attributes
Show child attributes
Contact person's phone details.
Show child attributes
Show child attributes
Identifier of the logged in user who initiated the request. This could be from either fabric Identity service or an external Identity service.
"62272e917b12209e68751d94"
Response
OK
Response for customer update request
Was this page helpful?
