{
"CompanyNumber": {
"CompanyNumber": "AB123456",
"CountryCode": "IT"
}
}
import re
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import LegalUser
legal_user = LegalUser(
id = '210602889'
)
company_number = str(legal_user.company_number)
validation_regex = re.compile(r"^[0-9]{11}$|^[a-z]{2}[0-9]{7}$|^[a-z]{2}[0-9]{6}$")
validate_it = validation_regex.match(company_number)
print(bool(validate_it))
{
"CompanyNumber": {
"CompanyNumber": "12345678",
"CountryCode": "GB",
"IsValid": true,
"ValidationRules": [
"^[0-9]{8}$|^[0-9]{7}$|^SC[0-9]{6}$|^NI[0-9]{6}$|^OC[0-9]{6}$|^R[0-9]{7}$|^IP[0-9]{5}R$|^SO[0-9]{6}$"
]
}
}
User data format
Validate the format of User data
POST
/
v2.01
/
{ClientId}
/
users
/
data-formats
/
validation
{
"CompanyNumber": {
"CompanyNumber": "AB123456",
"CountryCode": "IT"
}
}
import re
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import LegalUser
legal_user = LegalUser(
id = '210602889'
)
company_number = str(legal_user.company_number)
validation_regex = re.compile(r"^[0-9]{11}$|^[a-z]{2}[0-9]{7}$|^[a-z]{2}[0-9]{6}$")
validate_it = validation_regex.match(company_number)
print(bool(validate_it))
{
"CompanyNumber": {
"CompanyNumber": "12345678",
"CountryCode": "GB",
"IsValid": true,
"ValidationRules": [
"^[0-9]{8}$|^[0-9]{7}$|^SC[0-9]{6}$|^NI[0-9]{6}$|^OC[0-9]{6}$|^R[0-9]{7}$|^IP[0-9]{5}R$|^SO[0-9]{6}$"
]
}
}
This endpoint allows you to check that the format of the
CompanyNumber is correct and retrieve the validation rules applied to it.
The CompanyNumber must be in the correct format for Business Legal Users to be KYC/B verified.
Caution – Veracity of data checked during verificationThis endpoint only checks that the format of the data corresponds to that which is expected. Whether or not the data is true and correct for the specific User is checked during the user verification process when documents are submitted.
Body parameters
object
Information about the registration number of a legal entity. For details, see the Company number article.
Show properties
Show properties
string
required
The registration number of a legal entity, assigned by the relevant national authority.Note: Any non-alphanumeric characters, like dashes or spaces, are removed before applying the validation rules.
string
required
Format: Two-letter country code (ISO 3166-1 alpha-2 format)The country of the registration of the legal entity, against which the company number format is validated.
Responses
200 - Valid format for the country
200 - Valid format for the country
string
Information about the registration number of a legal entity. For details, see the Company number article.
Show properties
Show properties
string
The registration number of a legal entity, assigned by the relevant national authority.Note: Any non-alphanumeric characters, like dashes or spaces, are removed before applying the validation rules.
string
Format: Two-letter country code (ISO 3166-1 alpha-2 format)The country of the registration of the legal entity, against which the company number format is validated.
boolean
Whether the format of the value is valid for the country.
array
The list of regular expressions applicable to the country. Rules only exist for countries listed in the Company number article.Note: Any non-alphanumeric characters, like dashes or spaces, are removed before applying the validation rules.
400 - Country code not recognized
400 - Country code not recognized
{
"Message": "One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error.",
"Type": "param_error",
"Id": "0421656b-5f32-4475-874c-561449f9ffbf",
"Date": 1697101284.0,
"errors": {
"CompanyNumber.CountryCode": "The requested value is not an ISO 3166-1 alpha-2 code which is expected."
}
}
{
"CompanyNumber": {
"CompanyNumber": "12345678",
"CountryCode": "GB",
"IsValid": true,
"ValidationRules": [
"^[0-9]{8}$|^[0-9]{7}$|^SC[0-9]{6}$|^NI[0-9]{6}$|^OC[0-9]{6}$|^R[0-9]{7}$|^IP[0-9]{5}R$|^SO[0-9]{6}$"
]
}
}
{
"CompanyNumber": {
"CompanyNumber": "AB123456",
"CountryCode": "IT"
}
}
import re
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import LegalUser
legal_user = LegalUser(
id = '210602889'
)
company_number = str(legal_user.company_number)
validation_regex = re.compile(r"^[0-9]{11}$|^[a-z]{2}[0-9]{7}$|^[a-z]{2}[0-9]{6}$")
validate_it = validation_regex.match(company_number)
print(bool(validate_it))
Was this page helpful?
⌘I