Skip to content

ID Batch V2

Endpoint for processing batch user registrations (FanID) and their related data.

📥 Postman Collection

Download Collection - ID Batch V2

URLs

MethodURLActionDescription
POST/api/v2/IF_ID_BatchRegisterProcess batch user registrations and their data

Production:

{connect-production}/api/v2/IF_ID_Batch

Staging:

{connect-staging}/api/v2/IF_ID_Batch

Authentication

All requests require an access token obtained from the Security endpoint. The token must be sent in the AccessToken header.

AccessToken: {your_token}

Process Batch Registrations

Request

Endpoint: POST {connect-production}/api/v2/IF_ID_Batch

Headers:

AccessToken: {access_token}
Content-Type: application/json

Body Structure

Main Structure

json
{
  "systemId": 0,
  "data": [
    {
      "data": { ... },
      "numbers": [ ... ],
      "sysValues": [ ... ],
      "addresses": { ... },
      "transactions": [ ... ],
      "memberships": [ ... ],
      "optins": [ ... ],
      "attributes": [ ... ],
      "pwd": "string",
      "pwdhash": "string"
    }
  ]
}
FieldTypeRequiredDescription
systemIdnumberYesSource system ID (provided by Fanbase)
dataarrayYesArray of objects with user data

data Object Fields (Personal Data)

json
{
  "data": {
    "identity": 0,
    "name1": "string",
    "gender": "string",
    "socialName": "string",
    "birthday": 0,
    "birthMonth": 0,
    "birthYear": 0,
    "nationalityIso3": "string"
  }
}
FieldTypeRequiredDescription
identitynumberYesAlways keep 0 for integration
name1stringYesFull name
genderstringNoGender: M / F / O / null
socialNamestringNoNickname/Social name
birthdaynumberYesBirth day (01-31)
birthMonthnumberYesBirth month (01-12)
birthYearnumberYesBirth year (4 digits)
nationalityIso3stringNoNationality, ISO3 format (e.g.: BRA)

numbers Array Fields (Documents)

json
{
  "numbers": [
    {
      "numberType": 0,
      "number": "string",
      "verified": 0
    }
  ]
}
FieldTypeRequiredDescription
numberTypenumberYesDocument type (see table below)
numberstringYesDocument number (unformatted)
verifiednumberNoVerified: 0 (no) or 1 (yes)

Document Types (numberType)

CodeType
1CPF (Brazilian Tax ID)
3Phone
4Email

sysValues Array Fields (System Values)

Relevant data not directly linked to the registration (e.g.: Membership card number, Member code).

json
{
  "sysValues": [
    {
      "key": "string",
      "value": "string"
    }
  ]
}
FieldTypeRequiredDescription
keystringYesIdentifier key
valuestringYesAssociated value

addresses Object Fields (Address)

json
{
  "addresses": {
    "addressType": 0,
    "add1": "string",
    "add2": "string",
    "number": 0,
    "add3": "string",
    "zip": "string",
    "city": "string",
    "state": "string",
    "iso3": "string"
  }
}
FieldTypeRequiredDescription
addressTypenumberYesType: 1 (Primary), 2 (Alternative)
add1stringYesStreet/Address
add2stringNoComplement
numbernumberNoHouse number
add3stringYesNeighborhood
zipstringYesPostal code
citystringYesCity
statestringYesState (2 digits: SP/DF/RJ/etc)
iso3stringYesCountry, ISO3 format (e.g.: BRA)

transactions Array Fields (Transactions) - Optional

Optional class to add transaction data (e-commerce purchases, stores, etc).

json
{
  "transactions": [
    {
      "date": "2025-09-20T18:41:31.219Z",
      "type": 0,
      "productType": 0,
      "productDesc": "string",
      "productExternalCode": "string",
      "qty": 0,
      "value": 0,
      "channel": "string",
      "externalCode": "string",
      "deliveryMode": "string",
      "priceType": "string",
      "cupon": "string",
      "paymentMode": "string",
      "complement": "string",
      "discount": "string",
      "discountValue": 0
    }
  ]
}
FieldTypeRequiredDescription
datedatetimeYesTransaction date (ISO 8601)
typenumberYesTransaction type
productTypenumberYesProduct type
productDescstringYesProduct description
productExternalCodestringYesProduct code in source system
qtynumberYesQuantity
valuenumberYesUnit value
channelstringYesSales channel (e.g.: Store name)
externalCodestringYesTransaction code in source system
deliveryModestringNoDelivery mode
priceTypestringNoPrice type
cuponstringNoDiscount coupon code
paymentModestringYesPayment mode (Credit card, Pix, etc)
complementstringNoItem code in order (e.g.: item:1, item:2)
discountstringNoDiscount reason
discountValuenumberNoDiscount value

