Register User
curl --request POST \
--url https://testapi.kravata.co/api/b2b2b/{clientId}/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"constitutionDate": "2002-04-13",
"tradeName": "TEST K USER 1",
"constitutionCountry": {
"code": "CO"
},
"constitutionState": "Cundinamarca",
"constitutionCity": "Bogotá",
"person": {
"firstName": "TEST",
"middleName": "K",
"lastName": "USER",
"identificationType": "nit",
"identificationNro": "223333222",
"verificateDigit": 8,
"businessName": "TEST K USER 1",
"contactsData": [
{
"dataTypeContact": "address",
"dataValue": "Fake Street 123",
"postalCode": "None",
"city": null
},
{
"dataTypeContact": "email",
"dataValue": "user@example.com"
},
{
"dataTypeContact": "phone",
"dataValue": "3001234567"
}
]
}
}
'import requests
url = "https://testapi.kravata.co/api/b2b2b/{clientId}/users"
payload = {
"constitutionDate": "2002-04-13",
"tradeName": "TEST K USER 1",
"constitutionCountry": { "code": "CO" },
"constitutionState": "Cundinamarca",
"constitutionCity": "Bogotá",
"person": {
"firstName": "TEST",
"middleName": "K",
"lastName": "USER",
"identificationType": "nit",
"identificationNro": "223333222",
"verificateDigit": 8,
"businessName": "TEST K USER 1",
"contactsData": [
{
"dataTypeContact": "address",
"dataValue": "Fake Street 123",
"postalCode": "None",
"city": None
},
{
"dataTypeContact": "email",
"dataValue": "user@example.com"
},
{
"dataTypeContact": "phone",
"dataValue": "3001234567"
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
constitutionDate: '2002-04-13',
tradeName: 'TEST K USER 1',
constitutionCountry: {code: 'CO'},
constitutionState: 'Cundinamarca',
constitutionCity: 'Bogotá',
person: {
firstName: 'TEST',
middleName: 'K',
lastName: 'USER',
identificationType: 'nit',
identificationNro: '223333222',
verificateDigit: 8,
businessName: 'TEST K USER 1',
contactsData: [
{
dataTypeContact: 'address',
dataValue: 'Fake Street 123',
postalCode: 'None',
city: null
},
{dataTypeContact: 'email', dataValue: 'user@example.com'},
{dataTypeContact: 'phone', dataValue: '3001234567'}
]
}
})
};
fetch('https://testapi.kravata.co/api/b2b2b/{clientId}/users', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Users
Register User
Registers a user (end customer) under your company. Available for the B2B2B model. The user starts as pending and can operate once Kravata approves it.
Request
| Field | Type | Required | Description |
|---|---|---|---|
| Authorization | Header | Yes | Bearer <access> obtained from POST /api/token. |
| clientId | Path | Yes | Your client ID, from GET /api/infoClient. |
| relatedUserId | Query | No | Register the user under one of your existing users instead of directly under your company. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| constitutionCountry | object | Yes | {"code": "CO"} and/or {"name": "Colombia"}, from GET /api/helpers/countries. |
| constitutionCity | string | Yes | City name, from GET /api/helpers/cities. |
| constitutionState | string | No | Department, state or province. |
| constitutionDate | string | No | Incorporation date, or birth date for natural persons. Format YYYY-MM-DD. |
| tradeName | string | No | Commercial name, or full legal name for natural persons. |
| person | object | Yes | Identity data (below). |
| person.identificationType | string | Yes | cc, nit, ce, pp or nitf (foreign tax ID). |
| person.identificationNro | string | Yes, except nitf | ID number (max 32 characters). |
| person.verificateDigit | integer | No | Verification digit, for nit. |
| person.businessName | string | Yes for nitf | Legal name of the company or person. |
| person.firstName / middleName / firstSurname / lastName | string | No | Names of a natural person (max 50 characters each). |
| person.contactsData | array | Yes | Contacts as {"dataTypeContact", "dataValue", "postalCode", "city"}. Must include at least one email and one address. |
If a person with the same ID type and number already exists, it is reused.
Response
The registered user, with the same fields as GET /api/b2b2b/{clientId}/users.
POST
/
api
/
b2b2b
/
{clientId}
/
users
Register User
curl --request POST \
--url https://testapi.kravata.co/api/b2b2b/{clientId}/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"constitutionDate": "2002-04-13",
"tradeName": "TEST K USER 1",
"constitutionCountry": {
"code": "CO"
},
"constitutionState": "Cundinamarca",
"constitutionCity": "Bogotá",
"person": {
"firstName": "TEST",
"middleName": "K",
"lastName": "USER",
"identificationType": "nit",
"identificationNro": "223333222",
"verificateDigit": 8,
"businessName": "TEST K USER 1",
"contactsData": [
{
"dataTypeContact": "address",
"dataValue": "Fake Street 123",
"postalCode": "None",
"city": null
},
{
"dataTypeContact": "email",
"dataValue": "user@example.com"
},
{
"dataTypeContact": "phone",
"dataValue": "3001234567"
}
]
}
}
'import requests
url = "https://testapi.kravata.co/api/b2b2b/{clientId}/users"
payload = {
"constitutionDate": "2002-04-13",
"tradeName": "TEST K USER 1",
"constitutionCountry": { "code": "CO" },
"constitutionState": "Cundinamarca",
"constitutionCity": "Bogotá",
"person": {
"firstName": "TEST",
"middleName": "K",
"lastName": "USER",
"identificationType": "nit",
"identificationNro": "223333222",
"verificateDigit": 8,
"businessName": "TEST K USER 1",
"contactsData": [
{
"dataTypeContact": "address",
"dataValue": "Fake Street 123",
"postalCode": "None",
"city": None
},
{
"dataTypeContact": "email",
"dataValue": "user@example.com"
},
{
"dataTypeContact": "phone",
"dataValue": "3001234567"
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
constitutionDate: '2002-04-13',
tradeName: 'TEST K USER 1',
constitutionCountry: {code: 'CO'},
constitutionState: 'Cundinamarca',
constitutionCity: 'Bogotá',
person: {
firstName: 'TEST',
middleName: 'K',
lastName: 'USER',
identificationType: 'nit',
identificationNro: '223333222',
verificateDigit: 8,
businessName: 'TEST K USER 1',
contactsData: [
{
dataTypeContact: 'address',
dataValue: 'Fake Street 123',
postalCode: 'None',
city: null
},
{dataTypeContact: 'email', dataValue: 'user@example.com'},
{dataTypeContact: 'phone', dataValue: '3001234567'}
]
}
})
};
fetch('https://testapi.kravata.co/api/b2b2b/{clientId}/users', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Authorizations
Access token from POST /api/token (valid 5 minutes).
Path Parameters
Body
application/json
Response
200
Successful response

