Consumers
POST /consumers/batch
Create consumers
POST
/
consumers
/
batch
cURL
curl --request POST \
--url https://admin.fanfare.io/api/consumers/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"consumers": [
{
"emailVerified": true,
"phoneVerified": true,
"activityRank": 123,
"activityScore": 123,
"activityScoreUpdatedAt": "<string>",
"aov": "<string>",
"email": "[email protected]",
"engagedCount": 123,
"fullName": "<string>",
"lastEngagedAt": "<string>",
"lastGeoAt": "<string>",
"lastGeoCity": "<string>",
"lastGeoCoordinates": {
"latitude": 123,
"longitude": 123
},
"lastGeoCountry": "<string>",
"lastGeoPostalCode": "<string>",
"lastGeoRegion": "<string>",
"lastGeoSource": "<string>",
"lastGeoTimezone": "<string>",
"lastLoginAt": "<string>",
"lastOrderAt": "<string>",
"lastReturnAt": "<string>",
"loyaltyBalance": 123,
"loyaltyLastActivityAt": "<string>",
"loyaltyLifetimePoints": 123,
"ltv": "<string>",
"metadata": {},
"monetaryRank": 123,
"monetaryScore": 123,
"monetaryScoreUpdatedAt": "<string>",
"phone": "<string>",
"purchaseFrequencyRank": 123,
"purchaseFrequencyScore": 123,
"purchaseFrequencyScoreUpdatedAt": "<string>",
"smsOptOut": true,
"totalEngagements": 123,
"totalMessages": 123,
"totalOrders": 123,
"totalReturns": 123,
"verificationCode": "<string>",
"verificationCodeExpiresAt": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
consumers: [
{
emailVerified: true,
phoneVerified: true,
activityRank: 123,
activityScore: 123,
activityScoreUpdatedAt: '<string>',
aov: '<string>',
email: '[email protected]',
engagedCount: 123,
fullName: '<string>',
lastEngagedAt: '<string>',
lastGeoAt: '<string>',
lastGeoCity: '<string>',
lastGeoCoordinates: {latitude: 123, longitude: 123},
lastGeoCountry: '<string>',
lastGeoPostalCode: '<string>',
lastGeoRegion: '<string>',
lastGeoSource: '<string>',
lastGeoTimezone: '<string>',
lastLoginAt: '<string>',
lastOrderAt: '<string>',
lastReturnAt: '<string>',
loyaltyBalance: 123,
loyaltyLastActivityAt: '<string>',
loyaltyLifetimePoints: 123,
ltv: '<string>',
metadata: {},
monetaryRank: 123,
monetaryScore: 123,
monetaryScoreUpdatedAt: '<string>',
phone: '<string>',
purchaseFrequencyRank: 123,
purchaseFrequencyScore: 123,
purchaseFrequencyScoreUpdatedAt: '<string>',
smsOptOut: true,
totalEngagements: 123,
totalMessages: 123,
totalOrders: 123,
totalReturns: 123,
verificationCode: '<string>',
verificationCodeExpiresAt: '<string>'
}
]
})
};
fetch('https://admin.fanfare.io/api/consumers/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://admin.fanfare.io/api/consumers/batch"
payload = { "consumers": [
{
"emailVerified": True,
"phoneVerified": True,
"activityRank": 123,
"activityScore": 123,
"activityScoreUpdatedAt": "<string>",
"aov": "<string>",
"email": "[email protected]",
"engagedCount": 123,
"fullName": "<string>",
"lastEngagedAt": "<string>",
"lastGeoAt": "<string>",
"lastGeoCity": "<string>",
"lastGeoCoordinates": {
"latitude": 123,
"longitude": 123
},
"lastGeoCountry": "<string>",
"lastGeoPostalCode": "<string>",
"lastGeoRegion": "<string>",
"lastGeoSource": "<string>",
"lastGeoTimezone": "<string>",
"lastLoginAt": "<string>",
"lastOrderAt": "<string>",
"lastReturnAt": "<string>",
"loyaltyBalance": 123,
"loyaltyLastActivityAt": "<string>",
"loyaltyLifetimePoints": 123,
"ltv": "<string>",
"metadata": {},
"monetaryRank": 123,
"monetaryScore": 123,
"monetaryScoreUpdatedAt": "<string>",
"phone": "<string>",
"purchaseFrequencyRank": 123,
"purchaseFrequencyScore": 123,
"purchaseFrequencyScoreUpdatedAt": "<string>",
"smsOptOut": True,
"totalEngagements": 123,
"totalMessages": 123,
"totalOrders": 123,
"totalReturns": 123,
"verificationCode": "<string>",
"verificationCodeExpiresAt": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://admin.fanfare.io/api/consumers/batch"
payload := strings.NewReader("{\n \"consumers\": [\n {\n \"emailVerified\": true,\n \"phoneVerified\": true,\n \"activityRank\": 123,\n \"activityScore\": 123,\n \"activityScoreUpdatedAt\": \"<string>\",\n \"aov\": \"<string>\",\n \"email\": \"[email protected]\",\n \"engagedCount\": 123,\n \"fullName\": \"<string>\",\n \"lastEngagedAt\": \"<string>\",\n \"lastGeoAt\": \"<string>\",\n \"lastGeoCity\": \"<string>\",\n \"lastGeoCoordinates\": {\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"lastGeoCountry\": \"<string>\",\n \"lastGeoPostalCode\": \"<string>\",\n \"lastGeoRegion\": \"<string>\",\n \"lastGeoSource\": \"<string>\",\n \"lastGeoTimezone\": \"<string>\",\n \"lastLoginAt\": \"<string>\",\n \"lastOrderAt\": \"<string>\",\n \"lastReturnAt\": \"<string>\",\n \"loyaltyBalance\": 123,\n \"loyaltyLastActivityAt\": \"<string>\",\n \"loyaltyLifetimePoints\": 123,\n \"ltv\": \"<string>\",\n \"metadata\": {},\n \"monetaryRank\": 123,\n \"monetaryScore\": 123,\n \"monetaryScoreUpdatedAt\": \"<string>\",\n \"phone\": \"<string>\",\n \"purchaseFrequencyRank\": 123,\n \"purchaseFrequencyScore\": 123,\n \"purchaseFrequencyScoreUpdatedAt\": \"<string>\",\n \"smsOptOut\": true,\n \"totalEngagements\": 123,\n \"totalMessages\": 123,\n \"totalOrders\": 123,\n \"totalReturns\": 123,\n \"verificationCode\": \"<string>\",\n \"verificationCodeExpiresAt\": \"<string>\"\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))
}[
{
"archived": true,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"emailVerified": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phoneVerified": true,
"status": "ACTIVE",
"activityRank": 0,
"activityScore": 0,
"activityScoreUpdatedAt": "2023-11-07T05:31:56Z",
"aov": "0",
"email": "[email protected]",
"engagedCount": 0,
"fullName": "<string>",
"lastEngagedAt": "2023-11-07T05:31:56Z",
"lastGeoAt": "2023-11-07T05:31:56Z",
"lastGeoCity": "<string>",
"lastGeoCoordinates": {
"latitude": 123,
"longitude": 123
},
"lastGeoCountry": "<string>",
"lastGeoPostalCode": "<string>",
"lastGeoRegion": "<string>",
"lastGeoSource": "<string>",
"lastGeoTimezone": "<string>",
"lastLoginAt": "2023-11-07T05:31:56Z",
"lastOrderAt": "2023-11-07T05:31:56Z",
"lastReturnAt": "2023-11-07T05:31:56Z",
"loyaltyBalance": 0,
"loyaltyLastActivityAt": "2023-11-07T05:31:56Z",
"loyaltyLifetimePoints": 0,
"ltv": "0",
"metadata": {},
"monetaryRank": 0,
"monetaryScore": 0,
"monetaryScoreUpdatedAt": "2023-11-07T05:31:56Z",
"phone": "<string>",
"primaryExternalId": "<string>",
"primaryLastSyncedAt": "2023-11-07T05:31:56Z",
"primarySourceVendor": "<string>",
"primarySyncSourceId": "<string>",
"purchaseFrequencyRank": 0,
"purchaseFrequencyScore": 0,
"purchaseFrequencyScoreUpdatedAt": "2023-11-07T05:31:56Z",
"smsOptOut": false,
"totalEngagements": 0,
"totalMessages": 0,
"totalOrders": 0,
"totalReturns": 0,
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"verificationCode": "<string>",
"verificationCodeExpiresAt": "<string>"
}
]{
"error": "validation_error",
"issues": [
{
"expected": "<string>",
"kind": "<string>",
"message": "<string>",
"path": [
{
"input": "<unknown>",
"key": "<string>",
"origin": "<string>",
"type": "<string>"
}
],
"received": "<string>",
"type": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Fanfare secret key. Keep secret credentials on your server.
Body
application/json
Show child attributes
Show child attributes
Response
Consumers created successfully
Available options:
ACTIVE, INACTIVE Required range:
0 <= x <= 5Pattern:
^\d{1,12}(\.\d{1,8})?$Show child attributes
Show child attributes
Pattern:
^\d{1,12}(\.\d{1,8})?$Show child attributes
Show child attributes
Required range:
0 <= x <= 5Required range:
0 <= x <= 5⌘I
cURL
curl --request POST \
--url https://admin.fanfare.io/api/consumers/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"consumers": [
{
"emailVerified": true,
"phoneVerified": true,
"activityRank": 123,
"activityScore": 123,
"activityScoreUpdatedAt": "<string>",
"aov": "<string>",
"email": "[email protected]",
"engagedCount": 123,
"fullName": "<string>",
"lastEngagedAt": "<string>",
"lastGeoAt": "<string>",
"lastGeoCity": "<string>",
"lastGeoCoordinates": {
"latitude": 123,
"longitude": 123
},
"lastGeoCountry": "<string>",
"lastGeoPostalCode": "<string>",
"lastGeoRegion": "<string>",
"lastGeoSource": "<string>",
"lastGeoTimezone": "<string>",
"lastLoginAt": "<string>",
"lastOrderAt": "<string>",
"lastReturnAt": "<string>",
"loyaltyBalance": 123,
"loyaltyLastActivityAt": "<string>",
"loyaltyLifetimePoints": 123,
"ltv": "<string>",
"metadata": {},
"monetaryRank": 123,
"monetaryScore": 123,
"monetaryScoreUpdatedAt": "<string>",
"phone": "<string>",
"purchaseFrequencyRank": 123,
"purchaseFrequencyScore": 123,
"purchaseFrequencyScoreUpdatedAt": "<string>",
"smsOptOut": true,
"totalEngagements": 123,
"totalMessages": 123,
"totalOrders": 123,
"totalReturns": 123,
"verificationCode": "<string>",
"verificationCodeExpiresAt": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
consumers: [
{
emailVerified: true,
phoneVerified: true,
activityRank: 123,
activityScore: 123,
activityScoreUpdatedAt: '<string>',
aov: '<string>',
email: '[email protected]',
engagedCount: 123,
fullName: '<string>',
lastEngagedAt: '<string>',
lastGeoAt: '<string>',
lastGeoCity: '<string>',
lastGeoCoordinates: {latitude: 123, longitude: 123},
lastGeoCountry: '<string>',
lastGeoPostalCode: '<string>',
lastGeoRegion: '<string>',
lastGeoSource: '<string>',
lastGeoTimezone: '<string>',
lastLoginAt: '<string>',
lastOrderAt: '<string>',
lastReturnAt: '<string>',
loyaltyBalance: 123,
loyaltyLastActivityAt: '<string>',
loyaltyLifetimePoints: 123,
ltv: '<string>',
metadata: {},
monetaryRank: 123,
monetaryScore: 123,
monetaryScoreUpdatedAt: '<string>',
phone: '<string>',
purchaseFrequencyRank: 123,
purchaseFrequencyScore: 123,
purchaseFrequencyScoreUpdatedAt: '<string>',
smsOptOut: true,
totalEngagements: 123,
totalMessages: 123,
totalOrders: 123,
totalReturns: 123,
verificationCode: '<string>',
verificationCodeExpiresAt: '<string>'
}
]
})
};
fetch('https://admin.fanfare.io/api/consumers/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://admin.fanfare.io/api/consumers/batch"
payload = { "consumers": [
{
"emailVerified": True,
"phoneVerified": True,
"activityRank": 123,
"activityScore": 123,
"activityScoreUpdatedAt": "<string>",
"aov": "<string>",
"email": "[email protected]",
"engagedCount": 123,
"fullName": "<string>",
"lastEngagedAt": "<string>",
"lastGeoAt": "<string>",
"lastGeoCity": "<string>",
"lastGeoCoordinates": {
"latitude": 123,
"longitude": 123
},
"lastGeoCountry": "<string>",
"lastGeoPostalCode": "<string>",
"lastGeoRegion": "<string>",
"lastGeoSource": "<string>",
"lastGeoTimezone": "<string>",
"lastLoginAt": "<string>",
"lastOrderAt": "<string>",
"lastReturnAt": "<string>",
"loyaltyBalance": 123,
"loyaltyLastActivityAt": "<string>",
"loyaltyLifetimePoints": 123,
"ltv": "<string>",
"metadata": {},
"monetaryRank": 123,
"monetaryScore": 123,
"monetaryScoreUpdatedAt": "<string>",
"phone": "<string>",
"purchaseFrequencyRank": 123,
"purchaseFrequencyScore": 123,
"purchaseFrequencyScoreUpdatedAt": "<string>",
"smsOptOut": True,
"totalEngagements": 123,
"totalMessages": 123,
"totalOrders": 123,
"totalReturns": 123,
"verificationCode": "<string>",
"verificationCodeExpiresAt": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://admin.fanfare.io/api/consumers/batch"
payload := strings.NewReader("{\n \"consumers\": [\n {\n \"emailVerified\": true,\n \"phoneVerified\": true,\n \"activityRank\": 123,\n \"activityScore\": 123,\n \"activityScoreUpdatedAt\": \"<string>\",\n \"aov\": \"<string>\",\n \"email\": \"[email protected]\",\n \"engagedCount\": 123,\n \"fullName\": \"<string>\",\n \"lastEngagedAt\": \"<string>\",\n \"lastGeoAt\": \"<string>\",\n \"lastGeoCity\": \"<string>\",\n \"lastGeoCoordinates\": {\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"lastGeoCountry\": \"<string>\",\n \"lastGeoPostalCode\": \"<string>\",\n \"lastGeoRegion\": \"<string>\",\n \"lastGeoSource\": \"<string>\",\n \"lastGeoTimezone\": \"<string>\",\n \"lastLoginAt\": \"<string>\",\n \"lastOrderAt\": \"<string>\",\n \"lastReturnAt\": \"<string>\",\n \"loyaltyBalance\": 123,\n \"loyaltyLastActivityAt\": \"<string>\",\n \"loyaltyLifetimePoints\": 123,\n \"ltv\": \"<string>\",\n \"metadata\": {},\n \"monetaryRank\": 123,\n \"monetaryScore\": 123,\n \"monetaryScoreUpdatedAt\": \"<string>\",\n \"phone\": \"<string>\",\n \"purchaseFrequencyRank\": 123,\n \"purchaseFrequencyScore\": 123,\n \"purchaseFrequencyScoreUpdatedAt\": \"<string>\",\n \"smsOptOut\": true,\n \"totalEngagements\": 123,\n \"totalMessages\": 123,\n \"totalOrders\": 123,\n \"totalReturns\": 123,\n \"verificationCode\": \"<string>\",\n \"verificationCodeExpiresAt\": \"<string>\"\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))
}[
{
"archived": true,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"emailVerified": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phoneVerified": true,
"status": "ACTIVE",
"activityRank": 0,
"activityScore": 0,
"activityScoreUpdatedAt": "2023-11-07T05:31:56Z",
"aov": "0",
"email": "[email protected]",
"engagedCount": 0,
"fullName": "<string>",
"lastEngagedAt": "2023-11-07T05:31:56Z",
"lastGeoAt": "2023-11-07T05:31:56Z",
"lastGeoCity": "<string>",
"lastGeoCoordinates": {
"latitude": 123,
"longitude": 123
},
"lastGeoCountry": "<string>",
"lastGeoPostalCode": "<string>",
"lastGeoRegion": "<string>",
"lastGeoSource": "<string>",
"lastGeoTimezone": "<string>",
"lastLoginAt": "2023-11-07T05:31:56Z",
"lastOrderAt": "2023-11-07T05:31:56Z",
"lastReturnAt": "2023-11-07T05:31:56Z",
"loyaltyBalance": 0,
"loyaltyLastActivityAt": "2023-11-07T05:31:56Z",
"loyaltyLifetimePoints": 0,
"ltv": "0",
"metadata": {},
"monetaryRank": 0,
"monetaryScore": 0,
"monetaryScoreUpdatedAt": "2023-11-07T05:31:56Z",
"phone": "<string>",
"primaryExternalId": "<string>",
"primaryLastSyncedAt": "2023-11-07T05:31:56Z",
"primarySourceVendor": "<string>",
"primarySyncSourceId": "<string>",
"purchaseFrequencyRank": 0,
"purchaseFrequencyScore": 0,
"purchaseFrequencyScoreUpdatedAt": "2023-11-07T05:31:56Z",
"smsOptOut": false,
"totalEngagements": 0,
"totalMessages": 0,
"totalOrders": 0,
"totalReturns": 0,
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"verificationCode": "<string>",
"verificationCodeExpiresAt": "<string>"
}
]{
"error": "validation_error",
"issues": [
{
"expected": "<string>",
"kind": "<string>",
"message": "<string>",
"path": [
{
"input": "<unknown>",
"key": "<string>",
"origin": "<string>",
"type": "<string>"
}
],
"received": "<string>",
"type": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}