createCustomers

createCustomers

This method allows you to create multiple customers for a given project.

Parameters

  • customerType (string, required): The type of customers to be created. Possible values are "Individual" or "Company".
  • customerData (object[], required): An array of customer data objects, each containing the necessary details for creating a customer.
  • cmsProjectId (string, required): The project ID associated with these customers.

Returns

A JSON array containing the IDs of the created customers.

Usage Example

const axios = require('axios');
let data = JSON.stringify({
  "customerType": "Individual",
  "customerData": [
    {
      "customerWallet": {
        "wallet": "string",
        "blockchainNamespace": "tezos",
        "verified": true,
        "createdBy": "string"
      },
      "customerClaims": {
        "sub": "string",
        "name": "string",
        "givenName": "string",
        "familyName": "string",
        "middleName": "string",
        "nickname": "string",
        "preferredUsername": "string",
        "profile": "string",
        "picture": "string",
        "pictureBase64": "string",
        "website": "string",
        "gender": "string",
        "birthdate": "2024-08-07T13:45:40.886Z",
        "zoneinfo": "string",
        "locale": "string",
        "countryOfResidence": "AFG",
        "nationality": "AFG",
        "createdBy": "string",
        "address": "string"
      },
      "customerDid": {
        "did": "string",
        "createdBy": "string",
        "updatedBy": "string"
      }
    }
  ],
  "cmsProjectId": "string"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.nexera.id/customers/batch',
  headers: { 
    'Content-Type': 'application/json', 
    'Accept': 'application/json', 
    'Authorization': 'Bearer <TOKEN>'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});