curl --request PATCH \
--url https://api.example.com/connections/{connection_id} \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "8a46e581-48ba-498a-9ad0-2ee72582e1af",
"email": "[email protected]",
"mobile": "+1234567890",
"status": "disconnected"
}
'import requests
url = "https://api.example.com/connections/{connection_id}"
payload = {
"customer_id": "8a46e581-48ba-498a-9ad0-2ee72582e1af",
"email": "[email protected]",
"mobile": "+1234567890",
"status": "disconnected"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
customer_id: '8a46e581-48ba-498a-9ad0-2ee72582e1af',
email: '[email protected]',
mobile: '+1234567890',
status: 'disconnected'
})
};
fetch('https://api.example.com/connections/{connection_id}', 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.example.com/connections/{connection_id}",
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([
'customer_id' => '8a46e581-48ba-498a-9ad0-2ee72582e1af',
'email' => '[email protected]',
'mobile' => '+1234567890',
'status' => 'disconnected'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.example.com/connections/{connection_id}"
payload := strings.NewReader("{\n \"customer_id\": \"8a46e581-48ba-498a-9ad0-2ee72582e1af\",\n \"email\": \"[email protected]\",\n \"mobile\": \"+1234567890\",\n \"status\": \"disconnected\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.example.com/connections/{connection_id}")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"8a46e581-48ba-498a-9ad0-2ee72582e1af\",\n \"email\": \"[email protected]\",\n \"mobile\": \"+1234567890\",\n \"status\": \"disconnected\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/connections/{connection_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"8a46e581-48ba-498a-9ad0-2ee72582e1af\",\n \"email\": \"[email protected]\",\n \"mobile\": \"+1234567890\",\n \"status\": \"disconnected\"\n}"
response = http.request(request)
puts response.read_body{
"connection_id": "01J51S0JYV6N7K1030CV1ZKSCA",
"customer_id": "8a46e581-48ba-498a-9ad0-2ee72582e1af",
"retailer_id": "01J7SC0NN73R6F5VVSP3ZKPDA3",
"status": "active",
"email": "[email protected]",
"mobile": "+1234567890",
"tags": {
"campaign": "summer_sweeps"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Update Connection
Update a connection
curl --request PATCH \
--url https://api.example.com/connections/{connection_id} \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "8a46e581-48ba-498a-9ad0-2ee72582e1af",
"email": "[email protected]",
"mobile": "+1234567890",
"status": "disconnected"
}
'import requests
url = "https://api.example.com/connections/{connection_id}"
payload = {
"customer_id": "8a46e581-48ba-498a-9ad0-2ee72582e1af",
"email": "[email protected]",
"mobile": "+1234567890",
"status": "disconnected"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
customer_id: '8a46e581-48ba-498a-9ad0-2ee72582e1af',
email: '[email protected]',
mobile: '+1234567890',
status: 'disconnected'
})
};
fetch('https://api.example.com/connections/{connection_id}', 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.example.com/connections/{connection_id}",
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([
'customer_id' => '8a46e581-48ba-498a-9ad0-2ee72582e1af',
'email' => '[email protected]',
'mobile' => '+1234567890',
'status' => 'disconnected'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.example.com/connections/{connection_id}"
payload := strings.NewReader("{\n \"customer_id\": \"8a46e581-48ba-498a-9ad0-2ee72582e1af\",\n \"email\": \"[email protected]\",\n \"mobile\": \"+1234567890\",\n \"status\": \"disconnected\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.example.com/connections/{connection_id}")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"8a46e581-48ba-498a-9ad0-2ee72582e1af\",\n \"email\": \"[email protected]\",\n \"mobile\": \"+1234567890\",\n \"status\": \"disconnected\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/connections/{connection_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"8a46e581-48ba-498a-9ad0-2ee72582e1af\",\n \"email\": \"[email protected]\",\n \"mobile\": \"+1234567890\",\n \"status\": \"disconnected\"\n}"
response = http.request(request)
puts response.read_body{
"connection_id": "01J51S0JYV6N7K1030CV1ZKSCA",
"customer_id": "8a46e581-48ba-498a-9ad0-2ee72582e1af",
"retailer_id": "01J7SC0NN73R6F5VVSP3ZKPDA3",
"status": "active",
"email": "[email protected]",
"mobile": "+1234567890",
"tags": {
"campaign": "summer_sweeps"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Path Parameters
Body
A unique identifier used to map connections to customer records in external systems.
64"8a46e581-48ba-498a-9ad0-2ee72582e1af"
The customer's mobile phone number
16"+1234567890"
The new status of the connection. Currently can only be used to disconnect a connection.
disconnected "disconnected"
Response
Successful Response
A unique identifier for the connection
"01J51S0JYV6N7K1030CV1ZKSCA"
A unique identifier used to map connections to customer records in external systems.
"8a46e581-48ba-498a-9ad0-2ee72582e1af"
The unique identifier for the retailer in the connection
"01J7SC0NN73R6F5VVSP3ZKPDA3"
The status of the connection
active, initialized, unauthenticated, disconnected "active"
The customer's email address
The customer's mobile phone number
"+1234567890"
Client-defined attribution tags recorded when the connection is created, for grouping connection metrics — e.g. {"campaign": "summer_sweeps", "program": "loyalty"}. Names and values are opaque to Subtotal and are never interpreted. At most 10 tags; names up to 64 characters, values up to 256. Intended for campaign and source metadata — do not put consumer PII in tags.
Show child attributes
Show child attributes
{ "campaign": "summer_sweeps" }