memberships Array Fields (Membership Plans) - Optional

Optional class to add membership plan data.

json
{
  "memberships": [
    {
      "externalId": "string",
      "status": "string",
      "data": "2025-09-20T18:41:31.219Z",
      "cancelamento": "2025-09-20T18:41:31.219Z",
      "codigoCliente": "string",
      "plano": "string",
      "planoCode": "string",
      "complemento": "string",
      "parcelas": 0,
      "validade": "2025-09-20T18:41:31.219Z",
      "origem": "string",
      "ativacao": "2025-09-20T18:41:31.219Z",
      "tipoVigencia": "string",
      "formaPagamento": "string",
      "guests": [ ... ],
      "attributes": [ ... ]
    }
  ]
}
FieldTypeRequiredDescription
externalIdstringYesContract code in source system
statusstringYesStatus: Active/Inactive/Delinquent/etc
datadatetimeYesContract date
cancelamentodatetimeNoCancellation date (if cancelled)
codigoClientestringYesCustomer CPF or Email
planostringYesPlan name
planoCodestringNoPlan code in source system
complementostringNoOther contract information
parcelasnumberNoNumber of paid installments
validadedatetimeNoExpiration date (when no auto-renewal)
origemstringNoContract origin channel
ativacaodatetimeNoActivation date (start of validity)
tipoVigenciastringNoValidity type: Annual, Monthly
formaPagamentostringNoPayment mode (Credit card, Pix, etc)

Dependents/Guests (guests)

json
{
  "guests": [
    {
      "guestFanbaseId": 0,
      "externalId": "string",
      "cpf": "string",
      "email": "string",
      "celular": "string",
      "name1": "string",
      "gender": "string",
      "socialName": "string",
      "birthday": 0,
      "birthMonth": 0,
      "birthYear": 0
    }
  ]
}
FieldTypeRequiredDescription
guestFanbaseIdnumberNoExisting Fanbase ID (if known)
externalIdstringNoDependent code in source system
cpfstringNoDependent's CPF
emailstringNoDependent's email
celularstringNoDependent's phone
name1stringNoFull name
genderstringNoGender: M/F/O/null
socialNamestringNoNickname
birthdaynumberNoBirth day (01-31)
birthMonthnumberNoBirth month (01-12)
birthYearnumberNoBirth year (4 digits)

Membership Attributes (attributes)

json
{
  "attributes": [
    {
      "type": "string",
      "name": "string",
      "value": "string",
      "note": "string",
      "externalCode": "string"
    }
  ]
}
FieldTypeRequiredDescription
typestringYesAttribute type (e.g.: Card)
namestringNoIdentification name (e.g.: Membership card)
valuestringYesAttribute value
notestringNoFree field for notes
externalCodestringNoInternal attribute code

optins Array Fields (Opt-ins)

Opt-in information (GDPR/LGPD) granted by the fan in legacy systems.

json
{
  "optins": [
    {
      "optinCode": "string",
      "optinDesc": "string",
      "optinDate": "2025-09-20T18:41:31.219Z",
      "optinCancelDate": "2025-09-20T18:41:31.219Z"
    }
  ]
}
FieldTypeRequiredDescription
optinCodestringYesOpt-in code (e.g.: PRIVACYUSE)
optinDescstringYesOpt-in description
optinDatedatetimeYesAcceptance date and time
optinCancelDatedatetimeNoCancellation date and time

attributes Array Fields (User Attributes)

Custom fan attributes for customized display in Fanbox.

Attention

You need to internally request attribute configuration before using.

json
{
  "attributes": [
    {
      "key": "string",
      "value": "string"
    }
  ]
}
FieldTypeRequiredDescription
keystringYesAttribute identification key
valuestringYesAttribute value

Password Fields (SSO Account Creation)

SSO Account Creation

If you send the pwd or pwdhash field, the system will automatically create an SSO (Single Sign-On) account for the user. This allows the user to log into the platform using their credentials.

FieldTypeRequiredDescription
pwdstringNoPassword in plain text for account creation
pwdhashstringNoEncrypted password for account creation

Important

  • Use pwd to send plain text password (the system will hash it)
  • Use pwdhash if you already have the password in hash format
  • Never send both - choose one or the other
  • If neither is sent, the user will be created without a login account

Complete Example - Simple Registration

