POST | /account/register | Create a new account |
---|
"use strict";
export class Authentication {
/** @param {{apiUserId?:string,apiUserKey?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description The API User ID provided by us when you signed up to use our API */
apiUserId;
/**
* @type {string}
* @description The API User Key provided by us when you signed up to use our API */
apiUserKey;
}
export class BaseRequest {
/** @param {{authentication?:Authentication}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {Authentication}
* @description The authentication credentials */
authentication;
}
export class ResponseError {
/** @param {{errorCode?:string,fieldName?:string,message?:string,meta?:{ [index: string]: string; }}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
errorCode;
/** @type {string} */
fieldName;
/** @type {string} */
message;
/** @type {{ [index: string]: string; }} */
meta;
}
export class ArrayOfResponseError extends Array {
constructor(init) { super(init); Object.assign(this, init) }
}
export class ResponseStatus {
/** @param {{errorCode?:string,message?:string,stackTrace?:string,errors?:ArrayOfResponseError,meta?:{ [index: string]: string; }}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
errorCode;
/** @type {string} */
message;
/** @type {string} */
stackTrace;
/** @type {ArrayOfResponseError} */
errors;
/** @type {{ [index: string]: string; }} */
meta;
}
export class BaseResponse {
/** @param {{responseStatus?:ResponseStatus}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {ResponseStatus}
* @description The status of the response */
responseStatus;
}
export class RegisterAccountData extends BaseResponse {
/** @param {{apiUserId?:string,apiUserKey?:string,responseStatus?:ResponseStatus}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/**
* @type {string}
* @description A unique identifier for the users API access */
apiUserId;
/**
* @type {string}
* @description A secure, randomly generated key used for API authentication */
apiUserKey;
}
export class RegisterAccountResponse {
/** @param {{data?:RegisterAccountData}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {RegisterAccountData}
* @description The response data */
data;
}
export class RegisterAccountRequest {
/** @param {{username?:string,password?:string,email?:string,fullName?:string,companyName?:string,companyPhone?:string,address1?:string,address2?:string,address3?:string,city?:string,postcode?:string,country?:string,companyType?:string,companyIndustry?:string,companyNetwork?:string,agreeToTerms?:boolean,agreeToDataProtection?:boolean,agreeToContact?:boolean,agreeToPrivacy?:boolean,voucherCode?:string,accountActivationCode?:string,vatNumber?:string,vatCountry?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description The desired login username for the account */
username;
/**
* @type {string}
* @description The password for account login */
password;
/**
* @type {string}
* @description The contact email address for the account holder */
email;
/**
* @type {string}
* @description The full legal name of the account holder */
fullName;
/**
* @type {string}
* @description The registered name of the company associated with this account */
companyName;
/**
* @type {string}
* @description The primary contact phone number of the company */
companyPhone;
/**
* @type {string}
* @description The first line of the company’s address (e.g., street name and number) */
address1;
/**
* @type {string}
* @description The second line of the company’s address (optional) */
address2;
/**
* @type {string}
* @description The third line of the company’s address (optional) */
address3;
/**
* @type {string}
* @description The city where the company is located (optional) */
city;
/**
* @type {string}
* @description The postal or ZIP code of the company’s address */
postcode;
/**
* @type {string}
* @description The country where the company is registered */
country;
/**
* @type {string}
* @description The classification of the company (e.g., LLC, Corporation, Sole Proprietorship) */
companyType;
/**
* @type {string}
* @description The industry sector the company operates in */
companyIndustry;
/**
* @type {string}
* @description The trade body, network, or affiliation the company is a member of (if applicable) */
companyNetwork;
/**
* @type {boolean}
* @description Indicates agreement to the terms and conditions (required) */
agreeToTerms;
/**
* @type {boolean}
* @description Indicates agreement to the data protection statement (required) */
agreeToDataProtection;
/**
* @type {boolean}
* @description Indicates consent to be contacted (optional) */
agreeToContact;
/**
* @type {boolean}
* @description Indicates agreement to the privacy policy (required) */
agreeToPrivacy;
/**
* @type {string}
* @description An optional voucher code for discounts or promotions */
voucherCode;
/**
* @type {string}
* @description An optional code that grants access to certain features or subscriptions */
accountActivationCode;
/**
* @type {string}
* @description The company's VAT registration number (if applicable) */
vatNumber;
/**
* @type {string}
* @description The country where the company is VAT-registered */
vatCountry;
}
export class RegisterAccount extends BaseRequest {
/** @param {{request?:RegisterAccountRequest,authentication?:Authentication}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/** @type {RegisterAccountRequest} */
request;
}
JavaScript RegisterAccount DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /account/register HTTP/1.1
Host: api.sanctionssearch.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"request":{"username":"String","password":"String","email":"String","fullName":"String","companyName":"String","companyPhone":"String","address1":"String","address2":"String","address3":"String","city":"String","postcode":"String","country":"String","companyType":"String","companyIndustry":"String","companyNetwork":"String","agreeToTerms":false,"agreeToDataProtection":false,"agreeToContact":false,"agreeToPrivacy":false,"voucherCode":"String","accountActivationCode":"String","vatNumber":"String","vatCountry":"String"},"authentication":{"apiUserId":"String","apiUserKey":"String"}}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"data":{"apiUserId":"String","apiUserKey":"String","responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}}