Migrate customers
curl --request POST \
--url https://firespark.cloud/api/admin/v1/customers/migrate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customers": [
{
"id": "<string>",
"name": "John Smith",
"email": "jsmith@example.com",
"registration_date": "2023-11-07T05:31:56Z",
"balance": [
{
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"expiration_date": "2023-11-07T05:31:56Z",
"brand_id": "<string>",
"channel_id": "<string>",
"store_id": "<string>",
"issued_at": "2023-11-07T05:31:56Z",
"funded_by": "<string>"
}
],
"platforms": [
"<string>"
],
"dob": "2023-11-07T05:31:56Z",
"document_type": "<string>",
"document_number": "<string>",
"country": "<string>",
"metrics": {
"topProducts": []
},
"devices": [
{
"device_token": "<string>",
"device_info": {
"model": "<string>",
"osVersion": "<string>"
},
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
],
"tags": {},
"metadata": {}
}
]
}
'import requests
url = "https://firespark.cloud/api/admin/v1/customers/migrate"
payload = { "customers": [
{
"id": "<string>",
"name": "John Smith",
"email": "jsmith@example.com",
"registration_date": "2023-11-07T05:31:56Z",
"balance": [
{
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"expiration_date": "2023-11-07T05:31:56Z",
"brand_id": "<string>",
"channel_id": "<string>",
"store_id": "<string>",
"issued_at": "2023-11-07T05:31:56Z",
"funded_by": "<string>"
}
],
"platforms": ["<string>"],
"dob": "2023-11-07T05:31:56Z",
"document_type": "<string>",
"document_number": "<string>",
"country": "<string>",
"metrics": { "topProducts": [] },
"devices": [
{
"device_token": "<string>",
"device_info": {
"model": "<string>",
"osVersion": "<string>"
},
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
],
"tags": {},
"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({
customers: [
{
id: '<string>',
name: 'John Smith',
email: 'jsmith@example.com',
registration_date: '2023-11-07T05:31:56Z',
balance: [
{
reward_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amount: 123,
expiration_date: '2023-11-07T05:31:56Z',
brand_id: '<string>',
channel_id: '<string>',
store_id: '<string>',
issued_at: '2023-11-07T05:31:56Z',
funded_by: '<string>'
}
],
platforms: ['<string>'],
dob: '2023-11-07T05:31:56Z',
document_type: '<string>',
document_number: '<string>',
country: '<string>',
metrics: {topProducts: []},
devices: [
{
device_token: '<string>',
device_info: {model: '<string>', osVersion: '<string>'},
expires_at: '2023-11-07T05:31:56Z',
created_at: '2023-11-07T05:31:56Z'
}
],
tags: {},
metadata: {}
}
]
})
};
fetch('https://firespark.cloud/api/admin/v1/customers/migrate', 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/admin/v1/customers/migrate",
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([
'customers' => [
[
'id' => '<string>',
'name' => 'John Smith',
'email' => 'jsmith@example.com',
'registration_date' => '2023-11-07T05:31:56Z',
'balance' => [
[
'reward_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amount' => 123,
'expiration_date' => '2023-11-07T05:31:56Z',
'brand_id' => '<string>',
'channel_id' => '<string>',
'store_id' => '<string>',
'issued_at' => '2023-11-07T05:31:56Z',
'funded_by' => '<string>'
]
],
'platforms' => [
'<string>'
],
'dob' => '2023-11-07T05:31:56Z',
'document_type' => '<string>',
'document_number' => '<string>',
'country' => '<string>',
'metrics' => [
'topProducts' => [
]
],
'devices' => [
[
'device_token' => '<string>',
'device_info' => [
'model' => '<string>',
'osVersion' => '<string>'
],
'expires_at' => '2023-11-07T05:31:56Z',
'created_at' => '2023-11-07T05:31:56Z'
]
],
'tags' => [
],
'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/admin/v1/customers/migrate"
payload := strings.NewReader("{\n \"customers\": [\n {\n \"id\": \"<string>\",\n \"name\": \"John Smith\",\n \"email\": \"jsmith@example.com\",\n \"registration_date\": \"2023-11-07T05:31:56Z\",\n \"balance\": [\n {\n \"reward_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"brand_id\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"issued_at\": \"2023-11-07T05:31:56Z\",\n \"funded_by\": \"<string>\"\n }\n ],\n \"platforms\": [\n \"<string>\"\n ],\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"metrics\": {\n \"topProducts\": []\n },\n \"devices\": [\n {\n \"device_token\": \"<string>\",\n \"device_info\": {\n \"model\": \"<string>\",\n \"osVersion\": \"<string>\"\n },\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"created_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tags\": {},\n \"metadata\": {}\n }\n ]\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/admin/v1/customers/migrate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customers\": [\n {\n \"id\": \"<string>\",\n \"name\": \"John Smith\",\n \"email\": \"jsmith@example.com\",\n \"registration_date\": \"2023-11-07T05:31:56Z\",\n \"balance\": [\n {\n \"reward_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"brand_id\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"issued_at\": \"2023-11-07T05:31:56Z\",\n \"funded_by\": \"<string>\"\n }\n ],\n \"platforms\": [\n \"<string>\"\n ],\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"metrics\": {\n \"topProducts\": []\n },\n \"devices\": [\n {\n \"device_token\": \"<string>\",\n \"device_info\": {\n \"model\": \"<string>\",\n \"osVersion\": \"<string>\"\n },\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"created_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tags\": {},\n \"metadata\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://firespark.cloud/api/admin/v1/customers/migrate")
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 \"customers\": [\n {\n \"id\": \"<string>\",\n \"name\": \"John Smith\",\n \"email\": \"jsmith@example.com\",\n \"registration_date\": \"2023-11-07T05:31:56Z\",\n \"balance\": [\n {\n \"reward_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"brand_id\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"issued_at\": \"2023-11-07T05:31:56Z\",\n \"funded_by\": \"<string>\"\n }\n ],\n \"platforms\": [\n \"<string>\"\n ],\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"metrics\": {\n \"topProducts\": []\n },\n \"devices\": [\n {\n \"device_token\": \"<string>\",\n \"device_info\": {\n \"model\": \"<string>\",\n \"osVersion\": \"<string>\"\n },\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"created_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tags\": {},\n \"metadata\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"details": "<string>"
}Migrate
Migrate customers
Migrate a customer from an old system to Fire spark
POST
/
customers
/
migrate
Migrate customers
curl --request POST \
--url https://firespark.cloud/api/admin/v1/customers/migrate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customers": [
{
"id": "<string>",
"name": "John Smith",
"email": "jsmith@example.com",
"registration_date": "2023-11-07T05:31:56Z",
"balance": [
{
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"expiration_date": "2023-11-07T05:31:56Z",
"brand_id": "<string>",
"channel_id": "<string>",
"store_id": "<string>",
"issued_at": "2023-11-07T05:31:56Z",
"funded_by": "<string>"
}
],
"platforms": [
"<string>"
],
"dob": "2023-11-07T05:31:56Z",
"document_type": "<string>",
"document_number": "<string>",
"country": "<string>",
"metrics": {
"topProducts": []
},
"devices": [
{
"device_token": "<string>",
"device_info": {
"model": "<string>",
"osVersion": "<string>"
},
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
],
"tags": {},
"metadata": {}
}
]
}
'import requests
url = "https://firespark.cloud/api/admin/v1/customers/migrate"
payload = { "customers": [
{
"id": "<string>",
"name": "John Smith",
"email": "jsmith@example.com",
"registration_date": "2023-11-07T05:31:56Z",
"balance": [
{
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"expiration_date": "2023-11-07T05:31:56Z",
"brand_id": "<string>",
"channel_id": "<string>",
"store_id": "<string>",
"issued_at": "2023-11-07T05:31:56Z",
"funded_by": "<string>"
}
],
"platforms": ["<string>"],
"dob": "2023-11-07T05:31:56Z",
"document_type": "<string>",
"document_number": "<string>",
"country": "<string>",
"metrics": { "topProducts": [] },
"devices": [
{
"device_token": "<string>",
"device_info": {
"model": "<string>",
"osVersion": "<string>"
},
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
],
"tags": {},
"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({
customers: [
{
id: '<string>',
name: 'John Smith',
email: 'jsmith@example.com',
registration_date: '2023-11-07T05:31:56Z',
balance: [
{
reward_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amount: 123,
expiration_date: '2023-11-07T05:31:56Z',
brand_id: '<string>',
channel_id: '<string>',
store_id: '<string>',
issued_at: '2023-11-07T05:31:56Z',
funded_by: '<string>'
}
],
platforms: ['<string>'],
dob: '2023-11-07T05:31:56Z',
document_type: '<string>',
document_number: '<string>',
country: '<string>',
metrics: {topProducts: []},
devices: [
{
device_token: '<string>',
device_info: {model: '<string>', osVersion: '<string>'},
expires_at: '2023-11-07T05:31:56Z',
created_at: '2023-11-07T05:31:56Z'
}
],
tags: {},
metadata: {}
}
]
})
};
fetch('https://firespark.cloud/api/admin/v1/customers/migrate', 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/admin/v1/customers/migrate",
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([
'customers' => [
[
'id' => '<string>',
'name' => 'John Smith',
'email' => 'jsmith@example.com',
'registration_date' => '2023-11-07T05:31:56Z',
'balance' => [
[
'reward_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amount' => 123,
'expiration_date' => '2023-11-07T05:31:56Z',
'brand_id' => '<string>',
'channel_id' => '<string>',
'store_id' => '<string>',
'issued_at' => '2023-11-07T05:31:56Z',
'funded_by' => '<string>'
]
],
'platforms' => [
'<string>'
],
'dob' => '2023-11-07T05:31:56Z',
'document_type' => '<string>',
'document_number' => '<string>',
'country' => '<string>',
'metrics' => [
'topProducts' => [
]
],
'devices' => [
[
'device_token' => '<string>',
'device_info' => [
'model' => '<string>',
'osVersion' => '<string>'
],
'expires_at' => '2023-11-07T05:31:56Z',
'created_at' => '2023-11-07T05:31:56Z'
]
],
'tags' => [
],
'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/admin/v1/customers/migrate"
payload := strings.NewReader("{\n \"customers\": [\n {\n \"id\": \"<string>\",\n \"name\": \"John Smith\",\n \"email\": \"jsmith@example.com\",\n \"registration_date\": \"2023-11-07T05:31:56Z\",\n \"balance\": [\n {\n \"reward_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"brand_id\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"issued_at\": \"2023-11-07T05:31:56Z\",\n \"funded_by\": \"<string>\"\n }\n ],\n \"platforms\": [\n \"<string>\"\n ],\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"metrics\": {\n \"topProducts\": []\n },\n \"devices\": [\n {\n \"device_token\": \"<string>\",\n \"device_info\": {\n \"model\": \"<string>\",\n \"osVersion\": \"<string>\"\n },\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"created_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tags\": {},\n \"metadata\": {}\n }\n ]\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/admin/v1/customers/migrate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customers\": [\n {\n \"id\": \"<string>\",\n \"name\": \"John Smith\",\n \"email\": \"jsmith@example.com\",\n \"registration_date\": \"2023-11-07T05:31:56Z\",\n \"balance\": [\n {\n \"reward_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"brand_id\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"issued_at\": \"2023-11-07T05:31:56Z\",\n \"funded_by\": \"<string>\"\n }\n ],\n \"platforms\": [\n \"<string>\"\n ],\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"metrics\": {\n \"topProducts\": []\n },\n \"devices\": [\n {\n \"device_token\": \"<string>\",\n \"device_info\": {\n \"model\": \"<string>\",\n \"osVersion\": \"<string>\"\n },\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"created_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tags\": {},\n \"metadata\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://firespark.cloud/api/admin/v1/customers/migrate")
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 \"customers\": [\n {\n \"id\": \"<string>\",\n \"name\": \"John Smith\",\n \"email\": \"jsmith@example.com\",\n \"registration_date\": \"2023-11-07T05:31:56Z\",\n \"balance\": [\n {\n \"reward_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 123,\n \"expiration_date\": \"2023-11-07T05:31:56Z\",\n \"brand_id\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"issued_at\": \"2023-11-07T05:31:56Z\",\n \"funded_by\": \"<string>\"\n }\n ],\n \"platforms\": [\n \"<string>\"\n ],\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"metrics\": {\n \"topProducts\": []\n },\n \"devices\": [\n {\n \"device_token\": \"<string>\",\n \"device_info\": {\n \"model\": \"<string>\",\n \"osVersion\": \"<string>\"\n },\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"created_at\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tags\": {},\n \"metadata\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"details": "<string>"
}⌘I