curl --request POST \
--url https://firespark.cloud/api/storefront/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"is_anonymous": false,
"name": "John Smith",
"email": "jsmith@example.com",
"status": "ACTIVE",
"dob": "2023-11-07T05:31:56Z",
"document_type": "<string>",
"document_number": "<string>",
"country": "<string>",
"phone": "+593 99 123 4567",
"registration_date": "2023-11-07T05:31:56Z",
"devices": [
{}
],
"delivery_addresses": [
{
"alias": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"reference": "<string>",
"latitude": 0,
"longitude": 0,
"instructions": "<string>",
"preferred": false,
"metadata": {}
}
],
"billing_profiles": [
{
"alias": "<string>",
"legal_name": "<string>",
"address_line1": "<string>",
"tax_id": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"preferred": false,
"metadata": {}
}
],
"consent": {
"email": false,
"push_notifications": false,
"in_app_messages": false,
"phone_calls": false,
"sms": false,
"whatsapp": false
},
"metadata": {}
}
'import requests
url = "https://firespark.cloud/api/storefront/v1/customers"
payload = {
"id": "<string>",
"is_anonymous": False,
"name": "John Smith",
"email": "jsmith@example.com",
"status": "ACTIVE",
"dob": "2023-11-07T05:31:56Z",
"document_type": "<string>",
"document_number": "<string>",
"country": "<string>",
"phone": "+593 99 123 4567",
"registration_date": "2023-11-07T05:31:56Z",
"devices": [{}],
"delivery_addresses": [
{
"alias": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"reference": "<string>",
"latitude": 0,
"longitude": 0,
"instructions": "<string>",
"preferred": False,
"metadata": {}
}
],
"billing_profiles": [
{
"alias": "<string>",
"legal_name": "<string>",
"address_line1": "<string>",
"tax_id": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"preferred": False,
"metadata": {}
}
],
"consent": {
"email": False,
"push_notifications": False,
"in_app_messages": False,
"phone_calls": False,
"sms": False,
"whatsapp": False
},
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '<string>',
is_anonymous: false,
name: 'John Smith',
email: 'jsmith@example.com',
status: 'ACTIVE',
dob: '2023-11-07T05:31:56Z',
document_type: '<string>',
document_number: '<string>',
country: '<string>',
phone: '+593 99 123 4567',
registration_date: '2023-11-07T05:31:56Z',
devices: [{}],
delivery_addresses: [
{
alias: '<string>',
address_line1: '<string>',
address_line2: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>',
reference: '<string>',
latitude: 0,
longitude: 0,
instructions: '<string>',
preferred: false,
metadata: {}
}
],
billing_profiles: [
{
alias: '<string>',
legal_name: '<string>',
address_line1: '<string>',
tax_id: '<string>',
address_line2: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>',
preferred: false,
metadata: {}
}
],
consent: {
email: false,
push_notifications: false,
in_app_messages: false,
phone_calls: false,
sms: false,
whatsapp: false
},
metadata: {}
})
};
fetch('https://firespark.cloud/api/storefront/v1/customers', 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://firespark.cloud/api/storefront/v1/customers",
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([
'id' => '<string>',
'is_anonymous' => false,
'name' => 'John Smith',
'email' => 'jsmith@example.com',
'status' => 'ACTIVE',
'dob' => '2023-11-07T05:31:56Z',
'document_type' => '<string>',
'document_number' => '<string>',
'country' => '<string>',
'phone' => '+593 99 123 4567',
'registration_date' => '2023-11-07T05:31:56Z',
'devices' => [
[
]
],
'delivery_addresses' => [
[
'alias' => '<string>',
'address_line1' => '<string>',
'address_line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>',
'reference' => '<string>',
'latitude' => 0,
'longitude' => 0,
'instructions' => '<string>',
'preferred' => false,
'metadata' => [
]
]
],
'billing_profiles' => [
[
'alias' => '<string>',
'legal_name' => '<string>',
'address_line1' => '<string>',
'tax_id' => '<string>',
'address_line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>',
'preferred' => false,
'metadata' => [
]
]
],
'consent' => [
'email' => false,
'push_notifications' => false,
'in_app_messages' => false,
'phone_calls' => false,
'sms' => false,
'whatsapp' => false
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://firespark.cloud/api/storefront/v1/customers"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"is_anonymous\": false,\n \"name\": \"John Smith\",\n \"email\": \"jsmith@example.com\",\n \"status\": \"ACTIVE\",\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"+593 99 123 4567\",\n \"registration_date\": \"2023-11-07T05:31:56Z\",\n \"devices\": [\n {}\n ],\n \"delivery_addresses\": [\n {\n \"alias\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"reference\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"instructions\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"billing_profiles\": [\n {\n \"alias\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"tax_id\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"consent\": {\n \"email\": false,\n \"push_notifications\": false,\n \"in_app_messages\": false,\n \"phone_calls\": false,\n \"sms\": false,\n \"whatsapp\": false\n },\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://firespark.cloud/api/storefront/v1/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"is_anonymous\": false,\n \"name\": \"John Smith\",\n \"email\": \"jsmith@example.com\",\n \"status\": \"ACTIVE\",\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"+593 99 123 4567\",\n \"registration_date\": \"2023-11-07T05:31:56Z\",\n \"devices\": [\n {}\n ],\n \"delivery_addresses\": [\n {\n \"alias\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"reference\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"instructions\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"billing_profiles\": [\n {\n \"alias\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"tax_id\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"consent\": {\n \"email\": false,\n \"push_notifications\": false,\n \"in_app_messages\": false,\n \"phone_calls\": false,\n \"sms\": false,\n \"whatsapp\": false\n },\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://firespark.cloud/api/storefront/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"is_anonymous\": false,\n \"name\": \"John Smith\",\n \"email\": \"jsmith@example.com\",\n \"status\": \"ACTIVE\",\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"+593 99 123 4567\",\n \"registration_date\": \"2023-11-07T05:31:56Z\",\n \"devices\": [\n {}\n ],\n \"delivery_addresses\": [\n {\n \"alias\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"reference\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"instructions\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"billing_profiles\": [\n {\n \"alias\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"tax_id\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"consent\": {\n \"email\": false,\n \"push_notifications\": false,\n \"in_app_messages\": false,\n \"phone_calls\": false,\n \"sms\": false,\n \"whatsapp\": false\n },\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "<string>",
"name": "John Smith",
"registration_date": "2023-11-07T05:31:56Z",
"is_anonymous": false,
"email": "jsmith@example.com",
"email_verified": false,
"dob": "2023-11-07T05:31:56Z",
"document_type": "<string>",
"document_number": "<string>",
"country": "<string>",
"phone": "+593 99 123 4567",
"phone_verified": false,
"devices": [
{
"id": "<string>",
"fcm_token": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"delivery_addresses": [
{
"alias": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"reference": "<string>",
"latitude": 0,
"longitude": 0,
"instructions": "<string>",
"preferred": false,
"metadata": {}
}
],
"billing_profiles": [
{
"alias": "<string>",
"legal_name": "<string>",
"address_line1": "<string>",
"tax_id": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"preferred": false,
"metadata": {}
}
],
"consent": {
"email": false,
"push_notifications": false,
"in_app_messages": false,
"phone_calls": false,
"sms": false,
"whatsapp": false
},
"metadata": {}
}
}{
"error": "<string>",
"details": "<string>"
}Register customer
Create a customer record for the authenticated user after token exchange.
curl --request POST \
--url https://firespark.cloud/api/storefront/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"is_anonymous": false,
"name": "John Smith",
"email": "jsmith@example.com",
"status": "ACTIVE",
"dob": "2023-11-07T05:31:56Z",
"document_type": "<string>",
"document_number": "<string>",
"country": "<string>",
"phone": "+593 99 123 4567",
"registration_date": "2023-11-07T05:31:56Z",
"devices": [
{}
],
"delivery_addresses": [
{
"alias": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"reference": "<string>",
"latitude": 0,
"longitude": 0,
"instructions": "<string>",
"preferred": false,
"metadata": {}
}
],
"billing_profiles": [
{
"alias": "<string>",
"legal_name": "<string>",
"address_line1": "<string>",
"tax_id": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"preferred": false,
"metadata": {}
}
],
"consent": {
"email": false,
"push_notifications": false,
"in_app_messages": false,
"phone_calls": false,
"sms": false,
"whatsapp": false
},
"metadata": {}
}
'import requests
url = "https://firespark.cloud/api/storefront/v1/customers"
payload = {
"id": "<string>",
"is_anonymous": False,
"name": "John Smith",
"email": "jsmith@example.com",
"status": "ACTIVE",
"dob": "2023-11-07T05:31:56Z",
"document_type": "<string>",
"document_number": "<string>",
"country": "<string>",
"phone": "+593 99 123 4567",
"registration_date": "2023-11-07T05:31:56Z",
"devices": [{}],
"delivery_addresses": [
{
"alias": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"reference": "<string>",
"latitude": 0,
"longitude": 0,
"instructions": "<string>",
"preferred": False,
"metadata": {}
}
],
"billing_profiles": [
{
"alias": "<string>",
"legal_name": "<string>",
"address_line1": "<string>",
"tax_id": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"preferred": False,
"metadata": {}
}
],
"consent": {
"email": False,
"push_notifications": False,
"in_app_messages": False,
"phone_calls": False,
"sms": False,
"whatsapp": False
},
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '<string>',
is_anonymous: false,
name: 'John Smith',
email: 'jsmith@example.com',
status: 'ACTIVE',
dob: '2023-11-07T05:31:56Z',
document_type: '<string>',
document_number: '<string>',
country: '<string>',
phone: '+593 99 123 4567',
registration_date: '2023-11-07T05:31:56Z',
devices: [{}],
delivery_addresses: [
{
alias: '<string>',
address_line1: '<string>',
address_line2: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>',
reference: '<string>',
latitude: 0,
longitude: 0,
instructions: '<string>',
preferred: false,
metadata: {}
}
],
billing_profiles: [
{
alias: '<string>',
legal_name: '<string>',
address_line1: '<string>',
tax_id: '<string>',
address_line2: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>',
preferred: false,
metadata: {}
}
],
consent: {
email: false,
push_notifications: false,
in_app_messages: false,
phone_calls: false,
sms: false,
whatsapp: false
},
metadata: {}
})
};
fetch('https://firespark.cloud/api/storefront/v1/customers', 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://firespark.cloud/api/storefront/v1/customers",
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([
'id' => '<string>',
'is_anonymous' => false,
'name' => 'John Smith',
'email' => 'jsmith@example.com',
'status' => 'ACTIVE',
'dob' => '2023-11-07T05:31:56Z',
'document_type' => '<string>',
'document_number' => '<string>',
'country' => '<string>',
'phone' => '+593 99 123 4567',
'registration_date' => '2023-11-07T05:31:56Z',
'devices' => [
[
]
],
'delivery_addresses' => [
[
'alias' => '<string>',
'address_line1' => '<string>',
'address_line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>',
'reference' => '<string>',
'latitude' => 0,
'longitude' => 0,
'instructions' => '<string>',
'preferred' => false,
'metadata' => [
]
]
],
'billing_profiles' => [
[
'alias' => '<string>',
'legal_name' => '<string>',
'address_line1' => '<string>',
'tax_id' => '<string>',
'address_line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>',
'preferred' => false,
'metadata' => [
]
]
],
'consent' => [
'email' => false,
'push_notifications' => false,
'in_app_messages' => false,
'phone_calls' => false,
'sms' => false,
'whatsapp' => false
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://firespark.cloud/api/storefront/v1/customers"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"is_anonymous\": false,\n \"name\": \"John Smith\",\n \"email\": \"jsmith@example.com\",\n \"status\": \"ACTIVE\",\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"+593 99 123 4567\",\n \"registration_date\": \"2023-11-07T05:31:56Z\",\n \"devices\": [\n {}\n ],\n \"delivery_addresses\": [\n {\n \"alias\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"reference\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"instructions\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"billing_profiles\": [\n {\n \"alias\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"tax_id\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"consent\": {\n \"email\": false,\n \"push_notifications\": false,\n \"in_app_messages\": false,\n \"phone_calls\": false,\n \"sms\": false,\n \"whatsapp\": false\n },\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://firespark.cloud/api/storefront/v1/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"is_anonymous\": false,\n \"name\": \"John Smith\",\n \"email\": \"jsmith@example.com\",\n \"status\": \"ACTIVE\",\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"+593 99 123 4567\",\n \"registration_date\": \"2023-11-07T05:31:56Z\",\n \"devices\": [\n {}\n ],\n \"delivery_addresses\": [\n {\n \"alias\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"reference\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"instructions\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"billing_profiles\": [\n {\n \"alias\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"tax_id\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"consent\": {\n \"email\": false,\n \"push_notifications\": false,\n \"in_app_messages\": false,\n \"phone_calls\": false,\n \"sms\": false,\n \"whatsapp\": false\n },\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://firespark.cloud/api/storefront/v1/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"is_anonymous\": false,\n \"name\": \"John Smith\",\n \"email\": \"jsmith@example.com\",\n \"status\": \"ACTIVE\",\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"+593 99 123 4567\",\n \"registration_date\": \"2023-11-07T05:31:56Z\",\n \"devices\": [\n {}\n ],\n \"delivery_addresses\": [\n {\n \"alias\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"reference\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"instructions\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"billing_profiles\": [\n {\n \"alias\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"tax_id\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"consent\": {\n \"email\": false,\n \"push_notifications\": false,\n \"in_app_messages\": false,\n \"phone_calls\": false,\n \"sms\": false,\n \"whatsapp\": false\n },\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "<string>",
"name": "John Smith",
"registration_date": "2023-11-07T05:31:56Z",
"is_anonymous": false,
"email": "jsmith@example.com",
"email_verified": false,
"dob": "2023-11-07T05:31:56Z",
"document_type": "<string>",
"document_number": "<string>",
"country": "<string>",
"phone": "+593 99 123 4567",
"phone_verified": false,
"devices": [
{
"id": "<string>",
"fcm_token": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"delivery_addresses": [
{
"alias": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"reference": "<string>",
"latitude": 0,
"longitude": 0,
"instructions": "<string>",
"preferred": false,
"metadata": {}
}
],
"billing_profiles": [
{
"alias": "<string>",
"legal_name": "<string>",
"address_line1": "<string>",
"tax_id": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"preferred": false,
"metadata": {}
}
],
"consent": {
"email": false,
"push_notifications": false,
"in_app_messages": false,
"phone_calls": false,
"sms": false,
"whatsapp": false
},
"metadata": {}
}
}{
"error": "<string>",
"details": "<string>"
}id in the request body must match the sub claim from the customer’s OIDC ID token (the same value bound to the access token).
Request body
| Field | Required | Description |
|---|---|---|
id | Yes | External customer identifier. Must match the token’s customer id. |
is_anonymous | No | Set to true for guest checkout. Defaults to false. |
name | Yes* | Full name. Not required when is_anonymous is true. |
email | Yes* | Email address. Not required when is_anonymous is true. |
status | No | ACTIVE or INACTIVE. Defaults to ACTIVE. |
gender | No | MALE, FEMALE, or OTHER. |
dob | No | Date of birth (ISO 8601 with offset). |
document_type | No | Government ID type. |
document_number | No | Government ID number. |
country | No | Customer country. |
phone | No | Phone number in international format. |
registration_date | No | When the customer registered in your system. Defaults to the current time. |
devices | No | Optional device payloads on registration. Use update customer with a devices array to manage structured push tokens after registration. Defaults to []. |
delivery_addresses | No | Up to 10 saved delivery addresses. At most one may have preferred: true. |
billing_profiles | No | Up to 10 billing profiles with tax identifiers. At most one may have preferred: true. |
consent | No | Channel consent preferences. Each omitted flag defaults to false. |
metadata | No | Custom key-value metadata. Must serialize to 1MB or less. |
Consent
| Field | Type | Default | Description |
|---|---|---|---|
email | boolean | false | Email marketing |
push_notifications | boolean | false | Push notifications |
in_app_messages | boolean | false | In-app messages |
phone_calls | boolean | false | Phone calls |
sms | boolean | false | SMS messages |
whatsapp | boolean | false | WhatsApp messages |
Delivery address
| Field | Required | Description |
|---|---|---|
alias | Yes | Label such as “Home” or “Office”. |
address_line1 | Yes | Primary street address. |
address_line2 | No | Apartment, suite, or floor. |
city | No | City. |
state | No | State or province. |
zip | No | Postal code. |
country | No | Country. |
reference | No | Landmark or reference point. |
latitude | No | Latitude between -90 and 90. |
longitude | No | Longitude between -180 and 180. |
instructions | No | Delivery instructions. |
preferred | No | Mark as the default address. Defaults to false. |
metadata | No | Custom metadata for this address (object or null). |
Billing profile
| Field | Required | Description |
|---|---|---|
alias | Yes | Label such as “Personal” or “Business”. |
type | Yes | INDIVIDUAL or BUSINESS. |
legal_name | Yes | Legal name for invoicing. |
address_line1 | Yes | Primary billing address. |
address_line2 | No | Additional address line. |
city | No | City. |
state | No | State or province. |
zip | No | Postal code. |
country | No | Country. |
tax_id | Yes | Tax identifier value. |
tax_id_type | Yes | One of VAT, EIN, SSN, TIN, NIF, CUIT, RUT, NIT, RCN, RUC, CI, DNI, PASSPORT, or OTHER. |
preferred | No | Mark as the default profile. Defaults to false. |
metadata | No | Custom metadata for this profile (object or null). |
Request
curl -X POST "https://firespark.cloud/api/storefront/v1/customers" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "auth0|abc123",
"name": "John Smith",
"email": "john@example.com",
"phone": "+593991234567",
"consent": {
"email": true,
"push_notifications": true,
"in_app_messages": false,
"phone_calls": false,
"sms": false,
"whatsapp": false
},
"delivery_addresses": [
{
"alias": "Home",
"address_line1": "Av. Amazonas 123",
"city": "Quito",
"preferred": true,
"metadata": null
}
],
"billing_profiles": [
{
"alias": "Personal",
"type": "INDIVIDUAL",
"legal_name": "John Smith",
"address_line1": "Av. Amazonas 123",
"tax_id": "1712345678",
"tax_id_type": "CI",
"preferred": true,
"metadata": null
}
]
}'
Response
Returns the created customer indata. The shape matches get customer.
Anonymous customers
For guest checkout, send onlyid and is_anonymous: true. Fire spark uses the id as the display name when no name is provided.
curl -X POST "https://firespark.cloud/api/storefront/v1/customers" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"id": "guest-7f3a", "is_anonymous": true}'
Error responses
| Status | Description |
|---|---|
400 | Invalid request body. |
401 | Missing or invalid access token. |
403 | The id does not match the token’s customer id. |
422 | A customer with this id already exists. |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Schema for registering a new customer. For anonymous customers, only id and is_anonymous: true are required. For regular customers, id, name, and email are required. registration_date is optional and defaults to the current time.
Your customer unique identifier. Must match the sub claim from the customer's OIDC ID token.
Set to true to create an anonymous customer. When true, name and email are not required.
The full name of the customer. Required unless is_anonymous is true.
"John Smith"
The email of the customer. Required unless is_anonymous is true.
The status of the customer
ACTIVE, INACTIVE The gender of the customer
MALE, FEMALE, OTHER The date of birth of the customer
The document type of the customer
The document number of the customer
50The country of the customer
100The customer's phone number in international format
"+593 99 123 4567"
The date when the customer was registered. Defaults to the current time when omitted.
Optional device payloads on registration. Use PATCH /customers/{id} with a devices array to manage structured push devices after registration.
10Show child attributes
Show child attributes
10Show child attributes
Show child attributes
The customer's consent preferences
Show child attributes
Show child attributes
Custom metadata for the customer. Must serialize to 1MB or less.
Response
Customer created
Customer profile returned by Storefront API endpoints. Omits internal fields such as birthday.
Show child attributes
Show child attributes