curl --request PATCH \
--url https://api.example.com/simulated-connections/{connection_id} \
--header 'Content-Type: application/json' \
--data '
{
"status": "unauthenticated"
}
'import requests
url = "https://api.example.com/simulated-connections/{connection_id}"
payload = { "status": "unauthenticated" }
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({status: 'unauthenticated'})
};
fetch('https://api.example.com/simulated-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/simulated-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([
'status' => 'unauthenticated'
]),
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/simulated-connections/{connection_id}"
payload := strings.NewReader("{\n \"status\": \"unauthenticated\"\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/simulated-connections/{connection_id}")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"unauthenticated\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/simulated-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 \"status\": \"unauthenticated\"\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",
"creation_date": "2024-08-13T17:27:57.913Z",
"tags": {
"campaign": "summer_sweeps"
},
"is_simulated": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Set Simulated Status
Set one of your simulated connections to active or unauthenticated and emit the matching connection event to your webhooks, marked is_simulated. Setting the status it already has emits the event again.
curl --request PATCH \
--url https://api.example.com/simulated-connections/{connection_id} \
--header 'Content-Type: application/json' \
--data '
{
"status": "unauthenticated"
}
'import requests
url = "https://api.example.com/simulated-connections/{connection_id}"
payload = { "status": "unauthenticated" }
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({status: 'unauthenticated'})
};
fetch('https://api.example.com/simulated-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/simulated-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([
'status' => 'unauthenticated'
]),
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/simulated-connections/{connection_id}"
payload := strings.NewReader("{\n \"status\": \"unauthenticated\"\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/simulated-connections/{connection_id}")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"unauthenticated\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/simulated-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 \"status\": \"unauthenticated\"\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",
"creation_date": "2024-08-13T17:27:57.913Z",
"tags": {
"campaign": "summer_sweeps"
},
"is_simulated": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}active or unauthenticated and sends connection.activated or connection.unauthenticated to webhook destinations that accept simulated events. Use it to test how your integration handles a shopper losing and regaining their retailer login. Setting the status it already has sends the event again.
Other statuses return 422. Real connections never change: a real, deleted or unknown connection returns 404.
Call it with your API key, or with a Subtotal Connector OAuth token that includes simulator:write. A token without it receives 403 insufficient_scope. Partner app tokens don’t include it.Path Parameters
Body
unauthenticated emits connection.unauthenticated, as when a consumer's retailer login expires; active emits connection.activated, as when they reconnect
active, unauthenticated "unauthenticated"
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"
When the connection was created
"2024-08-13T17:27:57.913Z"
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" }
True for a test connection made with the event simulator. Its events are marked is_simulated too, and it never collects real purchases.
false