Request
- Bash
- JS
- Java
- PHP
- Python
curl -X PUT -H 'Content-Type: application/json' \
-H 'Authorization: ApiKey-v1 953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676' \
-d '{
"coupon": "Coupon_10",
"state": "open"
}' 'https://developerdocs.talon.one/v1/customer_sessions/TEST-SESSION-ID-Coupon'
var TalonOne = require('talon-one')
var applicationKey = '953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676'
var client = new TalonOne.IntegrationClient('https://developerdocs.talon.one', applicationKey)
var sessionId = 'TEST-SESSION-ID-Coupon'
client.updateCustomerSession({
"coupon": "Coupon_10",
"state": "open"
}, function (err, integrationState) {
console.log(integrationState.profile)
console.log(integrationState.session)
console.log(integrationState.event)
});
import one.talon.api.*;
import one.talon.api.model.IntegrationState;
import one.talon.api.model.NewCustomerSession;
private static void updateSession(IntegrationApi api, NewCustomerSession session, final String sessionName) {
try {
IntegrationState response = api.updateCustomerSession(sessionName, session);
System.out.println(response.toString());
} catch (ApiException e) {
System.out.println(e.getResponseBody());
e.printStackTrace();
}
}
public static void main(String[] args) {
IntegrationApi integrationApi = new IntegrationApi();
IntegrationApiClient integrationClient = integrationApi.getApiClient();
integrationClient.setApplicationId("1");
integrationClient.setApplicationKey("953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676");
integrationClient.setBasePath("http://developerdocs.talon.one");
NewCustomerSession session = new NewCustomerSession();
session.setCoupon("Coupon_10");
updateSession(integrationApi, session, "TEST-SESSION-ID-Coupon");
}
$t = new TalonOne();
$t->subdomain = "developerdocs";
$t->applicationKey = "953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676";
$acceptCoupon = function($response, $args) {
$coupon = $args[0];
echo "acceptCoupon $coupon: ".print_r($response,true);
};
$rejectCoupon = function($response, $args) {
$coupon = $args[0];
echo "rejectCoupon $coupon: ".print_r($response,true);
};
$setDiscount = function($response, $args) {
// This is a good spot to update discount lines in the current cart
$label = $args[0];
$value = $args[1];
echo "setDiscount: $label $value ".print_r($response,true);
};
$response = $t->put("customer_sessions/TEST-SESSION-ID-Coupon", array(
'coupon' => 'Coupon_10',
'state' => 'open'
));
if (!$response) {
echo "Session update failed. Response: $response";
} else {
// Register all effects you want to handle
$t->processEffects($response, array(
'acceptCoupon' => $acceptCoupon,
'rejectCoupon' => $rejectCoupon,
'setDiscount' => $setDiscount)
);
}
# Fill in the details of your Talon.One Application here
application_key = '953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676'
talon = integration.Client('https://developerdocs.talon.one', application_key)
# When the customer adds an item to their cart
result = talon.update_customer_session("my_unique_session_id", {
"state": "open",
"coupon": "Coupon_10"
})
Request
- Bash
- JS
- Java
- PHP
- Python
curl -X PUT -H 'Content-Type: application/json' \
-H 'Authorization: ApiKey-v1 953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676' \
-d '{
"cartItems": [
{
"name": "Lipstick",
"sku": "Z4522A12E",
"quantity": selectable3,
"price": 29.99,
"category": "cosmetics"
}
],
"total": 89.97,
"state": "open"
}' 'https://developerdocs.talon.one/v1/customer_sessions/wpbhubhr6th'
var TalonOne = require('talon-one')
var applicationKey = '953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676'
var client = new TalonOne.IntegrationClient('https://developerdocs.talon.one', applicationKey)
var sessionId = 'TEST-SESSION-ID-Coupon'
client.updateCustomerSession({
"cartItems": [
{
"name": "Lipstick",
"sku": "Z4522A12E",
"quantity": selectable3,
"price": 29.99,
"category": "cosmetics"
}
],
"total": 89.97,
"state": "open"
}, function (err, integrationState) {
console.log(integrationState.profile)
console.log(integrationState.session)
console.log(integrationState.event)
});
import one.talon.api.*;
import one.talon.api.model.IntegrationState;
import one.talon.api.model.NewCustomerSession;
private static void updateSession(IntegrationApi api, NewCustomerSession session, final String sessionName) {
try {
IntegrationState response = api.updateCustomerSession(sessionName, session);
System.out.println(response.toString());
} catch (ApiException e) {
System.out.println(e.getResponseBody());
e.printStackTrace();
}
}
public static void main(String[] args) {
IntegrationApi integrationApi = new IntegrationApi();
IntegrationApiClient integrationClient = integrationApi.getApiClient();
integrationClient.setApplicationId("1");
integrationClient.setApplicationKey("953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676");
integrationClient.setBasePath("http://developerdocs.talon.one");
NewCustomerSession session = new NewCustomerSession();
session.setPayload( "cartItems": [
{
"name": "Lipstick",
"sku": "Z4522A12E",
"quantity": selectable3,
"price": 29.99,
"category": "cosmetics"
}
],
"total": 89.97,
"state": "open");
updateSession(integrationApi, session, "TEST-SESSION-ID-Coupon");
}
$t = new TalonOne();
$t->subdomain = "developerdocs";
$t->applicationKey = "953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676";
$acceptCoupon = function($response, $args) {
$coupon = $args[0];
echo "acceptCoupon $coupon: ".print_r($response,true);
};
$rejectCoupon = function($response, $args) {
$coupon = $args[0];
echo "rejectCoupon $coupon: ".print_r($response,true);
};
$setDiscount = function($response, $args) {
// This is a good spot to update discount lines in the current cart
$label = $args[0];
$value = $args[1];
echo "setDiscount: $label $value ".print_r($response,true);
};
$response = $t->put("customer_sessions/TEST-SESSION-ID-Coupon", array(
'cartItems' => [
{
'name' => 'Lipstick',
'sku' => 'Z4522A12E',
'quantity' => selectable3,
'price' => 29.99,
'category' => 'cosmetics'
}
],
'total' => 89.97,
'state' => 'open'
));
if (!$response) {
echo "Session update failed. Response: $response";
} else {
// Register all effects you want to handle
$t->processEffects($response, array(
'acceptCoupon' => $acceptCoupon,
'rejectCoupon' => $rejectCoupon,
'setDiscount' => $setDiscount)
);
}
# Fill in the details of your Talon.One Application here
application_key = '953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676'
talon = integration.Client('https://developerdocs.talon.one', application_key)
# When the customer adds an item to their cart
result = talon.update_customer_session("my_unique_session_id", {
"cartItems": [
{
"name": "Lipstick",
"sku": "Z4522A12E",
"quantity": selectable3,
"price": 29.99,
"category": "cosmetics"
}
],
"total": 89.97,
"state": "open"
})
Request
- Bash
- JS
- Java
- PHP
- Python
curl -X PUT -H 'Content-Type: application/json' \
-H 'Authorization: ApiKey-v1 953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676' \
-d '{
"total": selectable210,
"state": "open",
"attributes": {
"Destination_type": "Equatorial",
"CurrentLocation": {
"format": "point",
"object": "13.427540899999999,52.4979898"
}
}
}' 'https://developerdocs.talon.one/v1/customer_sessions/u85uu5tsreo'
var TalonOne = require('talon-one')
var applicationKey = '953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676'
var client = new TalonOne.IntegrationClient('https://developerdocs.talon.one', applicationKey)
var sessionId = 'TEST-SESSION-ID-Coupon'
client.updateCustomerSession({
"total": selectable210,
"state": "open",
"attributes": {
"Destination_type": "Equatorial",
"CurrentLocation": {
"format": "point",
"object": "13.427540899999999,52.4979898"
}
}
}, function (err, integrationState) {
console.log(integrationState.profile)
console.log(integrationState.session)
console.log(integrationState.event)
});
import one.talon.api.*;
import one.talon.api.model.IntegrationState;
import one.talon.api.model.NewCustomerSession;
private static void updateSession(IntegrationApi api, NewCustomerSession session, final String sessionName) {
try {
IntegrationState response = api.updateCustomerSession(sessionName, session);
System.out.println(response.toString());
} catch (ApiException e) {
System.out.println(e.getResponseBody());
e.printStackTrace();
}
}
public static void main(String[] args) {
IntegrationApi integrationApi = new IntegrationApi();
IntegrationApiClient integrationClient = integrationApi.getApiClient();
integrationClient.setApplicationId("1");
integrationClient.setApplicationKey("953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676");
integrationClient.setBasePath("http://developerdocs.talon.one");
NewCustomerSession session = new NewCustomerSession();
session.setPayload(
"total": selectable210,
"state": "open",
"attributes": {
"Destination_type": "Equatorial",
"CurrentLocation": {
"format": "point",
"object": "13.427540899999999,52.4979898"
}
}
);
updateSession(integrationApi, session, "TEST-SESSION-ID-Coupon");
}
$t = new TalonOne();
$t->subdomain = "developerdocs";
$t->applicationKey = "953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676";
$acceptCoupon = function($response, $args) {
$coupon = $args[0];
echo "acceptCoupon $coupon: ".print_r($response,true);
};
$rejectCoupon = function($response, $args) {
$coupon = $args[0];
echo "rejectCoupon $coupon: ".print_r($response,true);
};
$setDiscount = function($response, $args) {
// This is a good spot to update discount lines in the current cart
$label = $args[0];
$value = $args[1];
echo "setDiscount: $label $value ".print_r($response,true);
};
$response = $t->put("customer_sessions/TEST-SESSION-ID-Coupon", array(
"total" => selectable210,
"state" => "open",
"attributes" => {
"Destination_type" => "Equatorial",
"CurrentLocation" => {
"format" => "point",
"object" => "13.427540899999999,52.4979898"
}
}
));
if (!$response) {
echo "Session update failed. Response: $response";
} else {
// Register all effects you want to handle
$t->processEffects($response, array(
'acceptCoupon' => $acceptCoupon,
'rejectCoupon' => $rejectCoupon,
'setDiscount' => $setDiscount)
);
}
# Fill in the details of your Talon.One Application here
application_key = '953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676'
talon = integration.Client('https://developerdocs.talon.one', application_key)
# When the customer adds an item to their cart
result = talon.update_customer_session("my_unique_session_id", {
"total": selectable210,
"state": "open",
"attributes": {
"Destination_type": "Equatorial",
"CurrentLocation": {
"format": "point",
"object": "13.427540899999999,52.4979898"
}
}
})
Request
- Bash
- JS
- Java
- PHP
- Python
curl -X PUT -H 'Content-Type: application/json' \
-H 'Authorization: ApiKey-v1 953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676' \
-d '{
"referral": "selectableEEUF-JQ45",
"profileId": "friend",
"state": "open"
}' 'https://developerdocs.talon.one/v1/customer_sessions/stm5fm99hy'
var TalonOne = require('talon-one')
var applicationKey = '953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676'
var client = new TalonOne.IntegrationClient('https://developerdocs.talon.one', applicationKey)
var sessionId = 'TEST-SESSION-ID-Coupon'
client.updateCustomerSession({
"referral": "selectableEEUF-JQ45",
"profileId": "friend",
"state": "open"
}, function (err, integrationState) {
console.log(integrationState.profile)
console.log(integrationState.session)
console.log(integrationState.event)
});
import one.talon.api.*;
import one.talon.api.model.IntegrationState;
import one.talon.api.model.NewCustomerSession;
private static void updateSession(IntegrationApi api, NewCustomerSession session, final String sessionName) {
try {
IntegrationState response = api.updateCustomerSession(sessionName, session);
System.out.println(response.toString());
} catch (ApiException e) {
System.out.println(e.getResponseBody());
e.printStackTrace();
}
}
public static void main(String[] args) {
IntegrationApi integrationApi = new IntegrationApi();
IntegrationApiClient integrationClient = integrationApi.getApiClient();
integrationClient.setApplicationId("1");
integrationClient.setApplicationKey("953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676");
integrationClient.setBasePath("http://developerdocs.talon.one");
NewCustomerSession session = new NewCustomerSession();
session.setPayload(
"referral": "selectableEEUF-JQ45",
"profileId": "friend",
"state": "open"
);
updateSession(integrationApi, session, "TEST-SESSION-ID-Coupon");
}
$t = new TalonOne();
$t->subdomain = "developerdocs";
$t->applicationKey = "953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676";
$acceptCoupon = function($response, $args) {
$coupon = $args[0];
echo "acceptCoupon $coupon: ".print_r($response,true);
};
$rejectCoupon = function($response, $args) {
$coupon = $args[0];
echo "rejectCoupon $coupon: ".print_r($response,true);
};
$setDiscount = function($response, $args) {
// This is a good spot to update discount lines in the current cart
$label = $args[0];
$value = $args[1];
echo "setDiscount: $label $value ".print_r($response,true);
};
$response = $t->put("customer_sessions/TEST-SESSION-ID-Coupon", array(
"referral" => "selectableEEUF-JQ45",
"profileId" => "friend",
"state" => "open"
));
if (!$response) {
echo "Session update failed. Response: $response";
} else {
// Register all effects you want to handle
$t->processEffects($response, array(
'acceptCoupon' => $acceptCoupon,
'rejectCoupon' => $rejectCoupon,
'setDiscount' => $setDiscount)
);
}
# Fill in the details of your Talon.One Application here
application_key = '953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676'
talon = integration.Client('https://developerdocs.talon.one', application_key)
# When the customer adds an item to their cart
result = talon.update_customer_session("my_unique_session_id", {
"referral": "selectableEEUF-JQ45",
"profileId": "friend",
"state": "open"
})
Request
- Bash
- JS
- Java
- PHP
- Python
curl -X PUT -H 'Content-Type: application/json' \
-H 'Authorization: ApiKey-v1 953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676' \
-d '{
"attributes": {
"Ride_duration": selectable10,
"Ride_count": 6
},
"profileId": "loyaltyUser",
"state": "open"
}' 'https://developerdocs.talon.one/v1/customer_sessions/1yja3yon119h'
var TalonOne = require('talon-one')
var applicationKey = '953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676'
var client = new TalonOne.IntegrationClient('https://developerdocs.talon.one', applicationKey)
var sessionId = 'TEST-SESSION-ID-Coupon'
client.updateCustomerSession({
"attributes": {
"Ride_duration": selectable10,
"Ride_count": 6
},
"profileId": "loyaltyUser",
"state": "open"
}, function (err, integrationState) {
console.log(integrationState.profile)
console.log(integrationState.session)
console.log(integrationState.event)
});
import one.talon.api.*;
import one.talon.api.model.IntegrationState;
import one.talon.api.model.NewCustomerSession;
private static void updateSession(IntegrationApi api, NewCustomerSession session, final String sessionName) {
try {
IntegrationState response = api.updateCustomerSession(sessionName, session);
System.out.println(response.toString());
} catch (ApiException e) {
System.out.println(e.getResponseBody());
e.printStackTrace();
}
}
public static void main(String[] args) {
IntegrationApi integrationApi = new IntegrationApi();
IntegrationApiClient integrationClient = integrationApi.getApiClient();
integrationClient.setApplicationId("1");
integrationClient.setApplicationKey("953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676");
integrationClient.setBasePath("http://developerdocs.talon.one");
NewCustomerSession session = new NewCustomerSession();
session.setPayload(
"attributes": {
"Ride_duration": selectable10,
"Ride_count": 6
},
"profileId": "loyaltyUser",
"state": "open");
updateSession(integrationApi, session, "TEST-SESSION-ID-Coupon");
}
$t = new TalonOne();
$t->subdomain = "developerdocs";
$t->applicationKey = "953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676";
$acceptCoupon = function($response, $args) {
$coupon = $args[0];
echo "acceptCoupon $coupon: ".print_r($response,true);
};
$rejectCoupon = function($response, $args) {
$coupon = $args[0];
echo "rejectCoupon $coupon: ".print_r($response,true);
};
$setDiscount = function($response, $args) {
// This is a good spot to update discount lines in the current cart
$label = $args[0];
$value = $args[1];
echo "setDiscount: $label $value ".print_r($response,true);
};
$response = $t->put("customer_sessions/TEST-SESSION-ID-Coupon", array(
"attributes" => {
"Ride_duration" => selectable10,
"Ride_count" => 6
},
"profileId" => "loyaltyUser",
"state" => "open"
));
if (!$response) {
echo "Session update failed. Response: $response";
} else {
// Register all effects you want to handle
$t->processEffects($response, array(
'acceptCoupon' => $acceptCoupon,
'rejectCoupon' => $rejectCoupon,
'setDiscount' => $setDiscount)
);
}
# Fill in the details of your Talon.One Application here
application_key = '953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676'
talon = integration.Client('https://developerdocs.talon.one', application_key)
# When the customer adds an item to their cart
result = talon.update_customer_session("my_unique_session_id", {
"attributes": {
"Ride_duration": selectable10,
"Ride_count": 6
},
"profileId": "loyaltyUser",
"state": "open"
})
Request
- Bash
- JS
- Java
- PHP
- Python
curl -X PUT -H 'Content-Type: application/json' \
-H 'Authorization: ApiKey-v1 953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676' \
-d '{
"attributes": {
"Spending": true
},
"profileId": "loyaltyUser",
"state": "open"
}' 'https://developerdocs.talon.one/v1/customer_sessions/3842dr00za2'
var TalonOne = require('talon-one')
var applicationKey = '953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676'
var client = new TalonOne.IntegrationClient('https://developerdocs.talon.one', applicationKey)
var sessionId = 'TEST-SESSION-ID-Coupon'
client.updateCustomerSession({
"attributes": {
"Spending": true
},
"profileId": "loyaltyUser",
"state": "open"
}, function (err, integrationState) {
console.log(integrationState.profile)
console.log(integrationState.session)
console.log(integrationState.event)
});
import one.talon.api.*;
import one.talon.api.model.IntegrationState;
import one.talon.api.model.NewCustomerSession;
private static void updateSession(IntegrationApi api, NewCustomerSession session, final String sessionName) {
try {
IntegrationState response = api.updateCustomerSession(sessionName, session);
System.out.println(response.toString());
} catch (ApiException e) {
System.out.println(e.getResponseBody());
e.printStackTrace();
}
}
public static void main(String[] args) {
IntegrationApi integrationApi = new IntegrationApi();
IntegrationApiClient integrationClient = integrationApi.getApiClient();
integrationClient.setApplicationId("1");
integrationClient.setApplicationKey("953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676");
integrationClient.setBasePath("http://developerdocs.talon.one");
NewCustomerSession session = new NewCustomerSession();
session.setPayload(
"attributes": {
"Spending": true
},
"profileId": "loyaltyUser",
"state": "open");
updateSession(integrationApi, session, "TEST-SESSION-ID-Coupon");
}
$t = new TalonOne();
$t->subdomain = "developerdocs";
$t->applicationKey = "953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676";
$acceptCoupon = function($response, $args) {
$coupon = $args[0];
echo "acceptCoupon $coupon: ".print_r($response,true);
};
$rejectCoupon = function($response, $args) {
$coupon = $args[0];
echo "rejectCoupon $coupon: ".print_r($response,true);
};
$setDiscount = function($response, $args) {
// This is a good spot to update discount lines in the current cart
$label = $args[0];
$value = $args[1];
echo "setDiscount: $label $value ".print_r($response,true);
};
$response = $t->put("customer_sessions/TEST-SESSION-ID-Coupon", array(
'attributes' => {
'Spending' => true
},
'profileId' => 'loyaltyUser',
'state' => 'open'
));
if (!$response) {
echo "Session update failed. Response: $response";
} else {
// Register all effects you want to handle
$t->processEffects($response, array(
'acceptCoupon' => $acceptCoupon,
'rejectCoupon' => $rejectCoupon,
'setDiscount' => $setDiscount)
);
}
# Fill in the details of your Talon.One Application here
application_key = '953f4d85715c479a30b9ac0592495b576ee90dfc7671a53a7ed440225cb48676'
talon = integration.Client('https://developerdocs.talon.one', application_key)
# When the customer adds an item to their cart
result = talon.update_customer_session("my_unique_session_id", {
"attributes": {
"Spending": true
},
"profileId": "loyaltyUser",
"state": "open"
})
Response
Effects
Full Response