json
{
  "systemId": 0,
  "data": [
    {
      "data": {
        "identity": 0,
        "name1": "John Smith",
        "gender": "M",
        "socialName": "John",
        "birthday": 15,
        "birthMonth": 8,
        "birthYear": 1990,
        "nationalityIso3": "BRA"
      },
      "numbers": [
        {
          "numberType": 1,
          "number": "12345678900",
          "verified": 1
        },
        {
          "numberType": 4,
          "number": "john@example.com",
          "verified": 1
        }
      ],
      "sysValues": [
        {
          "key": "MEMBER_CODE",
          "value": "MEM-123456"
        }
      ],
      "addresses": {
        "addressType": 1,
        "add1": "Example Street",
        "add2": "Apt 101",
        "number": 123,
        "add3": "Downtown",
        "zip": "01234567",
        "city": "São Paulo",
        "state": "SP",
        "iso3": "BRA"
      }
    }
  ]
}

Complete Example - Registration with Membership Plan and SSO Account

json
{
  "systemId": 0,
  "data": [
    {
      "data": {
        "identity": 0,
        "name1": "Mary Johnson",
        "gender": "F",
        "birthday": 20,
        "birthMonth": 3,
        "birthYear": 1985,
        "nationalityIso3": "BRA"
      },
      "numbers": [
        {
          "numberType": 1,
          "number": "98765432100",
          "verified": 1
        },
        {
          "numberType": 4,
          "number": "mary@example.com",
          "verified": 1
        }
      ],
      "addresses": {
        "addressType": 1,
        "add1": "Main Avenue",
        "number": 500,
        "add3": "Garden District",
        "zip": "04567890",
        "city": "São Paulo",
        "state": "SP",
        "iso3": "BRA"
      },
      "memberships": [
        {
          "externalId": "CONTRACT-2025-001",
          "status": "Active",
          "data": "2025-01-15T10:00:00.000Z",
          "codigoCliente": "98765432100",
          "plano": "Annual Premium Plan",
          "planoCode": "PREMIUM-ANNUAL",
          "parcelas": 12,
          "validade": "2026-01-15T10:00:00.000Z",
          "origem": "Website",
          "ativacao": "2025-01-15T10:00:00.000Z",
          "tipoVigencia": "Annual",
          "formaPagamento": "Credit Card"
        }
      ],
      "optins": [
        {
          "optinCode": "NEWSLETTER",
          "optinDesc": "I agree to receive newsletters",
          "optinDate": "2025-01-15T10:00:00.000Z"
        },
        {
          "optinCode": "SMS",
          "optinDesc": "I agree to receive promotional SMS",
          "optinDate": "2025-01-15T10:00:00.000Z"
        }
      ],
      "pwd": "password123"
    }
  ]
}

Success Response

Status: 200 OK

json
{
  "header": {
    "codigo": 1,
    "msg": "Ok"
  },
  "data": {
    "resume": {
      "total": 1,
      "success": 1,
      "fail": 0,
      "status": "SUCCESS"
    },
    "items": [
      {
        "userId": 6011883,
        "success": true,
        "cpf": "12345678900",
        "email": "john@example.com",
        "alternativeNumber": null,
        "messageError": null,
        "account": {
          "success": true,
          "login": "12345678900",
          "messageError": null
        }
      }
    ]
  }
}

Response Fields

Resume

FieldTypeDescription
totalnumberTotal users processed
successnumberTotal processed successfully
failnumberTotal with error
statusstringOverall status: SUCCESS, PARTIAL_SUCCESS or FAILURE

Items

FieldTypeDescription
userIdnumberCreated user ID (0 if not created)
successbooleanProcessing success
cpfstringUser's CPF
emailstringUser's email
alternativeNumberstring/nullAlternative code
messageErrorstring/nullError message
accountobjectCreated SSO account details

Account (when pwd or pwdhash is sent)

FieldTypeDescription
successbooleanIf the SSO account was created successfully
loginstringAccount login (usually CPF)
messageErrorstring/nullAccount creation error message

Implementation Example

javascript
async function processBatchRegistrations(data, accessToken) {
  const response = await fetch('{connect-production}/api/v2/IF_ID_Batch', {
    method: 'POST',
    headers: {
      'AccessToken': accessToken,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)
  });

  if (!response.ok) {
    throw new Error(`Error ${response.status}: ${response.statusText}`);
  }

  return await response.json();
}

const data = {
  systemId: 0,
  data: [
    {
      data: {
        identity: 0,
        name1: "John Smith",
        birthday: 15,
        birthMonth: 8,
        birthYear: 1990
      },
      numbers: [
        { numberType: 1, number: "12345678900", verified: 1 },
        { numberType: 4, number: "john@example.com", verified: 1 }
      ],
      pwd: "password123"
    }
  ]
};

processBatchRegistrations(data, accessToken)
  .then(result => console.log(result))
  .catch(error => console.error(error));

Auxiliary Tables

For fields like iso3 (country) and nationalityIso3 (nationality), see the Auxiliary Tables page with the complete list of country ISO3 codes.

Fanbase API Documentation