Skip to main content
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 '
{
  "id": "<string>",
  "platforms": [
    "<string>"
  ],
  "is_anonymous": false,
  "name": "John Smith",
  "email": "[email protected]",
  "gender": "MALE",
  "dob": "2023-11-07T05:31:56Z",
  "document_type": "<string>",
  "document_number": "<string>",
  "country": "<string>",
  "registration_date": "2023-11-07T05:31:56Z",
  "tags": {},
  "devices": [
    {
      "device_token": "<string>",
      "device_info": {
        "platform": "ios",
        "model": "<string>",
        "osVersion": "<string>"
      },
      "expires_at": "2023-11-07T05:31:56Z",
      "created_at": "2023-11-07T05:31:56Z"
    }
  ],
  "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,
      "link_tracking": true
    },
    "vendors": {
      "vendor_123": true,
      "vendor_456": false
    }
  },
  "metadata": {},
  "referral_code": "<string>"
}
'
{
  "data": {
    "customer": {
      "id": "<string>",
      "name": "John Smith",
      "email": "[email protected]",
      "registration_date": "2023-11-07T05:31:56Z",
      "status": "ACTIVE",
      "is_anonymous": false,
      "gender": "MALE",
      "dob": "2023-11-07T05:31:56Z",
      "document_type": "<string>",
      "document_number": "<string>",
      "country": "<string>",
      "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,
          "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>",
            "platforms": [
              "<string>"
            ],
            "name": "<string>",
            "description": "<string>",
            "type": "POINTS",
            "conditions": [
              [
                {
                  "type": "Order Value",
                  "operator": "grater than",
                  "primitive": "string",
                  "value": 9.95
                }
              ]
            ],
            "attributes": {
              "conversion_factor": 0.1
            }
          }
        }
      ]
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

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.

id
string
required

Your customer unique identifier

platforms
string[] | null

Platforms associated with the customer

is_anonymous
boolean
default:false

Set to true to create an anonymous customer. When true, name and email are not required.

name
string

The full name of the customer. Required unless is_anonymous is true.

Example:

"John Smith"

email
string<email>

The email of the customer. Required unless is_anonymous is true.

gender
enum<string> | null

The gender of the customer

Available options:
MALE,
FEMALE
dob
string<date-time> | null

The date of birth of the customer

document_type
string | null

The document type of the customer. If provided, document_number is required.

document_number
string | null

The document number of the customer. If provided, document_type is required.

Maximum string length: 50
country
string | null

The country of the customer

Maximum string length: 100
registration_date
string<date-time>

The date when the customer was registered. Defaults to now.

tags
object

Include your conditions customer tags here

devices
object[]

Customer devices for push notifications

The customer's consent preferences

metadata
object

The metadata of the customer

referral_code
string

Optional referral code if customer was referred

Response

Customer created

data
object