Confirms the cart and returns the payment page URL
curl --request POST \
--url https://{apiBaseUrl}/v1/{sessionId}/cart/confirm \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"shopper": {
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address": {
"countryCode": "<string>",
"address": "<string>",
"postalCode": "<string>",
"city": "<string>"
},
"phoneCode": "<string>"
},
"confirmationUrl": "<string>"
}
'const url = 'https://{apiBaseUrl}/v1/{sessionId}/cart/confirm';
const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
shopper: {
firstName: '<string>',
lastName: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
address: {
countryCode: '<string>',
address: '<string>',
postalCode: '<string>',
city: '<string>'
},
phoneCode: '<string>'
},
confirmationUrl: '<string>'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://{apiBaseUrl}/v1/{sessionId}/cart/confirm"
payload = {
"shopper": {
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address": {
"countryCode": "<string>",
"address": "<string>",
"postalCode": "<string>",
"city": "<string>"
},
"phoneCode": "<string>"
},
"confirmationUrl": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{apiBaseUrl}/v1/{sessionId}/cart/confirm",
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([
'shopper' => [
'firstName' => '<string>',
'lastName' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'address' => [
'countryCode' => '<string>',
'address' => '<string>',
'postalCode' => '<string>',
'city' => '<string>'
],
'phoneCode' => '<string>'
],
'confirmationUrl' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}using RestSharp;
var options = new RestClientOptions("https://{apiBaseUrl}/v1/{sessionId}/cart/confirm");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-API-KEY", "<api-key>");
request.AddJsonBody("{\n \"shopper\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address\": {\n \"countryCode\": \"<string>\",\n \"address\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\"\n },\n \"phoneCode\": \"<string>\"\n },\n \"confirmationUrl\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://{apiBaseUrl}/v1/{sessionId}/cart/confirm")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"shopper\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address\": {\n \"countryCode\": \"<string>\",\n \"address\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\"\n },\n \"phoneCode\": \"<string>\"\n },\n \"confirmationUrl\": \"<string>\"\n}")
.asString();{
"redirectUrl": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Cart
Confirm the cart
Confirms the cart and returns the redirect URL to the payment page
POST
/
v1
/
{sessionId}
/
cart
/
confirm
Confirms the cart and returns the payment page URL
curl --request POST \
--url https://{apiBaseUrl}/v1/{sessionId}/cart/confirm \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"shopper": {
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address": {
"countryCode": "<string>",
"address": "<string>",
"postalCode": "<string>",
"city": "<string>"
},
"phoneCode": "<string>"
},
"confirmationUrl": "<string>"
}
'const url = 'https://{apiBaseUrl}/v1/{sessionId}/cart/confirm';
const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
shopper: {
firstName: '<string>',
lastName: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
address: {
countryCode: '<string>',
address: '<string>',
postalCode: '<string>',
city: '<string>'
},
phoneCode: '<string>'
},
confirmationUrl: '<string>'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://{apiBaseUrl}/v1/{sessionId}/cart/confirm"
payload = {
"shopper": {
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address": {
"countryCode": "<string>",
"address": "<string>",
"postalCode": "<string>",
"city": "<string>"
},
"phoneCode": "<string>"
},
"confirmationUrl": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{apiBaseUrl}/v1/{sessionId}/cart/confirm",
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([
'shopper' => [
'firstName' => '<string>',
'lastName' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'address' => [
'countryCode' => '<string>',
'address' => '<string>',
'postalCode' => '<string>',
'city' => '<string>'
],
'phoneCode' => '<string>'
],
'confirmationUrl' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}using RestSharp;
var options = new RestClientOptions("https://{apiBaseUrl}/v1/{sessionId}/cart/confirm");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-API-KEY", "<api-key>");
request.AddJsonBody("{\n \"shopper\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address\": {\n \"countryCode\": \"<string>\",\n \"address\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\"\n },\n \"phoneCode\": \"<string>\"\n },\n \"confirmationUrl\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://{apiBaseUrl}/v1/{sessionId}/cart/confirm")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"shopper\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address\": {\n \"countryCode\": \"<string>\",\n \"address\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\"\n },\n \"phoneCode\": \"<string>\"\n },\n \"confirmationUrl\": \"<string>\"\n}")
.asString();{
"redirectUrl": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Was this page helpful?