cURL
curl --request POST \
--url https://app.masivo.ai/api/storefront/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://app.masivo.ai/api/storefront/v1/customers"
payload = {}
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({})
};
fetch('https://app.masivo.ai/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://app.masivo.ai/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([
]),
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://app.masivo.ai/api/storefront/v1/customers"
payload := strings.NewReader("{}")
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://app.masivo.ai/api/storefront/v1/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.masivo.ai/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 = "{}"
response = http.request(request)
puts response.read_body{
"data": {
"customer": {
"id": "<string>",
"name": "John Smith",
"email": "jsmith@example.com",
"registration_date": "2023-11-07T05:31:56Z",
"status": "ACTIVE",
"is_anonymous": false,
"gender": "MALE",
"dob": "2023-11-07T05:31:56Z",
"document_type": "CL_RUT",
"document_number": "<string>",
"country": "Chile",
"phone": "+593 99 123 4567",
"phone_verified": false,
"tier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tags": {},
"consent": {
"consent_string": "COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA",
"version": "2.0",
"consent_timestamp": "2023-11-07T05:31:56Z",
"customer_id": "<string>",
"purposes": {
"behavioral_campaigns": true,
"coupon_campaigns": true,
"punchcard_campaigns": true,
"email_marketing": true,
"push_notifications": true,
"whatsapp_marketing": true,
"audience_marketing": true,
"inapp_messages": true,
"news_feed": true,
"link_tracking": true
},
"vendors": {
"vendor_123": true,
"vendor_456": false
}
},
"metrics": {},
"metadata": {}
},
"wallet": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lines": [
{
"amount": 123,
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issued_at": "2023-11-07T05:31:56Z",
"expiration_date": "2023-11-07T05:31:56Z",
"reservation_expires_at": "2023-11-07T05:31:56Z"
}
],
"totals": [
{
"total": 127.6,
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiration_date": "2023-11-07T05:31:56Z",
"reward": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "<string>",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "ACTIVE",
"team_ids": [
"<string>"
],
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": {},
"platforms": [
"<string>"
],
"labels": [
"<string>"
],
"stores": [
"<string>"
],
"channels": [
"<string>"
],
"products": [
"<string>"
],
"tiers": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"name": "<string>",
"description": "<string>",
"type": "POINTS",
"conditions": [
[
{
"type": "Order Value",
"operator": "grater than",
"primitive": "string",
"value": 9.95
}
]
],
"attributes": {
"conversion_factor": 0.1
}
}
}
]
}
}
}{
"error": "<string>",
"details": "<string>"
}Customers
Register customer
Register a customer. For anonymous customers, only the id and is_anonymous: true are required. Anonymous customers can later be identified using the /customers/{id}/identify/anonymous endpoint.
POST
/
customers
cURL
curl --request POST \
--url https://app.masivo.ai/api/storefront/v1/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://app.masivo.ai/api/storefront/v1/customers"
payload = {}
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({})
};
fetch('https://app.masivo.ai/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://app.masivo.ai/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([
]),
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://app.masivo.ai/api/storefront/v1/customers"
payload := strings.NewReader("{}")
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://app.masivo.ai/api/storefront/v1/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.masivo.ai/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 = "{}"
response = http.request(request)
puts response.read_body{
"data": {
"customer": {
"id": "<string>",
"name": "John Smith",
"email": "jsmith@example.com",
"registration_date": "2023-11-07T05:31:56Z",
"status": "ACTIVE",
"is_anonymous": false,
"gender": "MALE",
"dob": "2023-11-07T05:31:56Z",
"document_type": "CL_RUT",
"document_number": "<string>",
"country": "Chile",
"phone": "+593 99 123 4567",
"phone_verified": false,
"tier_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tags": {},
"consent": {
"consent_string": "COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA",
"version": "2.0",
"consent_timestamp": "2023-11-07T05:31:56Z",
"customer_id": "<string>",
"purposes": {
"behavioral_campaigns": true,
"coupon_campaigns": true,
"punchcard_campaigns": true,
"email_marketing": true,
"push_notifications": true,
"whatsapp_marketing": true,
"audience_marketing": true,
"inapp_messages": true,
"news_feed": true,
"link_tracking": true
},
"vendors": {
"vendor_123": true,
"vendor_456": false
}
},
"metrics": {},
"metadata": {}
},
"wallet": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"lines": [
{
"amount": 123,
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issued_at": "2023-11-07T05:31:56Z",
"expiration_date": "2023-11-07T05:31:56Z",
"reservation_expires_at": "2023-11-07T05:31:56Z"
}
],
"totals": [
{
"total": 127.6,
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiration_date": "2023-11-07T05:31:56Z",
"reward": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "<string>",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "ACTIVE",
"team_ids": [
"<string>"
],
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": {},
"platforms": [
"<string>"
],
"labels": [
"<string>"
],
"stores": [
"<string>"
],
"channels": [
"<string>"
],
"products": [
"<string>"
],
"tiers": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"name": "<string>",
"description": "<string>",
"type": "POINTS",
"conditions": [
[
{
"type": "Order Value",
"operator": "grater than",
"primitive": "string",
"value": 9.95
}
]
],
"attributes": {
"conversion_factor": 0.1
}
}
}
]
}
}
}{
"error": "<string>",
"details": "<string>"
}Document types
document_type is a country-prefixed code, not the local document name. RUT is rejected with 422. Chile is CL_RUT, Colombia is CO_RUT, and Uruguay is UY_RUT.
Send document_type and document_number together. country is a separate field (an English name such as Chile) and is not checked against the prefix.
| Country | Code | Document |
|---|---|---|
| Argentina | AR_DNI | DNI (Documento Nacional de Identidad) |
| Argentina | AR_CUIT | CUIT (Clave Única de Identificación Tributaria) |
| Argentina | AR_CUIL | CUIL (Código Único de Identificación Laboral) |
| Argentina | AR_PASSPORT | Passport |
| Argentina | AR_DRIVER_LICENSE | Driver’s License |
| Argentina | AR_OTHER | Other |
| Bolivia | BO_CI | CI (Cédula de Identidad) |
| Bolivia | BO_NIT | NIT (Número de Identificación Tributaria) |
| Bolivia | BO_PASSPORT | Passport |
| Bolivia | BO_DRIVER_LICENSE | Driver’s License |
| Bolivia | BO_OTHER | Other |
| Brazil | BR_RG | RG (Cédula de Identidade) |
| Brazil | BR_CPF | CPF (Cadastro de Pessoas Físicas) |
| Brazil | BR_PASSPORT | Passport |
| Brazil | BR_DRIVER_LICENSE | Driver’s License |
| Brazil | BR_OTHER | Other |
| Chile | CL_RUN | RUN (Rol Único Nacional) |
| Chile | CL_RUT | RUT (Rol Único Tributario) |
| Chile | CL_PASSPORT | Passport |
| Chile | CL_DRIVER_LICENSE | Driver’s License |
| Chile | CL_OTHER | Other |
| Colombia | CO_CC | CC (Cédula de Ciudadanía) |
| Colombia | CO_RUT | RUT (Registro Único Tributario) |
| Colombia | CO_NIT | NIT (Número de Identificación Tributaria) |
| Colombia | CO_PASSPORT | Passport |
| Colombia | CO_DRIVER_LICENSE | Driver’s License |
| Colombia | CO_OTHER | Other |
| Costa Rica | CR_CI | CI (Cédula de Identidad) |
| Costa Rica | CR_PASSPORT | Passport |
| Costa Rica | CR_DRIVER_LICENSE | Driver’s License |
| Costa Rica | CR_OTHER | Other |
| Dominican Republic | DO_CI | CI (Cédula de Identidad) |
| Dominican Republic | DO_PASSPORT | Passport |
| Dominican Republic | DO_DRIVER_LICENSE | Driver’s License |
| Dominican Republic | DO_OTHER | Other |
| Ecuador | EC_CC | CC (Cédula de Ciudadanía) |
| Ecuador | EC_RUC | RUC (Registro Único de Contribuyentes) |
| Ecuador | EC_PASSPORT | Passport |
| Ecuador | EC_DRIVER_LICENSE | Driver’s License |
| Ecuador | EC_OTHER | Other |
| El Salvador | SV_DUI | DUI (Documento Único de Identidad) |
| El Salvador | SV_NIT | NIT (Número de Identificación Tributaria) |
| El Salvador | SV_PASSPORT | Passport |
| El Salvador | SV_DRIVER_LICENSE | Driver’s License |
| El Salvador | SV_OTHER | Other |
| Guatemala | GT_DPI | DPI (Documento Personal de Identificación) |
| Guatemala | GT_PASSPORT | Passport |
| Guatemala | GT_DRIVER_LICENSE | Driver’s License |
| Guatemala | GT_OTHER | Other |
| Honduras | HN_CI | CI (Cédula de Identidad) |
| Honduras | HN_RTN | RTN (Registro Tributario Nacional) |
| Honduras | HN_PASSPORT | Passport |
| Honduras | HN_DRIVER_LICENSE | Driver’s License |
| Honduras | HN_OTHER | Other |
| Mexico | MX_CURP | CURP (Clave Única de Registro de Población) |
| Mexico | MX_RFC | RFC (Registro Federal de Contribuyentes) |
| Mexico | MX_INE | INE (Credencial para Votar) |
| Mexico | MX_PASSPORT | Passport |
| Mexico | MX_DRIVER_LICENSE | Driver’s License |
| Mexico | MX_OTHER | Other |
| Nicaragua | NI_CI | CI (Cédula de Identidad) |
| Nicaragua | NI_PASSPORT | Passport |
| Nicaragua | NI_DRIVER_LICENSE | Driver’s License |
| Nicaragua | NI_OTHER | Other |
| Panama | PA_CIP | CIP (Cédula de Identidad Personal) |
| Panama | PA_PASSPORT | Passport |
| Panama | PA_DRIVER_LICENSE | Driver’s License |
| Panama | PA_OTHER | Other |
| Paraguay | PY_CI | CI (Cédula de Identidad Civil) |
| Paraguay | PY_RUC | RUC (Registro Único de Contribuyentes) |
| Paraguay | PY_PASSPORT | Passport |
| Paraguay | PY_DRIVER_LICENSE | Driver’s License |
| Paraguay | PY_OTHER | Other |
| Peru | PE_DNI | DNI (Documento Nacional de Identidad) |
| Peru | PE_RUC | RUC (Registro Único de Contribuyentes) |
| Peru | PE_PASSPORT | Passport |
| Peru | PE_DRIVER_LICENSE | Driver’s License |
| Peru | PE_OTHER | Other |
| Uruguay | UY_CI | CI (Cédula de Identidad) |
| Uruguay | UY_RUT | RUT (Registro Único Tributario) |
| Uruguay | UY_PASSPORT | Passport |
| Uruguay | UY_DRIVER_LICENSE | Driver’s License |
| Uruguay | UY_OTHER | Other |
| Venezuela | VE_CI | CI (Cédula de Identidad) |
| Venezuela | VE_RIF | RIF (Registro Único de Información Fiscal) |
| Venezuela | VE_PASSPORT | Passport |
| Venezuela | VE_DRIVER_LICENSE | Driver’s License |
| Venezuela | VE_OTHER | Other |
Authorizations
Body
application/json
Schema for registering a new customer. For anonymous customers, only id and is_anonymous: true are required. For regular customers, id, name, email, and registration_date are required.
The document type of the customer. If provided, document_number is required.
Available options:
AR_DNI, AR_CUIT, AR_CUIL, AR_PASSPORT, AR_DRIVER_LICENSE, AR_OTHER, BO_CI, BO_NIT, BO_PASSPORT, BO_DRIVER_LICENSE, BO_OTHER, BR_RG, BR_CPF, BR_PASSPORT, BR_DRIVER_LICENSE, BR_OTHER, CL_RUN, CL_RUT, CL_PASSPORT, CL_DRIVER_LICENSE, CL_OTHER, CO_CC, CO_RUT, CO_NIT, CO_PASSPORT, CO_DRIVER_LICENSE, CO_OTHER, CR_CI, CR_PASSPORT, CR_DRIVER_LICENSE, CR_OTHER, DO_CI, DO_PASSPORT, DO_DRIVER_LICENSE, DO_OTHER, EC_CC, EC_RUC, EC_PASSPORT, EC_DRIVER_LICENSE, EC_OTHER, SV_DUI, SV_NIT, SV_PASSPORT, SV_DRIVER_LICENSE, SV_OTHER, GT_DPI, GT_PASSPORT, GT_DRIVER_LICENSE, GT_OTHER, HN_CI, HN_RTN, HN_PASSPORT, HN_DRIVER_LICENSE, HN_OTHER, MX_CURP, MX_RFC, MX_INE, MX_PASSPORT, MX_DRIVER_LICENSE, MX_OTHER, NI_CI, NI_PASSPORT, NI_DRIVER_LICENSE, NI_OTHER, PA_CIP, PA_PASSPORT, PA_DRIVER_LICENSE, PA_OTHER, PY_CI, PY_RUC, PY_PASSPORT, PY_DRIVER_LICENSE, PY_OTHER, PE_DNI, PE_RUC, PE_PASSPORT, PE_DRIVER_LICENSE, PE_OTHER, UY_CI, UY_RUT, UY_PASSPORT, UY_DRIVER_LICENSE, UY_OTHER, VE_CI, VE_RIF, VE_PASSPORT, VE_DRIVER_LICENSE, VE_OTHER Example:
"CL_RUT"
The country of the customer. English name, independent of the document_type prefix.
Available options:
Argentina, Bolivia, Brazil, Chile, Colombia, Costa Rica, Dominican Republic, Ecuador, El Salvador, Guatemala, Honduras, Mexico, Nicaragua, Panama, Paraguay, Peru, Uruguay, Venezuela Example:
"Chile"