createCustomerClaim

createCustomerClaim

This method allows you to create a new customer claim. Note that only one customer claim is allowed per customer.

Parameters

  • customerId (string, required): The UUID of the customer.

Body Parameters

  • sub (string, optional): Subject identifier.
  • name (string, optional): Full name of the customer.
  • givenName (string, optional): Given name of the customer.
  • familyName (string, optional): Family name of the customer.
  • middleName (string, optional): Middle name of the customer.
  • nickname (string, optional): Nickname of the customer.
  • preferredUsername (string, optional): Preferred username of the customer.
  • profile (string, optional): Profile URL of the customer.
  • picture (string, optional): Picture URL of the customer.
  • pictureBase64 (string, optional): Base64 encoded picture of the customer.
  • website (string, optional): Website URL of the customer.
  • gender (string, optional): Gender of the customer.
  • birthdate (date-time, optional): Birthdate of the customer.
  • zoneinfo (string, optional): Time zone of the customer.
  • locale (string, optional): Locale of the customer.
  • countryOfResidence (string, optional): Country of residence (ISO 3166-1 alpha-3 country code).
  • nationality (string, optional): Nationality (ISO 3166-1 alpha-3 country code).

Returns

A JSON object indicating the successful creation of the customer claim.

Usage Example

const axios = require('axios');
let data = JSON.stringify({
  "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.885Z",
  "zoneinfo": "string",
  "locale": "string",
  "countryOfResidence": "AFG",
  "nationality": "AFG"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.nexera.id/customers/:customerId/claims',
  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);
});