Save customer information to cart and appointments
curl --request POST \
--url https://api.opencals.com/storefront/cart/checkout/save-customer \
--header 'Content-Type: application/json' \
--header 'X-Cart-Id: <x-cart-id>' \
--data '
{
"customer": {
"customerId": "123e4567-e89b-12d3-a456-426614174004",
"firstName": "<string>",
"lastName": "<string>",
"phone": "<string>",
"billingAddress": {
"firstName": "John",
"lastName": "Smith",
"companyName": "Acme Inc.",
"companyVatNumber": "GB123456789",
"addressLine1": "123 Main Street",
"addressLine2": "Suite 456",
"city": "New York",
"state": "NY",
"postalCode": "10001",
"country": "US"
}
}
}
'import requests
url = "https://api.opencals.com/storefront/cart/checkout/save-customer"
payload = { "customer": {
"customerId": "123e4567-e89b-12d3-a456-426614174004",
"firstName": "<string>",
"lastName": "<string>",
"phone": "<string>",
"billingAddress": {
"firstName": "John",
"lastName": "Smith",
"companyName": "Acme Inc.",
"companyVatNumber": "GB123456789",
"addressLine1": "123 Main Street",
"addressLine2": "Suite 456",
"city": "New York",
"state": "NY",
"postalCode": "10001",
"country": "US"
}
} }
headers = {
"X-Cart-Id": "<x-cart-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Cart-Id': '<x-cart-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: {
customerId: '123e4567-e89b-12d3-a456-426614174004',
firstName: '<string>',
lastName: '<string>',
phone: '<string>',
billingAddress: {
firstName: 'John',
lastName: 'Smith',
companyName: 'Acme Inc.',
companyVatNumber: 'GB123456789',
addressLine1: '123 Main Street',
addressLine2: 'Suite 456',
city: 'New York',
state: 'NY',
postalCode: '10001',
country: 'US'
}
}
})
};
fetch('https://api.opencals.com/storefront/cart/checkout/save-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.opencals.com/storefront/cart/checkout/save-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([
'customer' => [
'customerId' => '123e4567-e89b-12d3-a456-426614174004',
'firstName' => '<string>',
'lastName' => '<string>',
'phone' => '<string>',
'billingAddress' => [
'firstName' => 'John',
'lastName' => 'Smith',
'companyName' => 'Acme Inc.',
'companyVatNumber' => 'GB123456789',
'addressLine1' => '123 Main Street',
'addressLine2' => 'Suite 456',
'city' => 'New York',
'state' => 'NY',
'postalCode' => '10001',
'country' => 'US'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Cart-Id: <x-cart-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.opencals.com/storefront/cart/checkout/save-customer"
payload := strings.NewReader("{\n \"customer\": {\n \"customerId\": \"123e4567-e89b-12d3-a456-426614174004\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phone\": \"<string>\",\n \"billingAddress\": {\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"companyName\": \"Acme Inc.\",\n \"companyVatNumber\": \"GB123456789\",\n \"addressLine1\": \"123 Main Street\",\n \"addressLine2\": \"Suite 456\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postalCode\": \"10001\",\n \"country\": \"US\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Cart-Id", "<x-cart-id>")
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.opencals.com/storefront/cart/checkout/save-customer")
.header("X-Cart-Id", "<x-cart-id>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"customerId\": \"123e4567-e89b-12d3-a456-426614174004\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phone\": \"<string>\",\n \"billingAddress\": {\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"companyName\": \"Acme Inc.\",\n \"companyVatNumber\": \"GB123456789\",\n \"addressLine1\": \"123 Main Street\",\n \"addressLine2\": \"Suite 456\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postalCode\": \"10001\",\n \"country\": \"US\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opencals.com/storefront/cart/checkout/save-customer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Cart-Id"] = '<x-cart-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": {\n \"customerId\": \"123e4567-e89b-12d3-a456-426614174004\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phone\": \"<string>\",\n \"billingAddress\": {\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"companyName\": \"Acme Inc.\",\n \"companyVatNumber\": \"GB123456789\",\n \"addressLine1\": \"123 Main Street\",\n \"addressLine2\": \"Suite 456\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postalCode\": \"10001\",\n \"country\": \"US\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"customerId": "<string>"
}Checkout
Save customer information to cart and appointments
POST
/
storefront
/
cart
/
checkout
/
save-customer
Save customer information to cart and appointments
curl --request POST \
--url https://api.opencals.com/storefront/cart/checkout/save-customer \
--header 'Content-Type: application/json' \
--header 'X-Cart-Id: <x-cart-id>' \
--data '
{
"customer": {
"customerId": "123e4567-e89b-12d3-a456-426614174004",
"firstName": "<string>",
"lastName": "<string>",
"phone": "<string>",
"billingAddress": {
"firstName": "John",
"lastName": "Smith",
"companyName": "Acme Inc.",
"companyVatNumber": "GB123456789",
"addressLine1": "123 Main Street",
"addressLine2": "Suite 456",
"city": "New York",
"state": "NY",
"postalCode": "10001",
"country": "US"
}
}
}
'import requests
url = "https://api.opencals.com/storefront/cart/checkout/save-customer"
payload = { "customer": {
"customerId": "123e4567-e89b-12d3-a456-426614174004",
"firstName": "<string>",
"lastName": "<string>",
"phone": "<string>",
"billingAddress": {
"firstName": "John",
"lastName": "Smith",
"companyName": "Acme Inc.",
"companyVatNumber": "GB123456789",
"addressLine1": "123 Main Street",
"addressLine2": "Suite 456",
"city": "New York",
"state": "NY",
"postalCode": "10001",
"country": "US"
}
} }
headers = {
"X-Cart-Id": "<x-cart-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Cart-Id': '<x-cart-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: {
customerId: '123e4567-e89b-12d3-a456-426614174004',
firstName: '<string>',
lastName: '<string>',
phone: '<string>',
billingAddress: {
firstName: 'John',
lastName: 'Smith',
companyName: 'Acme Inc.',
companyVatNumber: 'GB123456789',
addressLine1: '123 Main Street',
addressLine2: 'Suite 456',
city: 'New York',
state: 'NY',
postalCode: '10001',
country: 'US'
}
}
})
};
fetch('https://api.opencals.com/storefront/cart/checkout/save-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.opencals.com/storefront/cart/checkout/save-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([
'customer' => [
'customerId' => '123e4567-e89b-12d3-a456-426614174004',
'firstName' => '<string>',
'lastName' => '<string>',
'phone' => '<string>',
'billingAddress' => [
'firstName' => 'John',
'lastName' => 'Smith',
'companyName' => 'Acme Inc.',
'companyVatNumber' => 'GB123456789',
'addressLine1' => '123 Main Street',
'addressLine2' => 'Suite 456',
'city' => 'New York',
'state' => 'NY',
'postalCode' => '10001',
'country' => 'US'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Cart-Id: <x-cart-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.opencals.com/storefront/cart/checkout/save-customer"
payload := strings.NewReader("{\n \"customer\": {\n \"customerId\": \"123e4567-e89b-12d3-a456-426614174004\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phone\": \"<string>\",\n \"billingAddress\": {\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"companyName\": \"Acme Inc.\",\n \"companyVatNumber\": \"GB123456789\",\n \"addressLine1\": \"123 Main Street\",\n \"addressLine2\": \"Suite 456\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postalCode\": \"10001\",\n \"country\": \"US\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Cart-Id", "<x-cart-id>")
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.opencals.com/storefront/cart/checkout/save-customer")
.header("X-Cart-Id", "<x-cart-id>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"customerId\": \"123e4567-e89b-12d3-a456-426614174004\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phone\": \"<string>\",\n \"billingAddress\": {\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"companyName\": \"Acme Inc.\",\n \"companyVatNumber\": \"GB123456789\",\n \"addressLine1\": \"123 Main Street\",\n \"addressLine2\": \"Suite 456\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postalCode\": \"10001\",\n \"country\": \"US\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opencals.com/storefront/cart/checkout/save-customer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Cart-Id"] = '<x-cart-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": {\n \"customerId\": \"123e4567-e89b-12d3-a456-426614174004\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"phone\": \"<string>\",\n \"billingAddress\": {\n \"firstName\": \"John\",\n \"lastName\": \"Smith\",\n \"companyName\": \"Acme Inc.\",\n \"companyVatNumber\": \"GB123456789\",\n \"addressLine1\": \"123 Main Street\",\n \"addressLine2\": \"Suite 456\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postalCode\": \"10001\",\n \"country\": \"US\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"customerId": "<string>"
}Last modified on September 7, 2026
Was this page helpful?